Beefy Boxes and Bandwidth Generously Provided by pair Networks
laziness, impatience, and hubris
 
PerlMonks  

Re: Perl threads sort test program crashes

by eyepopslikeamosquito (Chancellor)
on Jun 17, 2004 at 05:33 UTC ( #367537=note: print w/replies, xml ) Need Help??


in reply to Perl threads sort test program crashes

I hacked the thread-id into deb.c/Perl_vdeb() so that perl -Dt also prints thread-id. The crashes seem to occur when one thread does a POPBLOCK/LEAVE as a sort finishes inside the for(). I further noticed that when I change:

for my $k (sort mycmp @list) {}

to simply:

sort mycmp @list;

the crashes go away. Edited perl -Dtlsv output follows:

4440: (p5-5A.pl:7) gvsv(main::a) 4440: (p5-5A.pl:7) length 4440: (p5-5A.pl:7) ncmp 4440: (p5-5A.pl:7) leavesub 4440: (p5-5A.pl:7) nextstate 4440: (p5-5A.pl:7) gvsv(main::b) 4440: (p5-5A.pl:7) length 4440: (p5-5A.pl:7) gvsv(main::a) 4440: (p5-5A.pl:7) length 9432: (p5-5A.pl:7) length 9432: (p5-5A.pl:7) ncmp 9432: (p5-5A.pl:7) leavesub 9432: (p5-5A.pl:7) nextstate 9432: (p5-5A.pl:7) gvsv(main::b) 9432: (p5-5A.pl:7) length 9432: (p5-5A.pl:7) gvsv(main::a) 9432: (p5-5A.pl:7) length 9432: (p5-5A.pl:7) ncmp 4440: (p5-5A.pl:7) ncmp 4440: (p5-5A.pl:7) leavesub 4440: (p5-5A.pl:7) nextstate 4440: (p5-5A.pl:7) gvsv(main::b) 4440: (p5-5A.pl:7) length 4440: (p5-5A.pl:7) gvsv(main::a) 4440: (p5-5A.pl:7) length 4440: (p5-5A.pl:7) ncmp *** tid=4440 crashed around here *** 9432: (p5-5A.pl:7) leavesub 9432: (p5-5A.pl:19) POPBLOCK scope 7 at ..\pp_sort.c:1579 9432: (p5-5A.pl:19) LEAVE scope 7 at ..\pp_sort.c:1627 9432: (p5-5A.pl:19) enteriter 9432: (p5-5A.pl:19) ENTER scope 7 at ..\pp_ctl.c:1666 9432: (p5-5A.pl:19) ENTER scope 8 at ..\pp_ctl.c:1697 9432: (p5-5A.pl:19) iter 9432: (p5-5A.pl:19) and (tid=9432 continues on)

Log In?
Username:
Password:

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://367537]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this? | Other CB clients
Other Users?
Others musing on the Monastery: (7)
As of 2019-10-21 21:15 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?
    Notices?