J
Jeremy Slade
I have a script running in perl 5.6.1 on a debian sarge system (kernel
2.6.8).
On occasion, the perl interpreter just hangs. I have been able to
attach to the process with gdb to get a stack trace, and unfortunately
it is not always the same. But there does seem to be some consistency.
The last frame of the stack is always pthread_setcanceltype() from
libc.so.6. Farther down the stack there is almost always
Perl_signalhandler. Here's an example stack trace:
#0 0x4014b7a1 in pthread_setcanceltype () from /lib/tls/libc.so.6
#1 0x4019a940 in __after_morecore_hook () from /lib/tls/libc.so.6
#2 0x40199fcc in ?? () from /lib/tls/libc.so.6
#3 0x00000011 in ?? ()
#4 0x400d9d53 in posix_memalign () from /lib/tls/libc.so.6
#5 0x40300010 in ?? ()
#6 0x40300490 in ?? ()
#7 0x0847f15c in ?? ()
#8 0x0847f15c in ?? ()
#9 0x0849fe00 in ?? ()
#10 0x080a4ac8 in Perl_sv_clear ()
#11 0x080a4f0b in Perl_sv_free ()
#12 0x080aef69 in Perl_pp_vec ()
#13 0x08098f98 in Perl_runops_standard ()
#14 0x0805cbca in perl_call_sv ()
#15 0x0805cb0a in perl_call_sv ()
#16 0x08095247 in Perl_sighandler ()
#17 <signal handler called>
#18 0x400d62a8 in free () from /lib/tls/libc.so.6
#19 0x4019a940 in __after_morecore_hook () from /lib/tls/libc.so.6
#20 0x084e39e8 in ?? ()
#21 0x0870fc10 in ?? ()
#22 0x0870fc10 in ?? ()
#23 0xbffffb70 in ?? ()
#24 0x08097b43 in Perl_av_undef ()
#25 0x080a4b0f in Perl_sv_clear ()
#26 0x080a4f0b in Perl_sv_free ()
#27 0x0807ff75 in Perl_cv_undef ()
#28 0x080a4b4c in Perl_sv_clear ()
#29 0x080a4f0b in Perl_sv_free ()
#30 0x080b680a in Perl_free_tmps ()
#31 0x080994b1 in Perl_pp_unstack ()
#32 0x08098f98 in Perl_runops_standard ()
#33 0x0805c2df in perl_run ()
#34 0x0805c15a in perl_run ()
#35 0x08059c3a in main ()
I have tried the same script on debian stable systems (same perl 5.6.1
binary, however), and it seems to work much better, I don't ever see
this problem.
Since this call to pthread_setcanceltype happens way down inside other
function calls, I suspect this is not at all a perl problem, but rather
a linux or libc problem. But I am hoping that someone can offer some
help in determining why this hangs and what I might be able to do about it.
Thanks,
Jeremy
2.6.8).
On occasion, the perl interpreter just hangs. I have been able to
attach to the process with gdb to get a stack trace, and unfortunately
it is not always the same. But there does seem to be some consistency.
The last frame of the stack is always pthread_setcanceltype() from
libc.so.6. Farther down the stack there is almost always
Perl_signalhandler. Here's an example stack trace:
#0 0x4014b7a1 in pthread_setcanceltype () from /lib/tls/libc.so.6
#1 0x4019a940 in __after_morecore_hook () from /lib/tls/libc.so.6
#2 0x40199fcc in ?? () from /lib/tls/libc.so.6
#3 0x00000011 in ?? ()
#4 0x400d9d53 in posix_memalign () from /lib/tls/libc.so.6
#5 0x40300010 in ?? ()
#6 0x40300490 in ?? ()
#7 0x0847f15c in ?? ()
#8 0x0847f15c in ?? ()
#9 0x0849fe00 in ?? ()
#10 0x080a4ac8 in Perl_sv_clear ()
#11 0x080a4f0b in Perl_sv_free ()
#12 0x080aef69 in Perl_pp_vec ()
#13 0x08098f98 in Perl_runops_standard ()
#14 0x0805cbca in perl_call_sv ()
#15 0x0805cb0a in perl_call_sv ()
#16 0x08095247 in Perl_sighandler ()
#17 <signal handler called>
#18 0x400d62a8 in free () from /lib/tls/libc.so.6
#19 0x4019a940 in __after_morecore_hook () from /lib/tls/libc.so.6
#20 0x084e39e8 in ?? ()
#21 0x0870fc10 in ?? ()
#22 0x0870fc10 in ?? ()
#23 0xbffffb70 in ?? ()
#24 0x08097b43 in Perl_av_undef ()
#25 0x080a4b0f in Perl_sv_clear ()
#26 0x080a4f0b in Perl_sv_free ()
#27 0x0807ff75 in Perl_cv_undef ()
#28 0x080a4b4c in Perl_sv_clear ()
#29 0x080a4f0b in Perl_sv_free ()
#30 0x080b680a in Perl_free_tmps ()
#31 0x080994b1 in Perl_pp_unstack ()
#32 0x08098f98 in Perl_runops_standard ()
#33 0x0805c2df in perl_run ()
#34 0x0805c15a in perl_run ()
#35 0x08059c3a in main ()
I have tried the same script on debian stable systems (same perl 5.6.1
binary, however), and it seems to work much better, I don't ever see
this problem.
Since this call to pthread_setcanceltype happens way down inside other
function calls, I suspect this is not at all a perl problem, but rather
a linux or libc problem. But I am hoping that someone can offer some
help in determining why this hangs and what I might be able to do about it.
Thanks,
Jeremy