JDK-8284580 : [macos] WebView crashes App while using openjfx18
  • Type: Bug
  • Component: javafx
  • Sub-Component: other
  • Affected Version: openjfx18
  • Priority: P4
  • Status: Closed
  • Resolution: Cannot Reproduce
  • OS: generic
  • CPU: generic
  • Submitted: 2022-04-07
  • Updated: 2022-11-04
  • Resolved: 2022-11-04
Description
ADDITIONAL SYSTEM INFORMATION :
MacOs 10.13.6 (High Sierra)
jdk-18+36 (build from adoptium.net)
openjfx-18


A DESCRIPTION OF THE PROBLEM :
App crash every time when code try to create WebView component.

I see this problem on my Mac only on JDK17 and 18. In JDK16 everything works good.

My last debug point before crash is:
`com.sun.webkit.WebPage` when invoking native method: `pPage = twkCreatePage(editable);`

REGRESSION : Last worked in version 16

STEPS TO FOLLOW TO REPRODUCE THE PROBLEM :
Just create WebView component - it crashes in default constructor.


EXPECTED VERSUS ACTUAL BEHAVIOR :
EXPECTED -
Application do not crash, and WebView should work correctly.
ACTUAL -
Application crash, and print output to console:
```
Ran out of executable memory while allocating 160 bytes.
```

---------- BEGIN SOURCE ----------
package my.test;

import javafx.application.Application;
import javafx.scene.Scene;
import javafx.scene.layout.BorderPane;
import javafx.scene.web.WebView;
import javafx.stage.Stage;

public class WebView2 extends Application {

    public static void main(String[] args) {
        Application.launch(args);
    }

    @Override
    public void start(Stage primaryStage) throws Exception {

        WebView webView = new WebView();

        BorderPane layout = new BorderPane();
        layout.setCenter(webView);

        Scene s = new Scene(layout);
        primaryStage.setScene(s);
        primaryStage.show();
    }
}
---------- END SOURCE ----------

FREQUENCY : always



Comments
I cannot reproduce this. Maybe it's something related to the system your are running on, but I tried JDK 18 GA (from Oracle) and JavaFX 18 GA (from Gluon) as well as my own local build of JavaFX, and I cannot reproduce this. Based on the stack trace, it looks like the version of the JDK is what makes the difference -- JDK 16 + JavaFX 18 is fine and JDK 18 + JavaFX 18 crashes, but I can't think of any reason why that would be the case. In any event, I am closing as "Cannot reproduce". I note that JavaFX 18 and JDK 18 are superseded by JavaFX 19 and JDK 19, respectively, so the reporter might try that instead.
04-11-2022

Additional information from submitter: ============================ I was checked if libjfxweb.dylib is not loaded from somewhere else, but it seems to be loaded from JDK library. I've checked it by adding `DYLD_PRINT_LIBRARIES=YES` to env variables. There was a long list of libraries, but this was the last one on the list before crash: ``` dyld: loaded: /Users/XX_USER/workspace/java18/javafx-sdk-18/lib/libjfxwebkit.dylib Ran out of executable memory while allocating 160 bytes. ``` Path looks correct to openjfx package. I use openjfx downloaded from: https://openjfx.io (https://gluonhq.com/products/javafx/). I'm attaching full output here: <attached Libraries_java18.txt> When I switch to JDK16, there is no problem - app starts and do not crash. List of loaded libraries you can see here: <attached file Libraries_java16.txt> I use jdk from adoptium.net... But I also tried other JDKs (17 and 18) - (azul, libreica, openjdk.java.net, and also graalvm-17). From all tested JVM for jdk 17 and 18 only on IBM JDK - openj9 (https://developer.ibm.com/languages/java/semeru-runtimes/downloads/?os=macOS) app do not crash (see here: <link not working).
12-10-2022

I'll take a closer look at the logs, but I still think this is a class file / native lib mismatch.
12-10-2022

Closing this incident/report as Incomplete since we have not received any information from the submitter. Shall reopen, if we receive any update in future.
09-08-2022

Given the failure point, this is almost certainly due to a mismatch between the class files of the javafx.web module, and the native libjfxweb.dylib. I suspect that the latter is being loaded from somewhere other than the JavaFX 18 distribution.
08-04-2022

Mail to submitter: ============ Please share hs_err_<pid>.log file to analyze the issue better.
08-04-2022