javajavafxjavafx-webengine

Application crash on WebCoreTestSupport::allowsAnySSLCertificate


When running an JavaFx application (from IntelliJ), using a webView/webengine, the application crashes when the webapp does (multiple) redirects ...

# A fatal error has been detected by the Java Runtime Environment:
#
#  SIGSEGV (0xb) at pc=0x000000033fc621bc, pid=25361, tid=259
#
# JRE version: OpenJDK Runtime Environment Temurin-21.0.4+7 (21.0.4+7) (build 21.0.4+7-LTS)
# Java VM: OpenJDK 64-Bit Server VM Temurin-21.0.4+7 (21.0.4+7-LTS, mixed mode, tiered, compressed oops, compressed class ptrs, g1 gc, bsd-aarch64)
# Problematic frame:
# C  [libjfxwebkit.dylib+0xc421bc]  WebCoreTestSupport::allowsAnySSLCertificate()+0x8e21f4
#
# No core dump will be written. Core dumps have been disabled. To enable core dumping, try "ulimit -c unlimited" before starting Java again
#
# An error report file with more information is saved as:
# (removed)
[19.190s][warning][os] Loading hsdis library failed
#
# If you would like to submit a bug report, please visit:
#   https://github.com/adoptium/adoptium-support/issues
# The crash happened outside the Java Virtual Machine in native code.
# See problematic frame for where to report the bug.
#
Disconnected from the target VM, address: '127.0.0.1:56125', transport: 'socket'

Process finished with exit code 134 (interrupted by signal 6:SIGABRT)  

Code

@FXML 
public WebView webView;

WebEngine webEngine;
String portalUrl = "some url";
String redirectUrl = "some url";

@Override
public void initialize(URL url, ResourceBundle resourceBundle){

    // Load webengine
    webEngine = webView.getEngine();

    addListeners();
}

...

private void addListeners() {

    // Add listener to the url property
    // If url changes, login was executed
    webEngine.locationProperty().addListener(
            new ChangeListener<String>() {
                @Override public void changed(ObservableValue ov, String oldState, String newState) {
                    if(oldState != null){
                        if (!oldState.equals(newState)) {

                            if(newState.indexOf(redirectUrl) == 0){ 
                                // We are on our final destination
                                // Do stuff
                                
                            }else if(newState.indexOf("?error=")>-1){
                                webEngine.load(portalUrl);
                            }

                        }
                    }
                }
            });

    if(!"".equals(portalUrl)){
        webEngine.load(portalUrl);
    }
}

We are working on a macBook pro M3, using Os X, Adoption Java 21.0.4 LTS JDK, JavaFX 21.04. We tried using java/javaFX 17 without any luck.


Solution

  • It seems upgrading to JavaFX 23 or 24 pre-release solved the issue ...