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.
#!/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' );