Skip Menu |

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

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

People
Owner: Nobody in particular
Requestors: ais523 [...] bham.ac.uk
Cc:
AdminCc:

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



Subject: Adding unblessed references to a weak set causes a segfault

The following program causes Perl to crash with a segmentation fault, no other error message displayed:

use Set::Object qw/weak_set/;

my $n = 1;
my $a = \$n;
my $set1 = weak_set();
$set1->insert($a);

The defining factor seems to be that the object that $a refers to is unblessed when added to the set. Expected behaviour is for the object to be added to the set without a segfault.

Tested with Set::Object 1.27, perl version 5.10.0, on Linux (2.6.31-17, packaged in Ubuntu Karmic).

I am not accepting bug reports without a test case, sorry.
Subject: Re: [rt.cpan.org #53182] Adding unblessed references to a weak set causes a segfault
Date: Wed, 13 Feb 2013 14:50:46 +0200
To: bug-Set-Object [...] rt.cpan.org
From: Yuval Kogman <nuffin [...] cpan.org>
The example code produces a segfault for me, all that's needed to make it into a test case is a plan + a pass()...
RT-Send-CC: nuffin [...] cpan.org
Hmm good point Yuval. I've added the test, but it seems to be fixed already: probably after the patch from the other RT ticket which supplied an actual TAP test script and patch was applied. So I'll close this for now.
The test script was added as https://github.com/samv/Set- Object/commit/87db8556377dc61aeafbf82e4862b94549cd4cb9