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)
-
Are you posting in the right place? Check out Where do I post X? to know for sure.
-
Posts may use any of the Perl Monks Approved HTML tags. Currently these include the following:
<code> <a> <b> <big>
<blockquote> <br /> <dd>
<dl> <dt> <em> <font>
<h1> <h2> <h3> <h4>
<h5> <h6> <hr /> <i>
<li> <nbsp> <ol> <p>
<small> <strike> <strong>
<sub> <sup> <table>
<td> <th> <tr> <tt>
<u> <ul>
-
Snippets of code should be wrapped in
<code> tags not
<pre> tags. In fact, <pre>
tags should generally be avoided. If they must
be used, extreme care should be
taken to ensure that their contents do not
have long lines (<70 chars), in order to prevent
horizontal scrolling (and possible janitor
intervention).
-
Want more info? How to link
or How to display code and escape characters
are good places to start.
|