develooper Front page | perl.perl5.porters | Postings from January 2012

[perl #106212] close and dup hang in threads

Thread Next
Father Chrysostomos via RT
January 16, 2012 08:49
[perl #106212] close and dup hang in threads
Message ID:
On Wed Dec 14 07:35:12 2011, wrote:
> Filehandle duplication 'open(STDOUT, '>&', $tmph)', and 'close($tmph)'
>    sometimes
> hang in child (forked) processes, when threads are used in the top-
>    level process.
> A test program is included below (a skeleton of a program used as a
>    test execution
> driver). Run the program, and see the hangs using 'watch pstree'.

I can reproduce the hang, but when I run it under gdb it never gets that
far.  I get this instead:

Program received signal EXC_SOFTWARE, Software generated exception.
[Switching to process 86000]
0x98e6b1d6 in __wait4 ()

I have no idea what that means.

The backtrace is:

(gdb) bt
#0  0x98e6b1d6 in __wait4 ()
#1  0x98e6b1c9 in waitpid$UNIX2003 ()
#2  0x000d8016 in Perl_wait4pid (my_perl=0x92b200, pid=89663,
statusp=0xb0102d0c, flags=0) at util.c:3326
#3  0x001a1b07 in Perl_pp_waitpid (my_perl=0x92b200) at pp_sys.c:4090
#4  0x000c9de9 in Perl_runops_debug (my_perl=0x92b200) at dump.c:2119
#5  0x0002c8a2 in Perl_call_sv (my_perl=0x92b200, sv=0x18c1770, flags=9)
at perl.c:2695
#6  0x002d458b in S_ithread_run (arg=0x55af50) at threads.xs:517
#7  0x98e3785d in _pthread_start ()
#8  0x98e376e2 in thread_start ()


Father Chrysostomos

via perlbug:  queue: perl5 status: new

Thread Next Perl Programming lists via nntp and http.
Comments to Ask Bjørn Hansen at | Group listing | About