I can confirm this bug (no, a segfault is not a feature!) under 5.6.0 under Linux 2.4.7 and 5.6.1 under linux 2.4.13; Note that it's not the empty list which causes the error, but the two list assignments. Either of the following also cause segfaults:

@a = (1..3); @b = (4..42); sub

or:

@a = (1..3); @a = (4..42); sub

gdb's backtrace shows:

(gdb) bt #0 0x08078a86 in Perl_pad_free () at eval.c:41 #1 0x08078d57 in S_op_clear () at eval.c:41 #2 0x08078be9 in Perl_op_free () at eval.c:41 #3 0x08078ba8 in Perl_op_free () at eval.c:41 #4 0x08078ba8 in Perl_op_free () at eval.c:41 #5 0x08078ba8 in Perl_op_free () at eval.c:41 #6 0x08078ba8 in Perl_op_free () at eval.c:41 #7 0x080bd376 in S_doeval () at eval.c:41 #8 0x080be494 in Perl_pp_require () at eval.c:41 #9 0x08097b40 in Perl_runops_standard () at eval.c:41 #10 0x0805cd18 in S_call_body () at eval.c:41 #11 0x0805cae6 in perl_call_sv () at eval.c:41 #12 0x0805f4db in S_call_list_body () at eval.c:41 #13 0x0805f1ce in Perl_call_list () at eval.c:41 #14 0x0807fed3 in Perl_newATTRSUB () at eval.c:41 #15 0x0807d086 in Perl_utilize () at eval.c:41 #16 0x080769fa in Perl_yyparse () at eval.c:41 #17 0x0805c063 in S_parse_body () at eval.c:41 #18 0x0805b7ee in perl_parse () at eval.c:41 #19 0x08059ee9 in main () at eval.c:41

Looks like an "oops." Not being a core perl hacker, it doesn't mean much to me, though. Others with more clue?

Update: Fixed a typo, thanks to crazyinsomniac. Also, this does not segfault under 5.6.0 on SunOS 5.8 -- smells like an OS-dependant bug to me..

perl -pe '"I lo*`+$^X$\"$]!$/"=~m%(.*)%s;$_=$1;y^`+*^e v^#$&V"+@( NO CARRIER'


In reply to Re: Bug in perl 5.6.0? by Chmrr
in thread Bug in perl 5.6.0? by ferrency

Title:
Use:  <p> text here (a paragraph) </p>
and:  <code> code here </code>
to format your post, it's "PerlMonks-approved HTML":



  • Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
  • Titles consisting of a single word are discouraged, and in most cases are disallowed outright.
  • Read Where should I post X? if you're not absolutely sure you're posting in the right place.
  • Please read these before you post! —
  • Posts may use any of the Perl Monks Approved HTML tags:
    a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, details, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, summary, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
  • You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
            For:     Use:
    & &amp;
    < &lt;
    > &gt;
    [ &#91;
    ] &#93;
  • Link using PerlMonks shortcuts! What shortcuts can I use for linking?
  • See Writeup Formatting Tips and other pages linked from there for more info.