http://qs321.pair.com?node_id=606980

bsb has asked for the wisdom of the Perl Monks concerning the following question:

I managed to segfault perl 5.8.8 on linux with this
$ perl -we 'open O, "> /dev/null"; print O (scalar readline)' Filehandle O opened only for output at -e line 1. Segmentation fault (core dumped)
For some reason I thought readline defaulted to STDIN, not that it matters. Can someone check if blead does this too?

Replies are listed 'Best First'.
Re: Check core dump with new Perl
by Corion (Patriarch) on Mar 28, 2007 at 11:55 UTC

    ambrus reported a similar error recently in the Chatterbox and subsequently submitted perlbug #42029 to p5p (and to RT.perl.org (#42029). It seems that the following alone is enough to crash bleadperl and maintperl:

    perl -e 'warn readline'

    You might want to append your report to that bug.

      Unfortunately, rt.perl.org's auth mechanism doesn't seem to like my corporate firewall, so I can't update the bug report with the info from this thread.

      Too bad :(


      Mike
Re: Check core dump with new Perl
by RMGir (Prior) on Mar 28, 2007 at 11:37 UTC
    On a solaris 9 box, also running 5.8.8, same result:
    $ perl -we 'open O, "> /dev/null"; print O (scalar readline)' Filehandle O opened only for output at -e line 1. Bus Error

    On Cygwin w/5.8.7, the same thing happens, but interestingly enough the warn readline(); example posted below doesn't trigger:

    $ perl -we 'open O, "> /dev/null"; print O (scalar readline)' Filehandle O opened only for output at -e line 1. 11 [main] perl 4756 _cygtls::handle_exceptions: Error while dumpi +ng state ( probably corrupted stack) Segmentation fault (core dumped) $ perl -e 'warn readline()' Warning: something's wrong at -e line 1.

    Mike
Re: Check core dump with new Perl
by Anno (Deacon) on Mar 28, 2007 at 11:34 UTC
    Seems to be fixed in v5.9.4 DEVEL28658

    Anno