apache2、php4與GNU Recode…

apache2、php4與GNU Recode這三個一起用會有問題 :Q

前一陣子就遇到這個問題了,newsyslog每次在rotate log的時候apache都會無緣無故收到SIGABRT死掉,本來也沒有詳細再看,這陣子無聊想說來看看好了(一方面是因為有了blog所以這個問題蠻頭大的)。本來用google找只有找到舊版本的php4和pcre有問題,不過看了看說這個bug修正了啊…結果一直追一追gdb全部都給我來個??看不到是那個function出問題,火大了全部加上-g重新編一遍才看到收到SIGABRT時候的backtrace…

(gdb) where
#0 0x283e019f in kill () from /lib/libc.so.6
#1 0x283d3ca6 in raise () from /lib/libc.so.6
#2 0x284540d2 in abort () from /lib/libc.so.6
#3 0x283ef55c in _UTF8_wcsnrtombs () from /lib/libc.so.6
#4 0x283ef5a8 in _UTF8_wcsnrtombs () from /lib/libc.so.6
#5 0x283f026b in _UTF8_wcsnrtombs () from /lib/libc.so.6
#6 0x283f0842 in _UTF8_wcsnrtombs () from /lib/libc.so.6
#7 0x283f09bf in free () from /lib/libc.so.6
#8 0x288bc851 in my_no_flags_free () from /usr/local/lib/mysql/libmysqlclient.so.14
#9 0x288c27a9 in delete_dynamic () from /usr/local/lib/mysql/libmysqlclient.so.14
#10 0x288c40cc in hash_free () from /usr/local/lib/mysql/libmysqlclient.so.14
#11 0x28b55711 in recode_delete_outer () from /usr/local/lib/librecode.so.3
#12 0x28a26ed7 in zm_shutdown_recode (type=1, module_number=14)
at /usr/ports/converters/php4-recode/work/php-4.3.10/ext/recode/recode.c:113
#13 0x285b01bd in ?? () from /usr/local/libexec/apache2/libphp4.so
#14 0x285b24ff in ?? () from /usr/local/libexec/apache2/libphp4.so
#15 0x285b267c in ?? () from /usr/local/libexec/apache2/libphp4.so
#16 0x285ac514 in ?? () from /usr/local/libexec/apache2/libphp4.so
#17 0x2857b78a in ?? () from /usr/local/libexec/apache2/libphp4.so
#18 0x2857b747 in ?? () from /usr/local/libexec/apache2/libphp4.so
#19 0x285ca1c1 in ?? () from /usr/local/libexec/apache2/libphp4.so
#20 0x28356edd in run_cleanups (cref=0x80a1028) at apr_pools.c:1951
#21 0x283560fc in apr_pool_clear (pool=0x80a1018) at apr_pools.c:693
#22 0x0806b81d in main (argc=3, argv=0xbfbfecd8) at main.c:594

librecode?這是什麼東西…結果發現拿掉這個php extension就好了,apache可以順利graceful restart沒有問題,就順便送了個pr出去了…

不過我也沒用到這東西,為啥把這個編進來呢…

1 則留言

  1. 找到問題了!!
    原來是librecode和libmysqlclient有同名function造成recode會去access到mysql的,一access就出錯了,如果有load imap extension的話也會有同樣的問題
    我應該在send-pr之前多看看www.php.net的啊~~~

發佈留言

發佈留言必須填寫的電子郵件地址不會公開。 必填欄位標示為 *