JDK-8088406 : Java crashes when accessing DOM elements from outside of application thread
  • Type: Bug
  • Component: javafx
  • Sub-Component: web
  • Affected Version: 8,9
  • Priority: P4
  • Status: Open
  • Resolution: Unresolved
  • Submitted: 2014-09-09
  • Updated: 2018-09-05
The Version table provides details related to the release that this issue/RFE will be addressed.

Unresolved : Release in which this issue/RFE will be addressed.
Resolved: Release in which this issue/RFE has been resolved.
Fixed : Release in which this issue/RFE has been fixed. The release containing this fix may be available for download as an Early Access Release or a General Availability Release.

To download the current JDK release, click here.
Other
tbdUnresolved
Related Reports
Relates :  
Relates :  
Relates :  
Description
Reproducible: always for new webkit
Is a regression: No
Is a platform specific: reproducible on macos and linux.

Java crashes when trying to access dom object using WebEngine.execute method.
Steps to reproduce (example attached):
1. Create javafx application with webview (gui is non necessary).
2. Try to access any dom element with javascript: engine.executeScript("document.createElement('span')")
3. Access that variable (e.g. call toString()) from outside of application thread

Expected result: a kind of exception is thrown, because webengine objects must be manipulated only from application thread  ("WebEngine objects must be created and accessed solely from the JavaFX Application thread. This rule also applies to any DOM and JavaScript objects obtained from the WebEngine object.")

Actual result: java crashed with segfault.

Comments
The problem, potentially, exists in WebView not depending on a release number. However it started to reproduce in the new WebView update which is not yet integrated: RT-36726.
09-09-2014

RULE WebNodeAutomated/com/sun/fx/webnode/tests/bridge/BridgeSimpleTest/testDOMObject Crash SIGSEGV RULE WebNodeAutomated/com/sun/fx/webnode/tests/bridge/BridgeSimpleTest/testJSObject Crash SIGSEGV
09-09-2014