gperl icon indicating copy to clipboard operation
gperl copied to clipboard

Segmentation fault when calling nested function call

Open imasahiro opened this issue 12 years ago • 2 comments

The following code crashes gperl:


sub f00 { my $n = shift; return $n + 1; }
sub f01 { my $n = shift; return f00($n) + 1;}
sub f02 { my $n = shift; return f01($n) + 1;}
sub f03 { my $n = shift; return f02($n) + 1;}
…
sub f128 { my $n = shift; return f127($n) + 1;}
sub f129 { my $n = shift; return f128($n) + 1;}
sub f130 { my $n = shift; return f129($n) + 1;}

print(f130(1), "\n");

./gperl ../sample/stress_call.pl
Segmentation fault: 11

imasahiro avatar Aug 16 '12 01:08 imasahiro

Thank you for report. The following code is simple solution.

#define MAX_CALLSTACK_SIZE 128 => 4096

goccy avatar Aug 16 '12 03:08 goccy

thank you for your infomation, but still not work. We cannot define function more than 128.

$ gdb -arg ./Debug/gperl sample/stress_call.pl
(gdb) r
COMPILE ERROR: cannot find func name[f128]

imasahiro avatar Aug 19 '12 03:08 imasahiro