I'm not sure if this should be reported on glibc or gcc, so I'll report it here first.
When a program is compiled with -pg, and the SIGPROF signal occurs during (perhaps certain points in) the fork () system call, it causes the program to enter an endless loop of re-calling fork() and having the next SIGPROF interrupt the fork() call. Attaching to the program with GDB and manually calling signal(27,1) (i.e., signal(SIGPROF, SIG_IGN) causes the program to continue normally, albeit with profiling broken of course. Host system is CentOS 5.x. I have not tried to reproduce the problem with -p, only with -pg. The problem occurs for us daily or more frequently when the program in question is heavily used. I have not written any test code to reliably reproduce the problem on-demand. -- Summary: Profile timer hangs fork() Product: gcc Version: 4.1.2 Status: UNCONFIRMED Severity: normal Priority: P3 Component: c AssignedTo: unassigned at gcc dot gnu dot org ReportedBy: Greg dot Beeley at LightSys dot org GCC host triplet: i386-redhat-linux GCC target triplet: i386-redhat-linux http://gcc.gnu.org/bugzilla/show_bug.cgi?id=43239