I have a long running PHP process, that sometimes hangs in a loop. This is the strace output, but I don’t know what it means:
nanosleep({1, 0}, {1, 0}) = 0
rt_sigprocmask(SIG_BLOCK, [CHLD], [], 8) = 0
rt_sigaction(SIGCHLD, NULL, {SIG_DFL, [], 0}, 8) = 0
rt_sigprocmask(SIG_SETMASK, [], NULL, 8) = 0
nanosleep({1, 0}, {1, 0}) = 0
rt_sigprocmask(SIG_BLOCK, [CHLD], [], 8) = 0
rt_sigaction(SIGCHLD, NULL, {SIG_DFL, [], 0}, 8) = 0
rt_sigprocmask(SIG_SETMASK, [], NULL, 8) = 0
nanosleep({1, 0}, {1, 0}) = 0
rt_sigprocmask(SIG_BLOCK, [CHLD], [], 8) = 0
rt_sigaction(SIGCHLD, NULL, {SIG_DFL, [], 0}, 8) = 0
rt_sigprocmask(SIG_SETMASK, [], NULL, 8) = 0
nanosleep({1, 0}, <unfinished ...>
The calls above keep looping indefinitely, and the process doesn’t recover. What do the calls above mean?
Sorry, my previous answer was wrong. It waits infinitely:
I have no idea why you would install signal handlers in a loop, but this is the behavior caused by the following php code:
I cannot imagine a reason why you would call sleep for non-debugging purposes in php, so look for any invocations of
sleep,usleeportime_nanosleep.