LiquidPlayer / LiquidCore

Node.js virtual machine for Android and iOS
MIT License
1.01k stars 128 forks source link

Crashes when running testJavaScriptCoreMiniDOM #12

Closed mrueger42 closed 7 years ago

mrueger42 commented 7 years ago

Device: Nexus 5X with 7.1.1 Emulator: Nexus 5 API 24

A/libc: Fatal signal 11 (SIGSEGV), code 1, fault addr 0x0 in tid 19475 (roidJUnitRunner)

Build fingerprint: 'google/bullhead/bullhead:7.1.1/N4F26O/3582057:user/release-keys' 02-15 15:10:32.694 19491-19491/? A/DEBUG: Revision: 'rev_1.0' 02-15 15:10:32.694 19491-19491/? A/DEBUG: ABI: 'arm64'

ericwlange commented 7 years ago

Thanks for registering the issue. I am aware of this bug. It should work fine if you run that test alone, but it will crash if you run it in sequence with the other JSC tests.

There is some disagreement between how I've implemented garbage collection and how JavaScriptCore expects it to happen. This is occurring because the collector is running and clearing away unreferenced JSValueRefs, as the test code does not JSValueRetain the references. (Note, these tests are not written by me -- these are Apple's JSC tests, so I treat them as the gold standard for expected behavior). So there is some lifecycle assumption apparent in JSC that I haven't figured out yet.

I have slated this for fix in 0.3.0, which is the first release to actually use the JSC code (as it is required by React Native). At the moment, the JSC functionality is experimental.

mrueger42 commented 7 years ago

There is a comment here https://github.com/hszhsh/JavaScriptCore relating to GC, not sure if that may be of any help "I'm using WTF's RunLoop for GC timers on Android, so you need to call RunLoop::iterate() in your app's runloop on js thread."

ericwlange commented 7 years ago

Well, I'm not actually using JSC at all. LiquidCore runs on V8 -- I am shimming the JSC API and translating it to V8. The tests are to ensure that it complies with what JSC applications expect. I've cracked all other assumptions. This is the one sinister bug that remains!

ericwlange commented 7 years ago

Fixed in 345cc626d20005b3da063785dd99dcf21be33ebe

ericwlange commented 7 years ago

This is fixed in Release 0.2.2