gperl
gperl copied to clipboard
Segmentation fault when calling nested function call
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
Thank you for report. The following code is simple solution.
#define MAX_CALLSTACK_SIZE 128 => 4096
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]