...the thing doesn't have to be recursive
The issue is that while running your code, perl internally builds up a call stack of impressive depth (218255 frames here — my attempt segfaulted at $count being around 43650 (with the default ulimit -s setting of 8192kB)), as shown by the backtrace based on the core dump:
$ ./665040.pl Count, Last value: Testing: 43650 -> 43650 Segmentation fault (core dumped) $ gdb /usr/local/perl/5.10.0/bin/perl core (...) Core was generated by `/usr/local/perl/5.10.0/bin/perl ./665040.pl'. Program terminated with signal 11, Segmentation fault. #0 0x080acd57 in Perl_sv_clear () (gdb) bt #0 0x080acd57 in Perl_sv_clear () #1 0x080ad378 in Perl_sv_free2 () #2 0x0809915f in Perl_av_undef () #3 0x080ad129 in Perl_sv_clear () #4 0x080ad378 in Perl_sv_free2 () #5 0x080acd5f in Perl_sv_clear () #6 0x080ad378 in Perl_sv_free2 () (...) (...) #218242 0x0809915f in Perl_av_undef () #218243 0x080ad129 in Perl_sv_clear () #218244 0x080ad378 in Perl_sv_free2 () #218245 0x080acd5f in Perl_sv_clear () #218246 0x080ad378 in Perl_sv_free2 () #218247 0x0809915f in Perl_av_undef () #218248 0x080ad129 in Perl_sv_clear () #218249 0x080ad378 in Perl_sv_free2 () #218250 0x080c79e0 in Perl_leave_scope () #218251 0x080a13a8 in Perl_pp_unstack () #218252 0x080a0bb8 in Perl_runops_standard () #218253 0x0809f652 in perl_run () #218254 0x0805ee8f in main () (gdb)
In reply to Re^2: Oddity with memory manglement in 5.8.8, 5.10.0
by almut
in thread Oddity with memory manglement in 5.8.8, 5.10.0
by lembark
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |