試験運用中なLinux備忘録・旧記事

はてなダイアリーで公開していた2007年5月-2015年3月の記事を保存しています。

Mozilla Firefox 3.0 rc1の覚え書き

Firefox 3もついにリリース候補*1まで来た。正式版のリリースも近い。

初回起動時のURL
http://web.archive.org/web/20080517144324/http://www.mozilla.com/en-US/firefox/3.0/firstrun/
リリースノート
http://web.archive.org/web/20081120165223/http://www.mozilla-japan.org/products/firefox/3.0rc1/releasenotes/

  1. 使用した.mozconfig
  2. --enable-system-sqliteでconfigureが通らない?
  3. Windows Live Hotmailの拡張バージョンについて
  4. 「戻る」「進む」ボタンの鍵穴について
  5. ページ情報からリンクの一覧を表示する方法
  6. 独自ビルドが頻繁に落ちる?
  7. --enable-crashreporterを付けるとビルドエラーになる

使用した.mozconfig

Mozilla Firefox 3 Beta 5の覚え書き」のときと同じものを使用した。

--enable-system-sqliteでconfigureが通らない?

--enable-system-sqliteを付けてconfigureしたときに

(略)
checking for sqlite3 >= 3.5.4... Requested 'sqlite3 >= 3.5.4' but version of SQLite is 3.5
configure: error: Library requirements (sqlite3 >= 3.5.4) not met; consider adjusting the PKG_CONFIG_PATH environment variable if your libraries are in a nonstandard prefix so pkg-config can find them.
*** Fix above errors and then restart with               "make -f client.mk build"
make[1]: *** [configure] Error 1
make[1]: Leaving directory `/tmp/work/mozilla'
make: *** [/tmp/work/mozilla/Makefile] Error 2

システムのsqlite3のバージョンが低いとエラーになったが、バージョンを確認すると

$ eix -ce sqlite
[I] dev-db/sqlite (3.5.6(3)@2008年03月17日): an SQL Database Engine in a C Library

3.5.4以上であるのは確かだったため、pkg-configによるバージョン検出*2が怪しいと思ったら、「3.5」になっていた。

--- /usr/lib/pkgconfig/sqlite3.pc.orig
+++ /usr/lib/pkgconfig/sqlite3.pc
@@ -7,7 +7,7 @@
 
 Name: SQLite
 Description: SQL database engine
-Version: 3.5
+Version: 3.5.6
 Libs: -L${libdir} -lsqlite3
 Libs.private: -lpthread
 Cflags: -I${includedir}

インストールされているのと同じ「3.5.6」にしたところ、この問題は回避できた。

Windows Live Hotmailの拡張バージョンについて

まだ拡張バージョンは「ログインしているときにエラーが発生したため、一時的にWindows Live Hotmail の標準バージョンを使用しています。もう一度やり直す前に、キャッシュと Cookie を削除してください。」で使用できなかった。Mozilla公式版を新規プロファイルで起動して試してみたが結果は同じ。

「戻る」「進む」ボタンの鍵穴について

既定のテーマを使用しているときの「戻る」「進む」ボタンは以前から統合されているものの、今回のバージョンでも鍵穴型にはなっていない。

ページ情報からリンクの一覧を表示する方法

Firefox 3では、Webページの情報ダイアログを開いても、そのページに含まれるリンクアンカーやスタイルシートなどの一覧が見られなくなっている。
そこで役に立つ拡張が「pageinfo+link」で、これを入れることで、従来の形式のリンク一覧が表示できる。

独自ビルドが頻繁に落ちる?

  • タブを閉じる
  • リンクのクリック
  • 戻る/進む

などをしたときに突然落ちることが多く、新規プロファイルでも改善されなかったため、デバッグ情報を付けてビルドしてみた。
ファイル名: mozilla/.mozconfig

CC="ccache gcc"
CXX="ccache g++"

ac_add_options --enable-application=browser
ac_add_options --enable-extensions=default,-gnomevfs
ac_add_options --enable-image-decorders=png,gif,jpeg
ac_add_options --disable-install-strip  # 変更
ac_add_options --enable-necko-protocols='about data file ftp http res viewsource'
ac_add_options --enable-optimize='-Os -march=[CPUに対応した文字列] -pipe'
ac_add_options --enable-plaintext-editor-only
ac_add_options --enable-static
ac_add_options --disable-strip          # 変更
ac_add_options --enable-system-lcms
ac_add_options --enable-system-sqlite
ac_add_options --disable-accessibility
ac_add_options --disable-composer
ac_add_options --disable-crashreporter
ac_add_options --enable-debug           # 変更
ac_add_options --enable-debug-modules   # 変更
ac_add_options --disable-gnomeui
ac_add_options --disable-gnomevfs
ac_add_options --disable-jsd
ac_add_options --disable-logging
ac_add_options --disable-logrefcnt
ac_add_options --disable-installer
ac_add_options --disable-ldap
ac_add_options --disable-libxul
ac_add_options --disable-mailnews
ac_add_options --disable-mathml
ac_add_options --disable-mochitest
ac_add_options --disable-necko-disk-cache
ac_add_options --disable-official-branding
ac_add_options --disable-profilesharing
ac_add_options --disable-svg
ac_add_options --disable-tests
ac_add_options --disable-updater
ac_add_options --disable-webservices
ac_add_options --with-system-bz2
ac_add_options --with-system-jpeg
ac_add_options --with-system-zlib

その後色々試したところ、ページ内で右クリックした後の上記操作で確実に落ちることが分かった。

$ ./dist/bin/firefox
(中略)

(右クリック時)
WARNING: NS_ENSURE_SUCCESS(rv, rv) failed with result 0x80040154: file nsDocShel
lEditorData.cpp, line 152
*** e = [Exception... "Component returned failure code: 0x80570016 (NS_ERROR_XPC
_GS_RETURNED_FAILURE) [nsIJSCID.getService]"  nsresult: "0x80570016 (NS_ERROR_XP
C_GS_RETURNED_FAILURE)"  location: "JS frame :: chrome://browser/content/utility
Overlay.js :: getShellService :: line 307"  data: no]

(ページ移動などの操作を行ったときの出力)
Program ./dist/bin/firefox-bin (pid = 27600) received signal 11.
Stack:
UNKNOWN [/lib/libpthread.so.0 +0x0000DDE0]
UNKNOWN [./dist/bin/firefox-bin +0x0067526D]
UNKNOWN [./dist/bin/firefox-bin +0x00665FB9]
UNKNOWN [./dist/bin/firefox-bin +0x0066B950]
UNKNOWN [./dist/bin/firefox-bin +0x00662F58]
UNKNOWN [./dist/bin/firefox-bin +0x006763CE]
UNKNOWN [./dist/bin/firefox-bin +0x0067B8C2]
UNKNOWN [./dist/bin/firefox-bin +0x0067BF09]
UNKNOWN [./dist/bin/firefox-bin +0x0067C8C9]
UNKNOWN [./dist/bin/firefox-bin +0x000EA0E9]
UNKNOWN [./dist/bin/firefox-bin +0x000EA301]
UNKNOWN [./dist/bin/firefox-bin +0x00087BC0]
UNKNOWN [./dist/bin/firefox-bin +0x00088376]
UNKNOWN [./dist/bin/libxpcom_core.so +0x0006C742]
UNKNOWN [./dist/bin/libxpcom_core.so +0x00087A95]
NS_ProcessNextEvent_P(nsIThread*, int)+0x00000045 [./dist/bin/libxpcom_core.so +0x00045913]
UNKNOWN [./dist/bin/firefox-bin +0x0022CB8A]
UNKNOWN [./dist/bin/firefox-bin +0x0075EAB7]
UNKNOWN [./dist/bin/firefox-bin +0x00044DD1]
UNKNOWN [./dist/bin/firefox-bin +0x0003F4B4]
__libc_start_main+0x000000F4 [/lib/libc.so.6 +0x0001DB74]
UNKNOWN [./dist/bin/firefox-bin +0x0003F179]
Sleeping for 300 seconds.
Type 'gdb ./dist/bin/firefox-bin 27600' to attach your debugger to this thread.

(別の仮想端末で実行)
$ gdb ./dist/bin/firefox-bin 27600
GNU gdb 6.7.1
Copyright (C) 2007 Free Software Foundation, Inc.
License GPLv3+: GNU GPL version 3 or later <http://gnu.org/licenses/gpl.html>
This is free software: you are free to change and redistribute it.
There is NO WARRANTY, to the extent permitted by law.  Type "show copying"
and "show warranty" for details.
This GDB was configured as "x86_64-pc-linux-gnu"...
Using host libthread_db library "/lib/libthread_db.so.1".
Attaching to program: /tmp/work/mozilla/dist/bin/firefox-bin, process 27600
Reading symbols from /lib64/libpthread.so.0...done.
[Thread debugging using libthread_db enabled]
[New Thread 0x7f50e764e750 (LWP 27600)]
[New Thread 0x4452c950 (LWP 27622)]
[New Thread 0x43d2b950 (LWP 27621)]
[New Thread 0x4352a950 (LWP 27616)]
[New Thread 0x42528950 (LWP 27615)]
[New Thread 0x42d29950 (LWP 27614)]
[New Thread 0x410f1950 (LWP 27611)]
[New Thread 0x41d27950 (LWP 27610)]
Loaded symbols for /lib/libpthread.so.0
Reading symbols from /tmp/work/mozilla/dist/bin/libjemalloc.so...done.
Loaded symbols for ./dist/bin/libjemalloc.so
(中略)
Reading symbols from /usr/lib64/libXinerama.so.1...done.
Loaded symbols for /usr/lib/libXinerama.so.1
Reading symbols from /lib64/libnss_dns.so.2...done.
Loaded symbols for /lib/libnss_dns.so.2
0x00007f50e1444f51 in nanosleep () from /lib/libc.so.6
(gdb) finish
Run till exit from #0  0x00007f50e1444f51 in nanosleep () from /lib/libc.so.6
[Thread 0x43d2b950 (LWP 27621) exited]
[Switching to Thread 0x7f50e764e750 (LWP 27600)]
0x00007f50e1444d74 in sleep () from /lib/libc.so.6
(gdb) finish
Run till exit from #0  0x00007f50e1444d74 in sleep () from /lib/libc.so.6
ah_crap_handler (signum=11) at nsSigHandlers.cpp:152
152     }
(gdb) finish
Run till exit from #0  ah_crap_handler (signum=11) at nsSigHandlers.cpp:152
nsProfileLock::FatalSignalHandler (signo=11) at nsProfileLock.cpp:221
221         _exit(signo);
(gdb) finish
Run till exit from #0  nsProfileLock::FatalSignalHandler (signo=11)
    at nsProfileLock.cpp:221

Program exited with code 013.
(gdb) q

Mozilla公式版(x86_32)ではこの現象は起こらない。.mozconfigの可能性もあるため、現時点では何とも言えない。
最適化フラグを「-O2 -pipe」にしてみたが、結果は同じだった。
(2008/5/23)原因となっているオプションが特定できた。Mozilla Firefox 3 rc1の独自ビルドが右クリック後のページ移動などで落ちる件のその後」を参照。

--enable-crashreporterを付けるとビルドエラーになる

--enable-crashreporterを付けたかったのだが、

gmake[5]: Entering directory `/tmp/work/mozilla/toolkit/crashreporter/google-bre
akpad/src/common/linux'
dump_symbols.cc
ccache g++ -o host_dump_symbols.o -c  -I./../.. -I. -I.  -I../../../../../../dist/include   -I../../../../../../dist/include/breakpad_linux_common -I../../../../../../dist/include/nspr     -I../../../../../../dist/sdk/include -I../../../../../../dist/include/nspr dump_symbols.cc
dump_symbols.cc: In function 'void<unnamed>::FixAddress(void*)':
dump_symbols.cc:141: error: cast from 'void*' to 'Elf64_Word' loses precision
gmake[5]: *** [host_dump_symbols.o] Error 1
gmake[5]: Leaving directory `/tmp/work/mozilla/toolkit/crashreporter/google-breakpad/src/common/linux'
gmake[4]: *** [libs] Error 2

となって失敗。

*1:英語でRelease Candidateといい、RCと略される

*2:/usr/lib/pkgconfig以下もしくは環境変数PKG_CONFIG_PATHで指定されるディレクトリ以下にある[パッケージ名].pcというファイルにインストール情報が書き込まれている(個別のパッケージの作成者側が用意する)。pkg-configはこのpcファイルの情報をもとに検出やバージョン判定を行う