> [EMAIL PROTECTED] - Tue Jan 11 18:15:56 2005]:
> 
> The following code generates a segfault:
> eval { /(?{die})/ }; $@
> 
> Note that the $@ is necessary as it doesn't segfault without it.
> If you omit the reference to $@ it doesn't segfault but it doesn't
> appear to execute any code after the eval block. For example,
> perl -e"eval { /(?{die})/ }; print 'foo' " 
> produces no output, but doesn't segfault.
> 
> 

This is repeatable with the current blead.  Backtrace and -DstvP output
below.

#0  0x080e6902 in Perl_pp_gvsv (my_perl=0x81b6008) at pp_hot.c:61
61              PUSHs(GvSV(cGVOP_gv));
(gdb) bt
#0  0x080e6902 in Perl_pp_gvsv (my_perl=0x81b6008) at pp_hot.c:61
#1  0x080cbe61 in Perl_runops_debug (my_perl=0x81b6008) at dump.c:1600
#2  0x08066c3f in S_run_body (my_perl=0x81b6008, oldscope=1) at perl.c:2038
#3  0x080666b5 in perl_run (my_perl=0x81b6008) at perl.c:1972
#4  0x0806046d in main (argc=2, argv=0xbffffab4, env=0xbffffac0) at
perlmain.c:103

[EMAIL PROTECTED]:~/perl-current$ ./perl -DstvP -wle'eval { /(?{die})/ }; print 
$@'
Use of uninitialized value.
filter_add func 806ce46 ()
Use of uninitialized value.
filter_read 0: via function 81b6d88 ()
Use of uninitialized value at -e line 1.
filter_read 0: via function 81b6d88 ()
filter_del func 806ce46
EXECUTING...


STACK 0: MAIN

(-e:0)  enter

STACK 0: MAIN
  CX 0: BLOCK  => 

(-e:0)  nextstate

STACK 0: MAIN
  CX 0: BLOCK  => 

(-e:1)  entertry

STACK 0: MAIN
  CX 0: BLOCK  => 
  CX 1: EVAL   => 
  retop=nextstate

(-e:1)  nextstate

STACK 0: MAIN
  CX 0: BLOCK  => 
  CX 1: EVAL   => 
  retop=nextstate

STACK 0: MAIN
  CX 0: BLOCK  => 
  CX 1: EVAL   => 
  retop=nextstate

(-e:1)  match
Use of uninitialized value $_ in pattern match (m//) at -e line 1.

STACK 0: MAIN
  CX 0: BLOCK  => 
  CX 1: EVAL   => 
  retop=nextstate

(-e:1)  nextstate

STACK 0: MAIN
  CX 0: BLOCK  => 
  CX 1: EVAL   => 
  retop=nextstate

((re_eval 1):1) pushmark

STACK 0: MAIN
  CX 0: BLOCK  => 
  CX 1: EVAL   => *  
  retop=nextstate

((re_eval 1):1) die

STACK 0: MAIN
  CX 0: BLOCK  => 

(-e:1)  nextstate

STACK 0: MAIN
  CX 0: BLOCK  => 

(-e:1)  pushmark

STACK 0: MAIN
  CX 0: BLOCK  => *  

(-e:1)  gvsvSegmentation fault (core dumped)

Reply via email to