MantisBT

View Issue Details Jump to Notes ] Issue History ] Print ]
IDProjectCategoryView StatusDate SubmittedLast Update
0001168XdebugUsage problems (Wrong Results)public2015-06-23 09:212016-12-04 18:33
Reporterphil-lavin 
Assigned Toderick 
PrioritynormalSeverityblockReproducibilityrandom
StatusclosedResolutionfixed 
PlatformOSDebian 8OS Version3.16.0-4-amd64
Product Version2.2.6 
Target VersionFixed in Version2.5.0 
Summary0001168: Possible infinite loop when PHP's executor shuts down
DescriptionI've had random PHP-FPM processes consuming 100% of CPU whilst being unable to interrogate them via most means (e.g. strace). I spent a lot of time pulling info on the process to little avail however, finally, the below GDB backtraces show the process stuck in a while loop within xdebug shutdown code.
Steps To ReproduceHard to reproduce - will probably happen to a single php-fpm process once or twice a month.
Additional InformationGDB BT is at https://gist.githubusercontent.com/phil-lavin/2b8a1bb91f7e0bfe10c7/raw/9a2095bd60b11dca131a62d0f38065db181a1e2b/gistfile1.txt [^]

Other debug info gathered is as follows:

/proc/$PID/fd: 2 sockets, and a deleted /tmp file
/proc/$PID/stack: [<ffffffffffffffff>] 0xffffffffffffffff
Process STAT reported by ps: 'R'
/proc/$PID/syscall: 'running'
/proc/$PID/wchan: 0
/proc/$PID/status: https://gist.github.com/phil-lavin/052b593848900ce1c532 [^]
/proc/${PID}/sched: https://gist.github.com/phil-lavin/82445465f2e5e7c5329d [^]
pstack was unable to connect to the process
/proc/$PID/maps: https://gist.github.com/phil-lavin/fafca59e9c984975f5ce [^]
gdb `dump memory /tmp/wtf 0x7ffec5048000 0x7ffec5069000`: Let me know if you want this and I'll e-mail it... not 100% confident there's nothing sensitive in it
TagsNo tags attached.
Operating System
PHP Version5.6.5-5.6.9
Attached Files

- Relationships
has duplicate 0000731resolvedderick Infinite loop possible with xdebug_llist_empty() function 

-  Notes
(0003135)
derick (administrator)
2015-06-25 14:39

Hmm, this issue has been reported before, but I could never find *why* it happens, as it seems so difficult to reproduce. Is there a way how you can (reliably) reproduce this? Do you know with which request/code path this happens? Is it in a single or multi-threaded environment?
(0003139)
phil-lavin (reporter)
2015-06-25 14:47

Hi Derick,

I can guarantee that it'll happen some time in the next month but I cannot easily reproduce on a whim.

It's a single threaded php-fpm implementation.

I'll be at phpwarks tonight if you want to discuss or poke around the affected server.
(0003181)
tony2001 (reporter)
2015-10-22 17:10

I can see that it's stuck here:
void xdebug_llist_empty(xdebug_llist *l, void *user)
{
    while (xdebug_llist_count(l) > 0) {
        xdebug_llist_remove(l, XDEBUG_LLIST_TAIL(l), user);
    }
}

with tail == NULL llist_remove() immediately returns, but the l->size is still 1 (in my case), so this loop has no end.
I'll try to reproduce it, too, but no guarantees, sorry..
(0003182)
derick (administrator)
2015-10-22 17:12

Good luck Antony! I never managed :-/
(0003246)
derick (administrator)
2015-11-20 17:55

Changing this to "acknowledged", but I won't work on this unless somebody shows me a reproducible case.
(0003885)
derick (administrator)
2016-12-03 13:37

Is this something either of you have been able to conclusively reproduce yet? If not, I think I will close this issue.
(0003894)
derick (administrator)
2016-12-04 14:51

I have added the defensive check for 2.5.0RC2.

- Issue History
Date Modified Username Field Change
2015-06-23 09:21 phil-lavin New Issue
2015-06-25 14:39 derick Note Added: 0003135
2015-06-25 14:39 derick Assigned To => derick
2015-06-25 14:39 derick Status new => feedback
2015-06-25 14:47 phil-lavin Note Added: 0003139
2015-06-25 14:47 phil-lavin Status feedback => assigned
2015-10-22 17:10 tony2001 Note Added: 0003181
2015-10-22 17:12 derick Note Added: 0003182
2015-11-20 17:55 derick Note Added: 0003246
2015-11-20 17:55 derick Status assigned => acknowledged
2016-07-31 13:36 derick Category Usage problems => Usage problems (Crashes)
2016-07-31 13:38 derick Category Usage problems (Crashes) => Usage problems (Wrong Results)
2016-12-03 13:37 derick Note Added: 0003885
2016-12-03 13:37 derick Status acknowledged => feedback
2016-12-04 13:23 derick Relationship added has duplicate 0000731
2016-12-04 14:51 derick Note Added: 0003894
2016-12-04 14:51 derick Status feedback => closed
2016-12-04 14:51 derick Resolution open => fixed
2016-12-04 14:51 derick Fixed in Version => 2.5.0RC2
2016-12-04 17:56 derick Summary Possible infinate loop => Possible infinite loop when PHP's executor shuts down
2016-12-04 18:33 derick Fixed in Version 2.5.0RC2 => 2.5.0


Copyright © 2000 - 2017 MantisBT Team
Powered by Mantis Bugtracker