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

Running perl v5.6.1 on a Red Hat 7.1 linux distro with the 2.4.2-2 kernel, perldoc core dumps when used like so
shell> perldoc -q '$#' Segmentation fault (core dumped)
As far as I can tell this bug only affects v5.6.1 on linux, as I can't duplicate it on either Solaris using v5.6.1 or on linux using v5.005_03. If I do a gdb backtrace I get the following
(gdb) bt #0 0x080d2fb0 in S_find_byclass () at eval.c:41 #1 0x080d2ce4 in Perl_re_intuit_start () at eval.c:41 #2 0x0809b6f3 in Perl_pp_match () at eval.c:41 #3 0x080990d8 in Perl_runops_standard () at eval.c:41 #4 0x0805c5f3 in S_run_body () at eval.c:41 #5 0x0805c342 in perl_run () at eval.c:41 #6 0x08059fd0 in main () at eval.c:41 #7 0x40073177 in __libc_start_main (main=0x8059f60 <main>, argc=4, ub +p_av=0xbffff8fc, init=0x8059194 <_init>, fini=0x80dfa00 <_fini>, rtld_fini=0x4000e184 <_dl_fini>, stack_end=0xbffff8ec) at ../sysde +ps/generic/libc-start.c:129
So the problem seems to lie in S_find_byclass which happens to be at line 850 in regexec.c in the v5.6.1 source. I'm not sure what the exact problem is, but I'm guessing it's something to do with the fact the # follows the $ which it probably shouldn't.

If this particular bug hasn't been reported yet (and I don't think it has, as I couldn't find it on perlbug), how would I go about reporting it?

broquaint

