Bug #53412 [Fbk->Asn]: php-fpm children constantly exiting (immediately)

From: Date: Mon, 29 Nov 2010 20:50:23 +0000
Subject: Bug #53412 [Fbk->Asn]: php-fpm children constantly exiting (immediately)
References: 1  Groups: php.bugs 
Request: Send a blank email to php-bugs+get-156555@lists.php.net to get a copy of this message
Edit report at http://bugs.php.net/bug.php?id=53412&edit=1

 ID:                 53412
 User updated by:    php-bugs at thequod dot de
 Reported by:        php-bugs at thequod dot de
 Summary:            php-fpm children constantly exiting (immediately)
-Status:             Feedback
+Status:             Assigned
 Type:               Bug
 Package:            FPM related
 Operating System:   Linux
 PHP Version:        5.3SVN-2010-11-26 (snap)
 Assigned To:        fat
 Block user comment: N
 Private report:     N

 New Comment:

It looks like this:

Nov 29 21:47:59.518416 [DEBUG] pid 29191, fpm_children_make(), line 377:
pid after fork=30301
Nov 29 21:47:59.518440 [NOTICE] pid 29191, fpm_children_make(), line
400: [pool www] child 30301 started
Nov 29 21:47:59.518451 [DEBUG] pid 30301, fpm_children_make(), line 377:
pid after fork=0
Nov 29 21:47:59.518981 [DEBUG] pid 29191, fpm_got_signal(), line 75:
received SIGCHLD
Nov 29 21:47:59.518995 [WARNING] pid 29191, fpm_children_bury(), line
249: [pool www] child 30301 exited with code 1 after 0.000562 seconds
from start


Previous Comments:
------------------------------------------------------------------------
[2010-11-29 14:50:58] fat@php.net

Sorry, there is no backtrace with sigfault as there is no segfault ...

Can you patch fpm_children.c like this:


Index: fpm_children.c
===================================================================
--- fpm_children.c      (révision 305775)
+++ fpm_children.c      (copie de travail)
@@ -374,6 +374,7 @@
                }

                pid = fork();
+zlog(ZLOG_DEBUG, "pid after fork=%d", pid);

                switch (pid) {

and test again (daemonize=no; log_level=debug)

send here your log file content.

------------------------------------------------------------------------
[2010-11-29 14:34:11] fat@php.net

The backtrace you sent does not seem to be right. You hit Ctrl+Z to stop
the FPM 
process

"^Z
Program received signal SIGTSTP, Stopped (user)."

Can you provide a backtrace without any user interaction. Let FPM
sigfault.

thx

------------------------------------------------------------------------
[2010-11-29 14:20:33] php-bugs at thequod dot de

Here is a sample gdb session, maybe that helps already:
http://pastebin.com/RTUDniYL

------------------------------------------------------------------------
[2010-11-29 14:17:15] php-bugs at thequod dot de

Nov 29 13:39:18.967256 [WARNING] [pool www] child 29567 exited with code
1 after 0.001296 seconds from start
^Z
Program received signal SIGTSTP, Stopped (user).
0xb7a77f32 in fork () from /lib/libc.so.6
(gdb) bt
#0  0xb7a77f32 in fork () from /lib/libc.so.6
#1  0x083a7132 in fpm_children_make (wp=0x8920d08, in_event_loop=1,
nb_to_spawn=1, is_debug=0)
    at
/build/buildd/php5-5.3.4~snap201011290730/sapi/fpm/fpm/fpm_children.c:376
#2  0x083a7707 in fpm_children_bury () at
/build/buildd/php5-5.3.4~snap201011290730/sapi/fpm/fpm/fpm_children.c:285
#3  0x083abed7 in fpm_got_signal (ev=0x87bba80, which=2, arg=0x0) at
/build/buildd/php5-5.3.4~snap201011290730/sapi/fpm/fpm/fpm_events.c:76
#4  0x083ab528 in fpm_event_fire (ev=0x87bba80) at
/build/buildd/php5-5.3.4~snap201011290730/sapi/fpm/fpm/fpm_events.c:373
#5  0x083abb3d in fpm_event_loop () at
/build/buildd/php5-5.3.4~snap201011290730/sapi/fpm/fpm/fpm_events.c:317
#6  0x083a6e85 in fpm_run (max_requests=0xbfffd580) at
/build/buildd/php5-5.3.4~snap201011290730/sapi/fpm/fpm/fpm.c:76
#7  0x083ad78a in main (argc=3, argv=0xbffff684) at
/build/buildd/php5-5.3.4~snap201011290730/sapi/fpm/fpm/fpm_main.c:1786


I guess that it would be more interesting to debug the child, which I
did not manage to do.
I've tried using "catch fork" to stop on the call to fork, and then both
tried "follow-fork-mode=child" and stepping, but this does not allow me
to step into the forked process (after the fork the next "n" command
will start the endless forking/looping again).

Please tell me how to debug this: a catch on "fork" appears to make
sense. Should I then use another gdb instance to debug the child?
I've tried that, but got "ptrace: Operation not permitted." then. Is
this because it's too early to attach?

------------------------------------------------------------------------
[2010-11-28 03:37:16] fat@php.net

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.

Can you send a backtrace with the latest snapshot please ?

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


The remainder of the comments for this report are too long. To view
the rest of the comments, please view the bug report online at

    http://bugs.php.net/bug.php?id=53412


-- 
Edit this bug report at http://bugs.php.net/bug.php?id=53412&edit=1


Thread (20 messages)

« previous php.bugs (#156555) next »