Bug #51580 [Opn->Fbk]: socket_select randomly crashes when used together with fork and Unix signals

[email protected]
Newsgroups php.bugs
Message-ID <[email protected]>
Edit report at http://bugs.php.net/bug.php?id=51580&edit=1

 ID:               51580
 Updated by:       [email protected]
 Reported by:      marco at vmsoft-gbr dot de
 Summary:          socket_select randomly crashes when used together with
                   fork and Unix signals
-Status:           Open
+Status:           Feedback
 Type:             Bug
 Package:          PCNTL related
 Operating System: Debian Linux
 PHP Version:      5.3.2

 New Comment:

Can you try to generate a coredump and use it later to get a bt:

http://stackoverflow.com/questions/17965/generate-a-core-dump-in-linux


Previous Comments:
------------------------------------------------------------------------
[2010-04-17 11:13:18] marco at vmsoft-gbr dot de

just ran it under gdb, it fails as expected, but as it's not
segfaulting, no backtrace can be made.

------------------------------------------------------------------------
[2010-04-17 11:06:53] marco at vmsoft-gbr dot de

PHP itself doesn't crash, the error is not fatal - and how do I make a
gdb backtrace on a forked process, anyway?

------------------------------------------------------------------------
[2010-04-17 03:51:06] [email protected]

Thank you for this bug report. To properly diagnose the problem, we
need a backtrace to see what is happening behind the scenes. To
find out how to generate a backtrace, please read
http://bugs.php.net/bugs-generating-backtrace.php for *NIX and
http://bugs.php.net/bugs-generating-backtrace-win32.php for Win32

Once you have generated a backtrace, please submit it to this bug
report and change the status back to "Open". Thank you for helping
us make PHP better.



------------------------------------------------------------------------
[2010-04-17 02:11:01] marco at vmsoft-gbr dot de

Description:
------------
When firing unix signals onto a forked process with pcntl_signal
handlers active and a socket_select currently running, socket_select may
crash.

Run the test script with php test.php 1339, and then launch some "kill
-s 10 <child pid>" on it. After some, maybe just one, kill's, the script
will crash.

Test script:
---------------
http://php.pastebin.com/Td68vtMn

Expected result:
----------------
Installing signal handlers
Installing handler for signal 15
Installing handler for signal 10
child-pid 20030
running
marco@vs932:~/php_daemon$ kill -s 10 20030
got signal 10
marco@vs932:~/php_daemon$ kill -s 10 20030
got signal 10
marco@vs932:~/php_daemon$ kill -s 10 20030
got signal 10

(etc)

Actual result:
--------------
Installing signal handlers
Installing handler for signal 15
Installing handler for signal 10
child-pid 20030
running
marco@vs932:~/php_daemon$ kill -s 10 20030
got signal 10
marco@vs932:~/php_daemon$ kill -s 10 20030
got signal 10
marco@vs932:~/php_daemon$ kill -s 10 20030
got signal 10
marco@vs932:~/php_daemon$ kill -s 10 20030
marco@vs932:~/php_daemon$ PHP Warning:  socket_select(): unable to
select [4]: Interrupted system call in /home/marco/php_daemon/test.php
on line 39
socket_select failed: Interrupted system call
end

marco@vs932:~/php_daemon$ 


------------------------------------------------------------------------



-- 
Edit this bug report at http://bugs.php.net/bug.php?id=51580&edit=1
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.