0

the JavaFX application causes Java VM crash from time to time. according to crash log, the java frames are different, but the Problematic frame is same to "C [libc.so.6+0x3c10d]"

one of them is related to my application Java code, like this:

Java frames: (J=compiled Java code, j=interpreted, Vv=VM code)
j  com.sun.glass.ui.gtk.GtkApplication.enterNestedEventLoopImpl()V+0
J 23330 C1 com.sun.glass.ui.gtk.GtkApplication._enterNestedEventLoop()Ljava/lang/Object; (63 bytes) @ 0x00007f98c4e114f4 [0x00007f98c4e11160+0x394]
J 23329 C1 com.sun.glass.ui.Application.enterNestedEventLoop()Ljava/lang/Object; (39 bytes) @ 0x00007f98c2855f14 [0x00007f98c2855da0+0x174]
J 23326 C1 com.sun.glass.ui.EventLoop.enter()Ljava/lang/Object; (260 bytes) @ 0x00007f98c4e08a24 [0x00007f98c4e08760+0x2c4]
J 22177 C1 com.sun.javafx.tk.quantum.QuantumToolkit.enterNestedEventLoop(Ljava/lang/Object;)Ljava/lang/Object; (124 bytes) @ 0x00007f98c4bc387c [0x00007f98c4bc2660+0x121c]
J 22176 C1 javafx.stage.Stage.showAndWait()V (98 bytes) @ 0x00007f98c4b44c2c [0x00007f98c4b442a0+0x98c]
j  com.testin.itestin.manual.ui.TasksList.showDialog(Lcom/testin/itestin/manual/ui/Receiver;)V+138
j  com.testin.itestin.manual.ui.TasksList$1.run()V+4
J 13612 C2 com.sun.javafx.application.PlatformImpl$$Lambda$53.run()Ljava/lang/Object; (8 bytes) @ 0x00007f98c3227228 [0x00007f98c32271e0+0x48]
v  ~StubRoutines::call_stub
J 2098  java.security.AccessController.doPrivileged(Ljava/security/PrivilegedAction;Ljava/security/AccessControlContext;)Ljava/lang/Object; (0 bytes) @ 0x00007f98c16aef33 [0x00007f98c16aeec0+0x73]
J 13517 C2 com.sun.javafx.application.PlatformImpl$$Lambda$51.run()V (12 bytes) @ 0x00007f98c2475904 [0x00007f98c2475860+0xa4]
J 8909 C2 com.sun.glass.ui.InvokeLaterDispatcher$Future.run()V (91 bytes) @ 0x00007f98c16bf72c [0x00007f98c16bf6e0+0x4c]
v  ~StubRoutines::call_stub
j  com.sun.glass.ui.gtk.GtkApplication._runLoop(Ljava/lang/Runnable;Z)V+0
j  com.sun.glass.ui.gtk.GtkApplication.lambda$null$48(Ljava/lang/Runnable;Z)V+7
j  com.sun.glass.ui.gtk.GtkApplication$$Lambda$41.run()V+12
j  java.lang.Thread.run()V+11
v  ~StubRoutines::call_stub

it seemed happened while calling Stage.ShowAndWait() method. here are the related code:

public static void showDialog(final Receiver receiver) {
    String fxml = "/com/testin/itestin/manual/ui/TasksList.fxml";
    FXMLLoader loader = new FXMLLoader();
    InputStream in = TasksList.class.getResourceAsStream(fxml);
    loader.setBuilderFactory(new JavaFXBuilderFactory());
    loader.setLocation(TasksList.class.getResource(fxml));

    BorderPane page;

    try {
        page = (BorderPane) loader.load(in);
        Stage stage = new Stage();
        stage.initModality(Modality.APPLICATION_MODAL);//APPLICATION_MODAL);
        stage.initOwner(TestinStage.getPrimaryStage());
        stage.initStyle(StageStyle.UNDECORATED);
        stage.setResizable(false);

        Scene scene = new Scene(page);
        stage.setScene(scene);

        TasksListController controller = (TasksListController) loader
                .getController();
        controller.setStage(stage);
        ThreadPool.cachedThreadPoolExecute(() -> controller.refreshData(TaskService.getInstance()
                .getNativeAdaptList()));

        TasksHelper.setTaskListShown(true);
        stage.showAndWait();

        receiver.response = controller.getValue();
        receiver.exit = true;

    } catch (IOException e) {
        Log.error("showDialog", e.toString());
    } finally {
        try {
            in.close();
        } catch (IOException e) {
            e.printStackTrace();
        }
    }

}

here is a full log example hs_err2986.log. but there are different crash logs with different Java Frames,

such as:

Stack: [0x00007f9e120d8000,0x00007f9e121d9000],  sp=0x00007f9e121d7660,  free space=1021k
Native frames: (J=compiled Java code, j=interpreted, Vv=VM code, C=native code)
C  [libc.so.6+0x3c10d]

Java frames: (J=compiled Java code, j=interpreted, Vv=VM code)
j  com.sun.glass.ui.gtk.GtkApplication._runLoop(Ljava/lang/Runnable;Z)V+0
j  com.sun.glass.ui.gtk.GtkApplication.lambda$null$48(Ljava/lang/Runnable;Z)V+7
j  com.sun.glass.ui.gtk.GtkApplication$$Lambda$41.run()V+12
j  java.lang.Thread.run()V+11
v  ~StubRoutines::call_stub

or like this:

Stack: [0x00007ff43c982000,0x00007ff43ca83000],  sp=0x00007ff43ca81410,  free space=1021k
Native frames: (J=compiled Java code, j=interpreted, Vv=VM code, C=native code)
C  [libc.so.6+0x3c10d]

Java frames: (J=compiled Java code, j=interpreted, Vv=VM code)
J 6094  com.sun.prism.es2.GLContext.nClearBuffers(JFFFFZZZ)V (0 bytes) @ 0x00007ff44e186e9a [0x00007ff44e186e40+0x5a]
J 21673 C2 com.sun.javafx.tk.quantum.ViewPainter.paintImpl(Lcom/sun/prism/Graphics;)V (1457 bytes) @ 0x00007ff450842ee8 [0x00007ff450841d40+0x11a8]
J 21890 C2 com.sun.javafx.tk.quantum.PresentingPainter.run()V (675 bytes) @ 0x00007ff44d2b22c8 [0x00007ff44d2b2060+0x268]
J 20694 C2 com.sun.javafx.tk.RenderJob.run()V (105 bytes) @ 0x00007ff44f94358c [0x00007ff44f9434c0+0xcc]
J 21698% C2 java.util.concurrent.ThreadPoolExecutor.runWorker(Ljava/util/concurrent/ThreadPoolExecutor$Worker;)V (225 bytes) @ 0x00007ff44e675f1c [0x00007ff44e675d40+0x1dc]
j  java.util.concurrent.ThreadPoolExecutor$Worker.run()V+5
j  com.sun.javafx.tk.quantum.QuantumRenderer$PipelineRunnable.run()V+8
j  java.lang.Thread.run()V+11
v  ~StubRoutines::call_stub

or like this:

Stack: [0x00007f3748a60000,0x00007f3748b61000],  sp=0x00007f3748b5f780,  free space=1021k
Native frames: (J=compiled Java code, j=interpreted, Vv=VM code, C=native code)
C  [libc.so.6+0x3c10d]

Java frames: (J=compiled Java code, j=interpreted, Vv=VM code)
J 6014  sun.awt.X11.XlibWrapper.XEventsQueued(JI)I (0 bytes) @ 0x00007f37c20ccad4 [0x00007f37c20cca80+0x54]
j  sun.awt.X11.XToolkit.run(Z)V+63
j  sun.awt.X11.XToolkit.run()V+5
j  java.lang.Thread.run()V+11
v  ~StubRoutines::call_stub

Any suggestions are highly appreciated.

Most of the crashes happened after the JavaFX application running a long time. The environment are the same: Ubuntu 14.04 with Java 1.8, (Java HotSpot(TM) 64-Bit Server VM (25.171-b11) for linux-amd64 JRE (1.8.0_171-b11))

gebitang
  • 4,927
  • 1
  • 13
  • 12
  • this is still around. inspired by [this comment](https://stackoverflow.com/a/43647511/1087122) , use `stage.show(); stage.setOnHidden(e->{dosomething after stage is hidder.})` to avoid this bug. – gebitang Apr 10 '19 at 10:47
  • Duplicate of [Ubuntu, JavaFX, A fatal error has been detected by the Java Runtime Environment](https://stackoverflow.com/questions/29519242/ubuntu-javafx-a-fatal-error-has-been-detected-by-the-java-runtime-environment) – Nand Aug 13 '22 at 20:50

1 Answers1

1

This is a known bug, Linux-specific: https://bugs.openjdk.java.net/browse/JDK-8087368

Unfortunately it has not been planned for resolution yet.

I had the same problem happen on RHEL 6.5, but never on a RHEL 7.2, neither RHEL 6.9. Either it is dependent on the GNOME version, or I have been lucky on those other platforms...

Balderk
  • 167
  • 10