Uploaded image for project: 'JDK'
  1. JDK
  2. JDK-8213806

WebView - JVM crashes for given HTML

XMLWordPrintable

    • web
    • b06
    • x86_64
    • generic

        ADDITIONAL SYSTEM INFORMATION :
        Its crashes on Win7 64bit, and Linux 64bit (manjaro).
        Tested on Jdk 10.0.2 and 11.0.1

        A DESCRIPTION OF THE PROBLEM :
        JVM crashes wen we load 2 times following HTML to JavaFX WebView component:


        <blockquote class=\"twitter-tweet\"><a href=\"https://twitter.com/stu_bot3000/status/793389598227529728?ref_src=twsrc%5Etfw\"></a></blockquote>\n" +
                            "<script src=\"https://platform.twitter.com/widgets.js\"></script>


        STEPS TO FOLLOW TO REPRODUCE THE PROBLEM :
        Load given HTML to WebView, wait for a while to load content completely, and set this html content again.


        ---------- BEGIN SOURCE ----------
        import javafx.application.Application;
        import javafx.application.Platform;
        import javafx.scene.Scene;
        import javafx.scene.web.WebView;
        import javafx.stage.Stage;

        public class Main extends Application {

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

            @Override
            public void start(Stage primaryStage) {
                try {
                    WebView webView = new WebView();

                    Scene scene = new Scene(webView, 800, 600);
                    primaryStage.setScene(scene);
                    primaryStage.show();

                    String crashHtml = "<blockquote class=\"twitter-tweet\"><a href=\"https://twitter.com/stu_bot3000/status/793389598227529728?ref_src=twsrc%5Etfw\"></a></blockquote>\n" +
                            "<script src=\"https://platform.twitter.com/widgets.js\"></script>";

                    webView.getEngine().loadContent(crashHtml);

                    new Thread(() -> {
                        try {
                            System.out.println("Wait 5 sec to full load, then set this content again...");
                            Thread.sleep(5000);
                            Platform.runLater(() -> {
                                System.out.println("Reloading... and crash...");
                                webView.getEngine().loadContent(crashHtml);
                            });
                        } catch (Exception e) {
                        }
                    }).start();


                } catch (Exception e) {
                    e.printStackTrace();
                }
            }
        }
        ---------- END SOURCE ----------

        FREQUENCY : always


          1. Main2.java
            1 kB
          2. load.html
            0.2 kB
          3. hs_err_pid1816.log
            95 kB

              arajkumar Arunprasad Rajkumar
              webbuggrp Webbug Group
              Votes:
              0 Vote for this issue
              Watchers:
              6 Start watching this issue

                Created:
                Updated:
                Resolved: