Skip Menu |

This queue is for tickets about the Graph CPAN distribution.

Report information
The Basics
Id: 41735
Status: resolved
Priority: 0/
Queue: Graph

People
Owner: Nobody in particular
Requestors: jonathanmoorephd [...] gmail.com
Cc:
AdminCc:

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



Subject: deep_copy does not return a true clone
With the code below, I believe that if deep_copy is working properly then the two asserts should either both succeed or both fail. However I have seen the first succeed but the second fail. sub induced_graph { my ( $G, $accepted ) = @_; assert_graph_valid($G); my $ret = $G->deep_copy(); assert_graph_valid($ret); } sub assert_graph_valid { my ($G) = @_; foreach my $edge ( $G->edges() ) { my @nodes = @$edge; my $num_nodes = @nodes; if ($num_nodes != 2 || ! defined ($nodes[0]) || ! defined ($nodes[1])) { print "Error with graph ($G)\n"; printf "Error with edge (%s)\n", Dumper($edge); die "assert failed"; } } } Perl version: This is perl, v5.10.0 built for cygwin-thread-multi-64int (with 6 registered patches, see perl -V for more detail) OS : CYGWIN_NT-5.1 1.5.25(0.156/4/2) 2008-06-12 19:34 i686 Cygwin I am happy to provide example data if the maintainer requests it.
Subject: Re: [rt.cpan.org #41735] deep_copy does not return a true clone
Date: Mon, 15 Dec 2008 19:51:40 -0500
To: bug-Graph [...] rt.cpan.org
From: Jarkko Hietaniemi <jhi [...] iki.fi>
Show quoted text
> } > > Perl version: This is perl, v5.10.0 built for cygwin-thread-multi-64int > (with 6 registered patches, see perl -V for more detail) > > OS : CYGWIN_NT-5.1 1.5.25(0.156/4/2) 2008-06-12 19:34 i686 Cygwin > > I am happy to provide example data if the maintainer requests it.
Example data makes testing always easier. Show quoted text
>
Can you provide a test case?
Subject: Re: [rt.cpan.org #41735] deep_copy does not return a true clone
Date: Sun, 21 Dec 2008 20:58:12 -0500
To: bug-Graph [...] rt.cpan.org
From: "Jonathan Moore" <jonathanmoorephd [...] gmail.com>
I'm on vacation & should be able to send a test case through on Dec 29th or 30th. Also, I should have noted that there was an easy work around for me, by using Storable's dclone.
Subject: Re: [rt.cpan.org #41735] deep_copy does not return a true clone
Date: Fri, 26 Dec 2008 21:44:42 -0500
To: bug-Graph [...] rt.cpan.org
From: Jarkko Hietaniemi <jhi [...] iki.fi>
Jonathan Moore via RT wrote: Show quoted text
> Queue: Graph > Ticket <URL: http://rt.cpan.org/Ticket/Display.html?id=41735 > > > I'm on vacation & should be able to send a test case through on Dec > 29th or 30th. > > Also, I should have noted that there was an easy work around for me, > by using Storable's dclone.
Please try with Graph 0.87. Show quoted text
>
I'm assuming this closed since in the latest releases deep_copy() uses Storable::dclone() if available (if not, fallback is Data::Dumper).