Skip Menu |

This queue is for tickets about the Set-Object CPAN distribution.

Report information
The Basics
Id: 131354
Status: resolved
Priority: 0/
Queue: Set-Object

People
Owner: Nobody in particular
Requestors: DUELAFN [...] cpan.org
Cc:
AdminCc:

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



Subject: $aset->insert(@$bset) fails
After a system upgrade I started getting errors in a script which I tracked down to a change in behavior of Set::Object. The attached test script produces different results depending on version: good: perl 5.024001, Set::Object 1.35 => 3 bad: perl 5.028001, Set::Object 1.39 => 0 Somehow on the new system, objects do not copy to a new set. Replacing the insert line with either of the "OK" commented lines makes the script work as expected.
Subject: test.pl
use Set::Object qw/ set /; my $a = set("a", "b", "c"); my $b = set(); $b->insert(@$a); # $b->insert(map "$_", @$a); # OK # $b->insert($a->members); # OK print "perl $], Set::Object $Set::Object::VERSION => ", $b->size, "\n"; ## Formatted for test suite: # # my $a = set("a", "b", "c"); # my $b = set(); # $added = $b->insert(@$a); # is($added, 3, "Set::Object->insert() [ returned # added ]"); # is($b->size(), 3, "Set::Object->size() [ three members ]");
On Sat, Jan 4, 2020 4:53:00 PM, DUELAFN wrote: Show quoted text
> > After a system upgrade I started getting errors in a script which I > tracked down to a change in behavior of Set::Object. The attached test > script produces different results depending on version: > > good: perl 5.024001, Set::Object 1.35 => 3 > > bad: perl 5.028001, Set::Object 1.39 => 0 > > Somehow on the new system, objects do not copy to a new set. Replacing > the insert line with either of the "OK" commented lines makes the > script work as expected.
Got some time to do some testing and this seems to result from a change in perl itself since running Set::Object 1.39 on perl 5.24 produces the expected results. good: perl 5.024001, Set::Object 1.39 => 3 I guess that means it could be a bug in perl or it could be some optimization that will need worked around in Set::Object.
The difference with 5.28 is that in the call to the tied FETCHSIZE method, $self->[1] does not call the FETCH method anymore. Need to find a proper workaround for this. -- Reini Urban
On Sat Jan 18 17:06:14 2020, RURBAN wrote: Show quoted text
> The difference with 5.28 is that in the call to the tied FETCHSIZE > method, $self->[1] does not call the FETCH method anymore. > Need to find a proper workaround for this.
Found and fixed the bug, but haven't checked which perl5.27.x commit broke it. cperl5.28 is not affected by this regression. The fix was easy: add SvGETMAGIC expansions to all args, to expand possible other set objects, i.e. call FETCH on @$set. -- Reini Urban
Fixed in 1.40