Beefy Boxes and Bandwidth Generously Provided by pair Networks
Problems? Is your data what you think it is?
 
PerlMonks  

Re: How to kill perl?

by EvanCarroll (Chaplain)
on Nov 04, 2005 at 19:13 UTC ( [id://505847]=note: print w/replies, xml ) Need Help??


in reply to How to kill perl?

My site has a nice one with reverse and sort perlbugs

perl -e '@a=(1..5); map {@a=() if $x++>2, $_} @a'
Can also be written as:
perl -e '@a=(1..5); map {@a=() if $x++, $_} @a'


Evan Carroll
www.EvanCarroll.com

Replies are listed 'Best First'.
Re^2: How to kill perl?
by robin (Chaplain) on Nov 05, 2005 at 11:21 UTC
    So, it turns out that your map/reverse bug is just one of a family of crash bugs, e.g:
    perl -e "map chomp(+()), ('')x10000;" perl -e "map chown(+()), ('')x10000;" perl -e "map warn(+()), ('')x100;"
    Though they're all fixed now!
      Not all of them are fixed, the top two tested negative, with Perl 5.8.7; however, the bottom one produced this.

      perl -e "map warn(+()), ('')x100;" ... ... Warning: something's wrong at -e line 1. Warning: something's wrong at -e line 1. Warning: something's wrong at -e line 1. Warning: something's wrong at -e line 1. Warning: something's wrong at -e line 1. Warning: something's wrong at -e line 1. Warning: something's wrong at -e line 1. Segmentation fault
      UPDATE:
      You are correct by increasing the number to 100_000, the top two crash as well.


      Evan Carroll
      www.EvanCarroll.com
        They're fixed in bleadperl, as of two days ago. The bug is still there in 5.8.7, and all three of these tests crash 5.8.7 for me. (Maybe you can see the crash too, if you increase the 10000 to something larger?)
Re^2: How to kill perl?
by robin (Chaplain) on Nov 04, 2005 at 22:57 UTC
    My site has a nice one with reverse and sort perlbugs

    That is nice. Do you have any idea why it happens? Is it in the bug database?

    Update: Looks like you don't need the second reverse, or even the <>; the following crashes both bleadperl and 5.8.6 for me:

    perl -e 'map print(reverse), ("")x68'

Re^2: How to kill perl?
by robin (Chaplain) on Nov 04, 2005 at 19:25 UTC

    Good point. Or even

    perl -e '@a=(0,1); map {@a=() if $_; $_} @a'

Log In?
Username:
Password:

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

How do I use this?Last hourOther CB clients
Other Users?
Others cooling their heels in the Monastery: (7)
As of 2024-03-28 21:03 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found