eclipsesource / J2V8

Java Bindings for V8
2.55k stars 355 forks source link

Errors in JS code lead to Fatal Error crashes on Android #501

Closed ancientloregames closed 4 years ago

ancientloregames commented 4 years ago

Hi! Before version 6.0 was released, I had been using version 4.8. Decided to migrate because of the official arm64 support. In my project, I store some V8Functions as class fields to use them as listeners for native events (onClick etc.). In 4.8, if there were some issues in the functions JS code (like NullPointer exceptions, calling a non-existing methods, syntax errors etc.), I just got warnings to my logcat:

undefined:1: TypeError: console.log1 is not a function
list.setListener((event, params) => { console.log1(event, params) })
                                              ^
TypeError: console.log1 is not a function
     at list.setListener (<anonymous>:1:47)
com.eclipsesource.v8.V8ScriptExecutionException
     at com.eclipsesource.v8.V8._executeFunction(Native Method)
     at com.eclipsesource.v8.V8.executeFunction(V8.java:1151)
     at com.eclipsesource.v8.V8Function.call(V8Function.java:95)
...

But in 6.0 I get Fatal Errors: Fatal signal 5 (SIGTRAP), code -6 (SI_TKILL) in tid 16542 (jsevents_thread), pid 14223

Is there a way to make them non-fatal again?

gleno commented 4 years ago

@ancientloregames There's a fix for that, but you'd have to build from master. See https://github.com/eclipsesource/J2V8/issues/499

ancientloregames commented 4 years ago

@gleno Hi! Thanks for the hint! I saw the commit that seems to fix the issue, but I would prefer not to build j2v8 manually. Eclipse Public License looks kinda sketchy (no hard feelings, guys).

ahmadov commented 4 years ago

The new version 6.1.0 has been published to Maven central.