Skip Menu |

This queue is for tickets about the Clone CPAN distribution.

Report information
The Basics
Id: 97525
Status: open
Priority: 0/
Queue: Clone

People
Owner: Nobody in particular
Requestors: ralf [...] strcmp.de
Cc:
AdminCc:

Bug Information
Severity: (no value)
Broken in: (no value)
Fixed in: (no value)



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)
Subject: [rt.cpan.org #97525] stack trace
Date: Fri, 6 Nov 2015 14:42:13 +0000
To: "bug-Clone [...] rt.cpan.org" <bug-Clone [...] rt.cpan.org>
From: "Neubauer, Ralf" <ralf.neubauer [...] wido.bv.aok.de>
According to this stack trace (generated by stsc) this is a recursion only involving av_clone() and sv_clone() from auto/Clone/Clone.so , which is completely internal to the Clone distribution: http://perlpunks.de/paste/show/563ba05b.425c.da?plain=1 I would humbly suggest switching from recursion to some explicitly coded iterative traversal (e.g. maintaining an explicit recursion stack in the heap). Ralf
Ticket migrated to github as https://github.com/garu/Clone/issues/19