flier / pyv8

60 stars 39 forks source link

Just for crying #5

Open aoshiken opened 6 years ago

aoshiken commented 6 years ago

This repo is totally outdated and unsupported, I know, I know... ...but I just want to share my thoughts about:

After wasting some days compiling V8 and patching PyV8 on Debian Stretch x64 platform I give up, that's really a shame but I can't put more time on this.

I fixed some bugs but my latest issue dealing with Isolates on multithreading ended up with a nice stacktrace trying to use a context from inside a thread:

aandres@dev-x64:/usr/local/src/pyv8$ ./kk.py

PyV8.JSEngine.version 5.8.110

PyV8.JSLocker.active False

PyV8.JSLocker.locked False

PyV8.JSLocker.active True

PyV8.JSLocker.locked True

Inside thread body [RUN] before PyV8.JSContext...

#
# Fatal error in /usr/local/src/v8-compiling-folder/v8/src/isolate.h, line 513
# Check failed: isolate != __null.
#

==== C stack trace ===============================

    /usr/local/lib/libv8_libbase.so(v8::base::debug::StackTrace::StackTrace()+0x1e) [0x7f6132a379ae]
    /usr/local/lib/libv8_libbase.so(V8_Fatal+0x1c4) [0x7f6132a322d4]
    /home/aandres/.cache/Python-Eggs/PyV8-2.0.0.dev0+5.8.110-py2.7-linux-x86_64.egg-tmp/_PyV8.so(v8::internal::Isolate::Current()+0x96) [0x7f613674f4de]
[...]

PyV8 unit tests follows just for the sake of confirming "halfworking":

aandres@dev-x64:/usr/local/src/pyv8$ python PyV8.py -v
2018-10-23 16:47:25,062 INFO testing PyV8 module 1.0 with V8 v5.8.110 (boost v1.62.0)
testMultiNamespace (__main__.TestContext) ... ERROR
testClassProperties (__main__.TestEngine) ... ok
testCompile (__main__.TestEngine) ... ok
testEval (__main__.TestEngine) ... ok
testExtension (__main__.TestEngine) ... ok
testGlobal (__main__.TestEngine) ... ok
testNativeExtension (__main__.TestEngine) ... ok
testObjectBuildInMethods (__main__.TestEngine) ... ok
testOutOfMemory (__main__.TestEngine) ... ok
testPrecompile (__main__.TestEngine) ... ok
testPythonWrapper (__main__.TestEngine) ... ok
testStackLimit (__main__.TestEngine) ... ok
testThis (__main__.TestEngine) ... ok
testUnicodeSource (__main__.TestEngine) ... ok
testLocker (__main__.TestMultiThread) ... ok
testMultiJavascriptThread (__main__.TestMultiThread) ...

#
# Fatal error in /usr/local/src/v8-compiling-folder/v8/src/isolate.h, line 513
# Check failed: isolate != __null.
#

==== C stack trace ===============================

    /usr/local/lib/libv8_libbase.so(v8::base::debug::StackTrace::StackTrace()+0x1e) [0x7f51475879ae]
    /usr/local/lib/libv8_libbase.so(V8_Fatal+0x1c4) [0x7f51475822d4]
    /home/aandres/.cache/Python-Eggs/PyV8-2.0.0.dev0+5.8.110-py2.7-linux-x86_64.egg-tmp/_PyV8.so(v8::internal::Isolate::Current()+0x96) [0x7f514b29f4de]

If anyone is interested on more details I could fork the repo (having more time) and make a branch with my modifications, just give me a call.

Bye, bye guys

danielburchardt commented 5 years ago

@aoshiken 👍

aoshiken commented 5 years ago

@danielburchardt if you want to experiment with my changes use my branch https://github.com/aoshiken/pyv8/tree/v5-initial-fixes but it crashes miserably but at least the README.md file explains in a concise way how to setup the V8 framework.

Hope this helps

danielburchardt commented 5 years ago

@aoshiken ok, i will check it!