Comments (15)
@rosmo — Yeah that might just make a bit more sense. I wonder what others think?
from v8js.
👍
... but I think we should leave executeString
around. The recently added checkString
method might be a good candidate for deprecation, in favour of compileString
.
from v8js.
Sounds good. I already wrote preliminary version of the changes needed, but I'll polish them a bit. I chose the resource way, since it's much less work.
from v8js.
Here's the changes: https://github.com/rosmo/v8js/commits/compile-script
from v8js.
Hi @rosmo,
please see my inline comments to your commits.
Besides that
- I would prefer an implementation of
executeString
subsequently callingcompileString
andexecuteScript
(+ free resource) to not duplicate so much code (both execute functions share about 120 lines of unmodified code) - what about declaring
checkString
deprecated and usingcompileString
already internally + freeing the resource immediately? (and if we don't deprecate the symbol, I still think that one can call the other + free resource to not duplicate the code)
cheers
~stesie
from v8js.
Totally forgot about checkString(). And you're right about the duplication. I'll fix the issues ASAP.
from v8js.
Here's a better branch: https://github.com/rosmo/v8js/commits/compile-script-fix
I'm not sure about the last commit though, because I'm not that familiar with V8. I thought the previous style was leaking memory, but it seems like the leaking is happening with the master branch as well (Apache's RSS seems to grow and not stabilize).
from v8js.
The memory leak could be issue #71 related though.
from v8js.
I updated the compile branch: https://github.com/rosmo/v8js/commits/compile-script-201409
from v8js.
@rosmo thanks for your contribution!
I just changed checkString
(though deprecated) to use your new functions likewise.
cheers
~stesie
from v8js.
hmm, seems like this breaks the test fatal_error_recursive.php
at least with certain v8 versions
3.29.1 regularly crashes with this trace
#0 0x00007ffff382c8de in v8::internal::IncrementalMarkingRootMarkingVisitor::VisitPointer(v8::internal::Object**) ()
from /var/lib/jenkins/workspace/v8js-with-v8-3.29.1/v8-3.29.1/lib/libv8.so
#1 0x00007ffff38ea5cd in v8::internal::Isolate::Iterate(v8::internal::ObjectVisitor*, v8::internal::ThreadLocalTop*) ()
from /var/lib/jenkins/workspace/v8js-with-v8-3.29.1/v8-3.29.1/lib/libv8.so
#2 0x00007ffff3810873 in v8::internal::Heap::IterateStrongRoots(v8::internal::ObjectVisitor*, v8::internal::VisitMode) ()
from /var/lib/jenkins/workspace/v8js-with-v8-3.29.1/v8-3.29.1/lib/libv8.so
#3 0x00007ffff382d6ed in v8::internal::IncrementalMarking::StartMarking(v8::internal::IncrementalMarking::CompactionFlag) ()
from /var/lib/jenkins/workspace/v8js-with-v8-3.29.1/v8-3.29.1/lib/libv8.so
#4 0x00007ffff382e2a3 in v8::internal::IncrementalMarking::Start(v8::internal::IncrementalMarking::CompactionFlag) ()
from /var/lib/jenkins/workspace/v8js-with-v8-3.29.1/v8-3.29.1/lib/libv8.so
#5 0x00007ffff381f55e in v8::internal::Heap::IdleNotification(int) ()
from /var/lib/jenkins/workspace/v8js-with-v8-3.29.1/v8-3.29.1/lib/libv8.so
#6 0x00007ffff3f46c2e in php_v8js_free_storage (object=0x7ffff7fd56a8) at /home/stesie/Projekte/v8js/v8js.cc:694
#7 0x00000000006c6d17 in zend_objects_store_free_object_storage ()
#8 0x00000000006912dc in ?? ()
#9 0x000000000069fd85 in ?? ()
#10 0x000000000063f47a in php_request_shutdown ()
#11 0x0000000000749fe4 in ?? ()
#12 0x000000000043141a in ?? ()
#13 0x00007ffff4d62b45 in __libc_start_main () from /lib/x86_64-linux-gnu/libc.so.6
#14 0x00000000004314ad in _start ()
from v8js.
hmmm, I'll close this again, since it doesn't seem to be the cause of the problem.
The problem probably is still only the stack unwinding stuff, the commit above makes it better but it's still not stable. Jenkins tells v8 versions 3.29.54 to 3.29.66 are unstable (i.e. the aforementioned test fails) and all other versions from 3.27.1 on are stable. However I cannot verify that on a second box.
And I just now noticed that subsequent requests (within the same php process) to one with a unwound fatal error just fail. I'll follow up with a specific bug report.
from v8js.
Could we blacklist some versions if they are unstable?
from v8js.
@rosmo I don't think that blacklisting is the way to go. The unwinding still has its flaws (two less since today, but still at least one more) and leads to crashes here and there. I can reproduce crashes with versions 3.29.54 to 3.29.66 on two boxes with PHP 5.4; but not with 5.5 (which crashes with 3.25.30 though).
from v8js.
@stesie There is a difference/bug when doing previous executeString and executeScript (we noticed this while doing an upgrade). I will try to produce a test case for this.
from v8js.
Related Issues (20)
- Divergences & pull requests HOT 4
- Trying to compile with php8 branch on ubuntu 22, getting error: could not determine libv8 version (v8 compiled succesfully) HOT 3
- Dynamic Properties deprecation in PHP 8.2 HOT 4
- Broken build on PHP 8.0.x HOT 2
- Segmentation fault - possibly another GC issue? HOT 7
- Compromise between FORCE_ARRAY and standard setup HOT 8
- sandbox error with v8 11.1.277.13 HOT 1
- libv8 must be version 9.0 or greater (using dockerfile) HOT 1
- Issue running make in ubuntu 22.04 HOT 2
- windows php 8.1
- compile error with g++ 13: error: expected unqualified-id before '&' token
- With wich version of V8 this php library work ? HOT 4
- Error installing on debian 11
- This LIB is very hard to install ! HOT 14
- PROHIBITS_OVERWRITING removed from V8 and causing V8Js compile error. HOT 1
- V8Js 3.0.0 HOT 1
- Is the latest recommended release 2.1.1 or 2.1.2? HOT 4
- Do I have permission to refactor this? HOT 3
- Compilation error: "no matching function for call to 'v8::ObjectTemplate::SetAccessor" HOT 6
- Linux arm64 support? HOT 3
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from v8js.