我遇到一个问题,每当我检查是否支持GtkLookAndFeel时,JRE就会崩溃。令人惊讶的是,这个bug似乎只在Oracle JRE上出现。
到目前为止,我已经在三个JRE上测试了此行为:
(我使用了所有这些的64位版本)
- OpenJDK Runtime Environment (IcedTea 2.5.1) (7u65-2.5.1-4) -> 运行正常
- Java(TM) SE Runtime Environment (build 1.7.0_67-b01) -> 崩溃
- Java(TM) SE Runtime Environment (build 1.8.0_20-b26) -> 崩溃
以下是触发此错误的代码:
import javax.swing.LookAndFeel;
public class Test
{
public static void main(String[] args)
{
LookAndFeel currLAF = new com.sun.java.swing.plaf.gtk.GTKLookAndFeel();
currLAF.isSupportedLookAndFeel();
System.out.println("I am exiting main");
}
}
以下是输出结果:
I am exiting main
#
# A fatal error has been detected by the Java Runtime Environment:
#
# SIGSEGV (0xb) at pc=0x00007f91fe0fdbe0, pid=332, tid=140265730119424
#
# JRE version: Java(TM) SE Runtime Environment (7.0_67-b01) (build 1.7.0_67-b01)
# Java VM: Java HotSpot(TM) 64-Bit Server VM (24.65-b04 mixed mode linux-amd64 compressed oops)
# Problematic frame:
# C 0x00007f91fe0fdbe0
#
# Failed to write core dump. 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:
# /home/ethan/fail/hs_err_pid332.log
#
# If you would like to submit a bug report, please visit:
# http://bugreport.sun.com/bugreport/crash.jsp
#
请注意,程序仅在退出主函数后崩溃。
供参考,我正在一台64位debian测试机上进行开发,并已验证其他GTK+应用程序可正常工作。
我应该向Oracle报告此问题还是我做错了什么?