Apache 2.2 worker MPM 與 mod_fastcgi 的問題

我發現到某一組機器的 apache 2.2 (worker MPM) 偶而會 coredump,大約七月的時候決定跳下去找原因,在編了有 debuig symbol 的 httpd 後 (跑起來後用 gdb 放著跑,coredump 時會被 gdb 攔下來,如果 stack 沒被弄爛的話,有機會看到爛在哪裡),發現是 mod_fastcgi 沒有正確處理 non-threadsafe function 造成的問題,在「修正 mod_fastcgi 在 threading 環境下會 coredump 的 bug 」這篇我有提過。

我在「getgrgid() and getpwent() not thread-safe causes segfault in worker MPM」(原 mailing list 沒有開放 archive,所以必須到 gmane 查) 把 patch 丟上去,不過看起來 mod_fastcgi 不太會出新版了。

所以在 FreeBSD 上面就需要自立救濟... 在安裝 portsconf 後,就可以在 /usr/local/etc/ports.conf 內對 www/mod_fastcgi 指定 patch 的參數:

www/mod_fastcgi: NO_CHECKSUM=yes | PATCH_SITES=http://site/path/ | PATCHFILES=mod_fastcgi-2.4.6-threadsafepatch.patch.gz

然後把 patch 丟上 http://site/path/mod_fastcgi-2.4.6-threadsafepatch.patch.gz 裡面。NO_CHECKSUM 是因為我們的 patch 不在 distfiles 內,所以得這樣搞...

3 thoughts on “Apache 2.2 worker MPM 與 mod_fastcgi 的問題”

Leave a Reply

Your email address will not be published. Required fields are marked *