Skip Menu |

This queue is for tickets about the Want CPAN distribution.

Report information
The Basics
Id: 68350
Status: open
Priority: 0/
Queue: Want

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

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



Subject: Segfault when using C::R in overloaded operator '>' (5.10.1)
I'm trying to use Contextual::Return in an overloaded operator (using the 'overload' module). The attached file gives a segmentation fault. Contextual::Return 0.003001 Want 0.18 Perl 5.10.1 x86_64-linux-gnu-thread-multi Ubuntu 11.04 -- Olivier Mengué - http://search.cpan.org/~dolmen/ http://github.com/dolmen/
Subject: want.pl
use strict; use warnings; { package X; use Contextual::Return; use overload '>' => \> sub gt { return NUM { "NUM" } STR { "STR" } BOOL { "BOOL" } REF { "REF" } VOID { "VOID" } DEFAULT { "DEFAULT" } } } my $o = bless \my $x, 'X'; #print +($o > 4), "\n"; print +( $o > *STDOUT );
Subject: Re: [rt.cpan.org #68350] Segfault when using C::R in overloaded operator '>' (5.10.1)
Date: Sat, 21 May 2011 23:49:54 +1000
To: bug-Contextual-Return [...] rt.cpan.org
From: Damian Conway <damian [...] conway.org>
Hi Olivier The problem appears to be four levels down in the Want module and is unrelated to Contextual::Return. For example this code (which does not use C::R at all) also segfaults: -----cut----------cut----------cut----------cut----------cut----------cut----- use strict; use warnings; { package X; use overload '<' => \&gt; sub gt { use Want; if (want('BOOL')) { return 1; } } } my $o = bless \my $x, 'X'; print +($o < 4), "\n"; print +( $o < *STDOUT ); -----cut----------cut----------cut----------cut----------cut----------cut----- You should resubmit this report to the Want.pm bug queue. All the best, Damian