Eclipse 頻繁崩潰、日誌出現 SIGSEGV、libxul.so、Problematic frame: C [libxul.so+...]?這通常是 SWT 瀏覽器組件與系統 XULRunner 版本不兼容導致的 JVM 崩潰。本文提供精準修復方案與排查思路。
# A fatal error has been detected by the Java Runtime Environment:
# SIGSEGV (0xb) at pc=0x7bab036c, pid=12169, tid=3072990096
# JRE version: 6.0_17-b04
# Java VM: Java HotSpot(TM) Server VM (14.3-b01 mixed mode linux-x86)
# Problematic frame:
# C [libxul.so+0xc8236c]
# The crash happened outside the Java Virtual Machine in native code.
關鍵信號:
SIGSEGV:段錯誤,訪問非法內存地址libxul.so:Firefox/XULRunner 核心庫,SWT Browser 組件依賴它C frame:崩潰發生在本地代碼(JNI 層),而非 Java 代碼Eclipse 內置 SWT Browser 控件(如歡迎頁、幫助文檔、預覽面板)依賴 Mozilla XULRunner 渲染引擎。若系統安裝的 XULRunner 版本與 Eclipse 期望版本不一致,JNI 調用進入 libxul.so 時觸發段錯誤,導致 JVM 崩潰。
ls /usr/lib/xulrunner-*/
# 例:/usr/lib/xulrunner-1.9/ 或 /usr/lib/xulrunner-24.0/
eclipse.ini(位於 Eclipse 安裝目錄),在 -vmargs 之前添加:
-Dorg.eclipse.swt.browser.XULRunnerPath=/usr/lib/xulrunner-1.9/
注意:路徑指向 XULRunner 根目錄(包含 libxul.so 的父目錄),結尾加 /。
eclipse.ini 添加 -Dorg.eclipse.swt.browser.DefaultType=mozilla 或 -Dorg.eclipse.swt.browser.UseWebKitGTK=true(需安裝 WebKitGTK)。export SWT_GTK3=0 強制 GTK2。-Dorg.eclipse.swt.browser.DefaultType=mozilla 強制用 XULRunner(需單獨安裝)。SIGSEGV in libxul.so 是 Eclipse 經典「本地庫版本不兼容」崩潰。通過 -Dorg.eclipse.swt.browser.XULRunnerPath 精確指定兼容版本,可快速恢復穩定。長期建議:升級至現代 Eclipse 版本,享受更好的 WebKit/Chromium 集成與穩定性。