Skip Menu |

This queue is for tickets about the Test-Refcount CPAN distribution.

Report information
The Basics
Id: 74460
Status: rejected
Priority: 0/
Queue: Test-Refcount

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

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



Subject: t/01count.t - test 5 fails with 2 instead of 1 ref, then segfaults
The problem happens when Devel-FindRef is available (v1.422), and only on i586. The build environment is Debian_6.0 at OpenSUSE build system (OBS) at https://build.opensuse.org
From: ppisar [...] redhat.com
Dne Pá 27.led.2012 17:38:11, https://www.google.com/accounts/o8/id?id=AItOawkyOHx--RP0sCuxSqimRLgFJ_YPC6QRWZk napsal(a): Show quoted text
> The problem happens when Devel-FindRef is available (v1.422), and only > on i586. > > The build environment is Debian_6.0 at OpenSUSE build system (OBS) at > https://build.opensuse.org
I can see this problem on any 32-bit platform (x86, PPC, s390). I can confirm it passes on 64-bit platforms (amd64, PPC64). I guess the problem is in Devel-FindRef. Devel-FindRefs tests try to load the module only.
From: ppisar [...] redhat.com
It segfaults in: 0xb7ff4a10 in XS_Devel__FindRef_find_ (my_perl=0x804b008, cv=0x819faa0) at FindRef.xs:217 217 if (GvCV (sv) == (CV *)targ) res_gv ('&'); It dereferences invalid pointer sv (= 0xb). I tried to minimize the test case, but without a luck. Calling Devel::FindRef only is fine. Minimal crashing script is attached. There is something bad. E.g. removing last letter `n' from `...actually prin' comment disappears the segfault.
Subject: segfault.t
#!/usr/bin/perl -w use strict; use Test::Builder::Tester tests => 5 - 0; use Test::Refcount; use constant HAVE_DEVEL_FINDREF => eval { require Devel::FindRef }; my $anon = []; test_out( "ok 1 - anon ARRAY ref" ); is_refcount( $anon, 1, 'anon ARRAY ref' ); test_test( "anon ARRAY ref succeeds" ); test_out( "not ok 1 - not ref" ); test_fail( +2 ); test_err( "# expected a reference, was not given one" ); is_refcount( "hello", 1, 'not ref' ); test_test( "not ref fails" ); my $object = bless {}, "Some::Class"; test_out( "ok 1 - object" ); is_refcount( $object, 1, 'object' ); test_test( "normal object succeeds" ); my $newref = $object; test_out( "ok 1 - two refs" ); is_refcount( $object, 2, 'two refs' ); test_test( "two refs to object succeeds" ); test_out( "not ok 1 - one ref" ); test_fail( +3 ); test_err( "#" ); test_err( "#" ) if HAVE_DEVEL_FINDREF; test_err( qr/(?:^#.*\n){1,}/m ) if HAVE_DEVEL_FINDREF; # Don't be sensitive on what Devel::FindRef actually prin is_refcount( $object, 1, 'one ref' );
From: ppisar [...] redhat.com
As Petr Pisar diagnosed, the bug is not in Test::RefCount but in Devel::FindRef. -- Olivier Mengué - http://perlresume.org/DOLMEN