bloonix has asked for the wisdom of the Perl Monks concerning the following question:
my $i = 30000; my %h = (new => {}); my $r = \%h; for (0..$i) { print $_, " "; $r = $r->{new}; $r->{new} = {}; } print "end\n";
I test it with different iterations and from 24.000 the segfault is produced definitely. If I try to undef %h the segfault is produced immediate....29998 29999 30000 end Segmentation fault (core dumped)
my $i = 30000; my %h = (new => {}); my $r = \%h; for (0..$i) { print $_, " "; $r = $r->{new}; $r->{new} = {}; } undef %h; print "end\n";
Edit: g0n - changed pre tags to code tags
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: Segmentation fault
by Joost (Canon) on Jun 25, 2007 at 20:11 UTC | |
by jettero (Monsignor) on Jun 25, 2007 at 20:18 UTC | |
by Joost (Canon) on Jun 25, 2007 at 20:21 UTC | |
by dave_the_m (Monsignor) on Jun 25, 2007 at 20:40 UTC | |
by jasonk (Parson) on Jun 26, 2007 at 12:56 UTC | |
by jettero (Monsignor) on Jun 26, 2007 at 14:09 UTC | |
by bloonix (Monk) on Jun 25, 2007 at 20:30 UTC | |
by Joost (Canon) on Jun 25, 2007 at 20:47 UTC | |
by martin (Friar) on Jun 25, 2007 at 22:11 UTC | |
by Joost (Canon) on Jun 25, 2007 at 22:29 UTC |