JavaFX应用程序有时会导致Java VM崩溃。根据崩溃日志,java框架不同,但是问题框架与“ C [libc.so.6 + 0x3c10d]”相同
其中之一与我的应用程序Java代码相关,如下所示:
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
似乎在调用Stage.ShowAndWait()方法时发生了。这里是相关代码:
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();
}
}
}
这是完整的日志示例hs_err2986.log。 但是有不同的崩溃日志和不同的Java框架,
,例如:
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
或类似的
: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
或类似的
: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
任何建议都将受到高度赞赏。
大多数崩溃发生在JavaFX应用程序长时间运行之后。 环境是相同的:具有Java 1.8的Ubuntu 14.04,(适用于linux-amd64 JRE(1.8.0_171-b11)的Java HotSpot(TM)64位服务器VM(25.171-b11))
答案 0 :(得分:1)
这是特定于Linux的已知错误:https://bugs.openjdk.java.net/browse/JDK-8087368
很遗憾,尚未计划解决该问题。
我在RHEL 6.5上发生了相同的问题,但在RHEL 7.2和RHEL 6.9上都没有。 要么取决于GNOME版本,要么我很幸运在那些其他平台上……