Skip Menu |

This queue is for tickets about the Clone CPAN distribution.

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

People
Owner: Nobody in particular
Requestors: james_avera [...] yahoo.com
Cc:
AdminCc:

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



Subject: Clone::clone on shared data causes crash
Date: Wed, 12 Mar 2014 22:13:01 -0700
To: bug-Clone [...] rt.cpan.org
From: Jim Avera <james_avera [...] yahoo.com>
Hi, I'm trying to use Clone::clone to copy a hash which is shared among threads, but when the result is accessed, Perl dies with "Can't locate object method "FETCH" via package "threads::shared::tie" at ..." Here's an example: #!/usr/bin/perl use strict; use warnings; use threads; use threads::shared; use Clone; my $a = shared_clone { foo => 100, bar => 200 }; my $b = Clone::clone($a); print $b->{foo}, "\n"; #crashes here -Jim
Hi Jim, I don't think Clone is thread-safe. Are you able to reproduce the issue if you use Storable's dclone() instead of Clone's clone()? Thanks!
Subject: Re: [rt.cpan.org #93821] Clone::clone on shared data causes crash
Date: Thu, 15 May 2014 16:31:27 -0700
To: bug-Clone [...] rt.cpan.org
From: Jim Avera <jim.avera [...] gmail.com>
On 05/15/2014 03:16 PM, Breno G. de Oliveira via RT wrote: | I don't think Clone is thread-safe. | Are you able to reproduce the issue if you use Storable's dclone() instead of Clone's clone()? I'm not familiar with Storable, but gave it a try. The result of dclone() can not be de-referenced either, but the error is different: #!/usr/bin/perl use strict; use warnings; use threads; use threads::shared; use Storable qw(dclone); my $a = shared_clone { foo => 100, bar => 200 }; my $b = dclone($a); # The next statement crashes with: # Can't locate object method "FETCH" via package "threads::shared::tie" print $b->{foo}, "\n";
Subject: [rt.cpan.org #93821]
Date: Fri, 6 Nov 2015 16:19:56 +0000
To: "bug-Clone [...] rt.cpan.org" <bug-Clone [...] rt.cpan.org>
From: "Neubauer, Ralf" <ralf.neubauer [...] wido.bv.aok.de>
Unfortunately threads::shared implements the sharing with tie-s to threads::shared::tie, but it makes zero sense to have a clone take part in the sharing -- if you wanted that, you would use the original variable, not the clone... Clone and Storable will (dirtily) have to special case that an remove all tie-s to threads::shared::tie, to be able to cooperate with threads::shared. Note that threads::shared itself has the same problem, you can't send a structure over a Thread::Queue and return the sent object over this or another Threads::Queue, this will crash after one or more iterations (I don't remember). Ralf
Subject: RE: [rt.cpan.org #93821]
Date: Fri, 6 Nov 2015 16:32:07 +0000
To: "bug-Clone [...] rt.cpan.org" <bug-Clone [...] rt.cpan.org>
From: "Neubauer, Ralf" <ralf.neubauer [...] wido.bv.aok.de>
https://rt.perl.org/Public/Bug/Display.html?id=38443 Date: Mon, 06 Feb 2006 16:43:36 +0100 :)
Ticket migrated to github as https://github.com/garu/Clone/issues/18
Subject: Auto Response: [rt.cpan.org #93821] Clone::clone on shared data causes crash
Date: Thu, 25 Oct 2018 19:58:32 +0000 (UTC)
To: bug-Clone [...] rt.cpan.org
From: Jim Avera <james_avera [...] yahoo.com>
Subject: MY EMAIL HAS CHANGED I no longer receive email sent to this address! My email address is now        jim.avera@gmail.com Please update your Address Book.  And if you "reply" to a message which contains my old address, please change it to jim.avera@gmail.com before sending. Thanks.