Replies are listed 'Best First'.
Re: perldoc core dump bug
by rinceWind (Monsignor) on Feb 25, 2002 at 11:13 UTC

    Crashes on VMS too.

    Perhaps you should post this one to perlbug

    $ perldoc -q "$#" Use of uninitialized value in substitution (s///) at perl_root:[lib.po +d]perldoc.com line 279. Use of uninitialized value in length at perl_root:[lib.pod]perldoc.com + line 255. Use of uninitialized value in length at perl_root:[lib.pod]perldoc.com + line 255. Use of uninitialized value in length at perl_root:[lib.pod]perldoc.com + line 255. Use of uninitialized value in length at perl_root:[lib.pod]perldoc.com + line 255. Use of uninitialized value in substitution (s///) at perl_root:[lib.po +d]perldoc.com line 279. Use of uninitialized value in length at perl_root:[lib.pod]perldoc.com + line 255. Use of uninitialized value in length at perl_root:[lib.pod]perldoc.com + line 255. Use of uninitialized value in length at perl_root:[lib.pod]perldoc.com + line 255. Use of uninitialized value in length at perl_root:[lib.pod]perldoc.com + line 255. Use of uninitialized value in substitution (s///) at perl_root:[lib.po +d]perldoc.com line 279. Use of uninitialized value in length at perl_root:[lib.pod]perldoc.com + line 255. Use of uninitialized value in length at perl_root:[lib.pod]perldoc.com + line 255. Use of uninitialized value in length at perl_root:[lib.pod]perldoc.com + line 255. Use of uninitialized value in length at perl_root:[lib.pod]perldoc.com + line 255. Use of uninitialized value in substitution (s///) at perl_root:[lib.po +d]perldoc.com line 279. Use of uninitialized value in length at perl_root:[lib.pod]perldoc.com + line 255. Use of uninitialized value in length at perl_root:[lib.pod]perldoc.com + line 255. Use of uninitialized value in length at perl_root:[lib.pod]perldoc.com + line 255. Use of uninitialized value in length at perl_root:[lib.pod]perldoc.com + line 255. Use of uninitialized value in substitution (s///) at perl_root:[lib.po +d]perldoc.com line 279. Use of uninitialized value in length at perl_root:[lib.pod]perldoc.com + line 255. Use of uninitialized value in length at perl_root:[lib.pod]perldoc.com + line 255. Use of uninitialized value in length at perl_root:[lib.pod]perldoc.com + line 255. Use of uninitialized value in length at perl_root:[lib.pod]perldoc.com + line 255. Use of uninitialized value in substitution (s///) at perl_root:[lib.po +d]perldoc.com line 279. Use of uninitialized value in length at perl_root:[lib.pod]perldoc.com + line 255. Use of uninitialized value in length at perl_root:[lib.pod]perldoc.com + line 255. Use of uninitialized value in length at perl_root:[lib.pod]perldoc.com + line 255. Use of uninitialized value in length at perl_root:[lib.pod]perldoc.com + line 255. Use of uninitialized value in substitution (s///) at perl_root:[lib.po +d]perldoc.com line 279. Use of uninitialized value in length at perl_root:[lib.pod]perldoc.com + line 255. Use of uninitialized value in length at perl_root:[lib.pod]perldoc.com + line 255. Use of uninitialized value in length at perl_root:[lib.pod]perldoc.com + line 255. Use of uninitialized value in length at perl_root:[lib.pod]perldoc.com + line 255. Use of uninitialized value in substitution (s///) at perl_root:[lib.po +d]perldoc.com line 279. Use of uninitialized value in length at perl_root:[lib.pod]perldoc.com + line 255. Use of uninitialized value in length at perl_root:[lib.pod]perldoc.com + line 255. Use of uninitialized value in length at perl_root:[lib.pod]perldoc.com + line 255. Use of uninitialized value in length at perl_root:[lib.pod]perldoc.com + line 255. Use of uninitialized value in substitution (s///) at perl_root:[lib.po +d]perldoc.com line 279. Use of uninitialized value in length at perl_root:[lib.pod]perldoc.com + line 255. Use of uninitialized value in length at perl_root:[lib.pod]perldoc.com + line 255. Use of uninitialized value in length at perl_root:[lib.pod]perldoc.com + line 255. Use of uninitialized value in length at perl_root:[lib.pod]perldoc.com + line 255. %SYSTEM-F-ACCVIO, access violation, reason mask=00, virtual address=00 +00000000216000, PC=0000000000192610, PS=0000001B Improperly handled condition, image exit forced. Signal arguments: Number = 0000000000000005 Name = 000000000000000C 0000000000000000 0000000000216000 0000000000192610 000000000000001B Register dump: R0 = 0000000000000001 R1 = 0000000000000004 R2 = 000000000005 +D708 R3 = 0000000000412D70 R4 = 0000000000412DB0 R5 = 000000000021 +6000 R6 = 00000000003E45AD R7 = 0000000000000001 R8 = 000000000041 +2DB4 R9 = 000000000000003D R10 = 0000000000000006 R11 = 000000000000 +0001 R12 = 0000000000210708 R13 = 6165683D00033406 R14 = 000000000041 +2D70 R15 = 0000000000412D70 R16 = 0000000000000001 R17 = 000000000000 +003D R18 = 0000000000000006 R19 = 0000000000082448 R20 = 000000000000 +0069 R21 = 0000000000192360 R22 = 0000000000000048 R23 = 000000000041 +2DB1 R24 = 0000000000000049 R25 = 4F4E4D4C4B4A4948 R26 = 000000000019 +2654 R27 = 000000000004E290 R28 = 0000000000192590 R29 = 000000007AEE +7540 SP = 000000007AEE7540 PC = 0000000000192610 PS = 000000000000 +001B $
Re: perldoc core dump bug
by Chmrr (Vicar) on Feb 25, 2002 at 11:45 UTC

    Interesting. I can't get it to dump core under Perl 5.6.1 on one Linux box, but it does dump core under another -- also running Linux and Perl 5.6.1. The main difference is that the second machine is running a hand-built threaded perl. Hrm -- strange. Anyways, I get a similar output from gdb:

    (gdb) bt #0 0x080e4730 in Perl_re_intuit_start () at eval.c:41 #1 0x080e4433 in Perl_re_intuit_start () at eval.c:41 #2 0x080a38ae in Perl_pp_match () at eval.c:41 #3 0x080a0fba in Perl_runops_standard () at eval.c:41 #4 0x0805dd3c in perl_run () at eval.c:41 #5 0x0805da58 in perl_run () at eval.c:41 #6 0x0805b226 in main () at eval.c:41 #7 0x40090177 in __libc_start_main (main=0x805b1b0 <main>, argc=4, ub +p_av=0xbffff9ec, init=0x805a33c <_init>, fini=0x80f4460 <_fini>, rtld_fini=0x4000e184 <_dl_fini>, stack_end +=0xbffff9dc) at ../sysdeps/generic/libc-start.c:129

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

Re: perldoc core dump bug
by broquaint (Abbot) on Feb 25, 2002 at 11:25 UTC
    It also crashes if you put almost any other character after the $
    shell> perldoc -q '$_' Segmentation fault (core dumped) shell> perldoc -q '$=' Segmentation fault (core dumped) shell> perldoc -q '$p' Segmentation fault (core dumped)
    But I've found * and + to 'work' (see. not core dump ;-)

    broquaint

    Update:

    Having just compiled up v5.7.2 I find this bug has gone (at least on my system), and upon doing a diff on the 2 versions' regexec.c I get a rather significant amount of changes (2599 according to wc -l).
    Many thanks to those (rinceWind, Chmrr, Veachian64) that have tested so far!

Re: perldoc core dump bug
by Veachian64 (Scribe) on Feb 25, 2002 at 13:04 UTC
    Hmmmm, strange, it works just fine for me with 5.6.1 on Linux 2.5.5 and Win2K.
    [v64@Arsenic /home/v64]$ perldoc -f '$#' No documentation for perl function '$#' found