From:             phpbug2 at mailinator dot com
Operating system: Linux 2.4.28
PHP version:      5.0.3
PHP Bug Type:     Scripting Engine problem
Bug description:  pthread deadlock after script execution finishes

Description:
------------
A certain script (phpWebSite) a client of mine is running causes the
Apache child to deadlock after processing is complete. The output is sent
to the client however so to a normal visitor it appears to be working
fine, but on the server a child deadlocks with every hit to the script.

Srv     PID     Acc     M       CPU     SS      Req     Conn    Child   Slot    
Client  VHost   Request
26-0    24911   1/75/75 W       1.29    15390   0       0.3     0.73    0.73
        66.249.xxx.xxx  xxxxxxxx.xxx    GET
/index.php?module=calendar&calendar%5Bview%5D=month&mo

The request sticks in the "W"riting state until Apache is hupped at which
point it moves to "G"racefully finishing and will remain in that state
indefinitely. Closing Apache results in a "Child xxxx did not cleanly
exit, sending SIGKILL" message in the error_log. No errors are logged
prior to the child deadlocking. The hit that causes the deadlock does NOT
get logged to the Apache access_log.

php.ini is pretty much the stock 5.0.3-recommended. No 3rd party modules
such as Zend or Turck are present. Configure string:

'./configure' '--with-imap=/usr' '--with-expat-dir=/usr'
'--enable-sockets' '--with-zlib-dir=/usr' '--with-mysql=/usr'
'--with-mysql-sock=/var/lib/mysql/mysql.sock' '--with-mcrypt=/usr'
'--with-jpeg-dir=/usr' '--with-png-dir=/usr' '--with-freetype-dir=/usr'
'--with-gettext=/usr' '--enable-dba' '--with-db4=/usr' '--with-gdbm=/usr'
'--with-curl=/usr' '--enable-exif' '--with-ttf=/usr'
'--with-apxs=/www/bin/apxs' '--disable-cgi' '--disable-ipv6'
'--enable-gd-native-ttf' '--enable-calendar' '--with-zlib=/usr'
'--with-gd' '--with-gettext' '--disable-posix'
'--with-pgsql=/usr/local/pgsql' '--enable-memory-limit'
'--with-pspell=/usr' '--with-mysqli' '--with-mm' '--with-xsl'

None of the binaries are built with -g which I am afraid seems to limit
the debugging output. -fomit-frame-pointer however is NOT used. Please
inform if this is a problem and I will rebuild.

Reproduce code:
---------------
phpWebSite
http://phpwebsite.appstate.edu/

The "calendar" module seems to be the one that causes it, however I am
unsure as to whether any events need to be added in certain places etc as
the calendar is not maintained by myself.

I believe the phpWebSite script needed a few minor changes in order to
conform to the new OO model in PHP5. If you require an exact copy of the
installed version and/or data please let me know and I will ask my client.

Expected result:
----------------
Not to deadlock.

Actual result:
--------------
#0  0x001cf666 in sigsuspend () from /lib/libc.so.6
#1  0x00c50c28 in __pthread_wait_for_restart_signal () from
/lib/libpthread.so.0
#2  0x00c52ef0 in __pthread_alt_lock () from /lib/libpthread.so.0
#3  0x00c4f170 in pthread_mutex_lock () from /lib/libpthread.so.0
#4  0x00219fda in free () from /lib/libc.so.6
#5  0x008844f9 in php_error_cb () from /www/libexec/libphp5.so
#6  0x008c2724 in zend_error () from /www/libexec/libphp5.so
#7  0x008b8476 in zend_timeout () from /www/libexec/libphp5.so
#8  0x00c54d0d in __pthread_sighandler () from /lib/libpthread.so.0
#9  <signal handler called>
#10 0x00c530f1 in __pthread_alt_unlock () from /lib/libpthread.so.0
#11 0x00c4f42e in pthread_mutex_unlock () from /lib/libpthread.so.0
#12 0x00219fd3 in free () from /lib/libc.so.6
#13 0x0023fcbd in __tzfile_read () from /lib/libc.so.6
#14 0x0023e3ac in tzset_internal () from /lib/libc.so.6
#15 0x0023ef08 in tzset () from /lib/libc.so.6
#16 0x0081b65f in php_putenv_destructor () from /www/libexec/libphp5.so
#17 0x008c93b4 in zend_hash_del_key_or_index () from
/www/libexec/libphp5.so
#18 0x0081c828 in zif_putenv () from /www/libexec/libphp5.so
#19 0x008f951c in zend_do_fcall_common_helper () from
/www/libexec/libphp5.so
#20 0x008f9851 in zend_do_fcall_handler () from /www/libexec/libphp5.so
#21 0x008e76ec in execute () from /www/libexec/libphp5.so
#22 0x008f8fe3 in zend_do_fcall_common_helper () from
/www/libexec/libphp5.so
#23 0x008f972f in zend_do_fcall_by_name_handler () from
/www/libexec/libphp5.so
#24 0x008e76ec in execute () from /www/libexec/libphp5.so
#25 0x008f8fe3 in zend_do_fcall_common_helper () from
/www/libexec/libphp5.so
#26 0x008f972f in zend_do_fcall_by_name_handler () from
/www/libexec/libphp5.so
#27 0x008e76ec in execute () from /www/libexec/libphp5.so
#28 0x008f8fe3 in zend_do_fcall_common_helper () from
/www/libexec/libphp5.so
#29 0x008f972f in zend_do_fcall_by_name_handler () from
/www/libexec/libphp5.so
#30 0x008e76ec in execute () from /www/libexec/libphp5.so
#31 0x008f8fe3 in zend_do_fcall_common_helper () from
/www/libexec/libphp5.so
#32 0x008f972f in zend_do_fcall_by_name_handler () from
/www/libexec/libphp5.so
#33 0x008e76ec in execute () from /www/libexec/libphp5.so
#34 0x008f8fe3 in zend_do_fcall_common_helper () from
/www/libexec/libphp5.so
#35 0x008f972f in zend_do_fcall_by_name_handler () from
/www/libexec/libphp5.so
#36 0x008e76ec in execute () from /www/libexec/libphp5.so
#37 0x008f8fe3 in zend_do_fcall_common_helper () from
/www/libexec/libphp5.so
#38 0x008f972f in zend_do_fcall_by_name_handler () from
/www/libexec/libphp5.so
#39 0x008e76ec in execute () from /www/libexec/libphp5.so
#40 0x008f8fe3 in zend_do_fcall_common_helper () from
/www/libexec/libphp5.so
#41 0x008f972f in zend_do_fcall_by_name_handler () from
/www/libexec/libphp5.so
#42 0x008e76ec in execute () from /www/libexec/libphp5.so
#43 0x008fe5c9 in zend_include_or_eval_handler () from
/www/libexec/libphp5.so
#44 0x008e76ec in execute () from /www/libexec/libphp5.so
#45 0x008c2cad in zend_execute_scripts () from /www/libexec/libphp5.so
#46 0x008861f5 in php_execute_script () from /www/libexec/libphp5.so
#47 0x00000000 in ?? ()
#48 0x00000003 in ?? ()
#49 0x00000000 in ?? ()
#50 0xbffff310 in ?? ()
#51 0x00000000 in ?? ()
#52 0x00000002 in ?? ()
#53 0x002137bd in _IO_new_file_fopen () from /lib/libc.so.6


-- 
Edit bug report at http://bugs.php.net/?id=31749&edit=1
-- 
Try a CVS snapshot (php4):   http://bugs.php.net/fix.php?id=31749&r=trysnapshot4
Try a CVS snapshot (php5.0): 
http://bugs.php.net/fix.php?id=31749&r=trysnapshot50
Try a CVS snapshot (php5.1): 
http://bugs.php.net/fix.php?id=31749&r=trysnapshot51
Fixed in CVS:                http://bugs.php.net/fix.php?id=31749&r=fixedcvs
Fixed in release:            http://bugs.php.net/fix.php?id=31749&r=alreadyfixed
Need backtrace:              http://bugs.php.net/fix.php?id=31749&r=needtrace
Need Reproduce Script:       http://bugs.php.net/fix.php?id=31749&r=needscript
Try newer version:           http://bugs.php.net/fix.php?id=31749&r=oldversion
Not developer issue:         http://bugs.php.net/fix.php?id=31749&r=support
Expected behavior:           http://bugs.php.net/fix.php?id=31749&r=notwrong
Not enough info:             
http://bugs.php.net/fix.php?id=31749&r=notenoughinfo
Submitted twice:             
http://bugs.php.net/fix.php?id=31749&r=submittedtwice
register_globals:            http://bugs.php.net/fix.php?id=31749&r=globals
PHP 3 support discontinued:  http://bugs.php.net/fix.php?id=31749&r=php3
Daylight Savings:            http://bugs.php.net/fix.php?id=31749&r=dst
IIS Stability:               http://bugs.php.net/fix.php?id=31749&r=isapi
Install GNU Sed:             http://bugs.php.net/fix.php?id=31749&r=gnused
Floating point limitations:  http://bugs.php.net/fix.php?id=31749&r=float
No Zend Extensions:          http://bugs.php.net/fix.php?id=31749&r=nozend
MySQL Configuration Error:   http://bugs.php.net/fix.php?id=31749&r=mysqlcfg

Reply via email to