2010年4月21日星期三

Firefox 3.6.4 未來的關鍵 OOPP

Mozilla 在 2010/5 月釋出新版本的 Firefox 3.6.4, 此版本將會有重大改變, 過去外掛(plugin)程序惱人的異常狀態下崩潰掛掉整個 Firefox 程式的問題, 在新版加入 Lorentz 的功能 Out of Process Plugins(OOPP)中可以解決了(排除沒有 bug 的話), OOPP 將外掛程式以獨立程序(process)中執行, 一但程序異常崩潰時會顯示程序提示頁面, 不會拖垮整個 Firefox 程式。

不過, 當然新功能 OOPP 應用時仍有不小的臭蟲(bug), 甚至異常的 crash, 而自行編譯的社群版(Linux)也有兼容性問題的個別情況。

Firefox 3.6.4 編譯設定加入了兩處異同條件如下:
--disable-ipc Disable IPC supports for tabs and plugins
--enable-ipdl-tests Enable expensive IPDL tests

一個是 IPC(Inter-process communication) 的支援, NSPR 的 API 下開發 OOPP 的應用
另一個是 IPDL(IPC Protocol Definition Language) 的驗測

參考:
https://developer.mozilla.org/en/IPDL
https://developer.mozilla.org/en/Configuring_Build_Options

編譯 Firefox 3.6.4(Linux) 時預設自動加入新增 IPC 功能(OOPP), 編譯的問體如下:

1. 當預設編譯時會使用系統 nspr 而編譯錯誤
In file included from nsXPComInit.cpp:41:
./../ipc/chromium/src/base/basictypes.h:22:26: error: nspr/prtypes.h: No such file or directory
./../ipc/chromium/src/base/basictypes.h:34:36: error: nspr/obsolete/protypes.h: No such file or directory
./../ipc/chromium/src/base/basictypes.h:96: error: 'uint32' does not name a type
./../ipc/chromium/src/base/basictypes.h:102: error: 'int32' does not name a type
./../ipc/chromium/src/base/basictypes.h:103: error: 'int32' does not name a type
./../ipc/chromium/src/base/basictypes.h:302: error: 'uint32' does not name a type

make[5]: *** [nsXPComInit.o] Error 1
make[5]: Leaving directory `/usr/src/redhat/BUILD/firefox-3.6.4/mozilla-1.9.2/xpcom/build'
make[4]: *** [libs] Error 2
make[4]: Leaving directory `/usr/src/redhat/BUILD/firefox-3.6.4/mozilla-1.9.2/xpcom'
make[3]: *** [libs_tier_xpcom] Error 2
make[3]: Leaving directory `/usr/src/redhat/BUILD/firefox-3.6.4/mozilla-1.9.2'
make[2]: *** [tier_xpcom] Error 2
make[2]: Leaving directory `/usr/src/redhat/BUILD/firefox-3.6.4/mozilla-1.9.2'
make[1]: *** [default] Error 2
make[1]: Leaving directory `/usr/src/redhat/BUILD/firefox-3.6.4/mozilla-1.9.2'
make: *** [build] Error 2

mozilla 仍未釋出修正支援獨立程序的系統 nspr API, 所以要編譯預設 IPC(OOPP) 功能的話暫時必需同時編譯內建 nspr 執行庫
.mozconfig 要移除 ac_add_options --with-system-nspr

2. 執行編譯了 IPC(OOPP) 的 Firefox 3.6.4(Linux) 時遇到有任何 plugin(例如 flash, java..) 的網頁會程式異常停頓, 程式完全沒反應
~/.xsession-errors 錯誤記錄如下:
** (firefox:8607): WARNING **: Serious fd usage error 14
** (firefox:8607): WARNING **: Serious fd usage error 12

不明原因, 可以暫時新增機碼停用 IPC(OOPP)
about:config
dom.ipc.plugins.enabled 設定改為 disable

3. 如何編譯沒有 IPC(OOPP) 的 Firefox 3.6.4(Linux)
IPC 功能是預設編譯, 需要修改編譯項目停用 IPC
.mozconfig 新增 ac_add_options --disable-ipc
.mozconfig 使用 ac_add_options --with-system-nspr

4. Firefox 3.6.4 OOPP 臭蟲
已知的臭蟲
新增的臭蟲

沒有留言:

發佈留言