Subject: | stack overflow with moderately complex data structures |
Date: | Sat, 26 Jul 2014 15:29:58 +0200 |
To: | bug-Clone [...] rt.cpan.org, bug-Storable [...] rt.cpan.org, bug-threads [...] rt.cpan.org |
From: | Ralf Neubauer <ralf [...] strcmp.de> |
This comes from the discussion of [rt.cpan.org #97508]:
$ ulimit -s
8192
$ perl -e 'use Clone qw(clone); $t = [$t] for 1..30000; clone $t'
$ perl -e 'use Clone qw(clone); $t = [$t] for 1..40000; clone $t'
Segmentation fault (core dumped)
$ ulimit -s 16348
$ perl -e 'use Clone qw(clone); $t = [$t] for 1..40000; clone $t'
$ perl -e 'use Clone qw(clone); $t = [$t] for 1..60000; clone $t'
$ perl -e 'use Clone qw(clone); $t = [$t] for 1..70000; clone $t'
Segmentation fault (core dumped)
$ dpkg -l perl libclone-perl | grep ii
ii libclone-perl 0.36-1 amd64 module for recursively copying Perl datatypes
ii perl 5.18.2-2ubuntu1 amd64 Larry Wall's Practical Extraction and Report Language
The same happens with:
$ perl -e 'use threads; $t = [$t] for 1..30000; (async {})->join'
Segmentation fault (core dumped)
$ perl -e 'use Storable qw(dclone); $t = [$t] for 1..30000; dclone $t'
Segmentation fault (core dumped)