develooper Front page | perl.perl5.porters | Postings from May 2003

Re: Seg fault in dying from XS

Thread Previous | Thread Next
From:
Dave Rolsky
Date:
May 26, 2003 20:34
Subject:
Re: Seg fault in dying from XS
Message ID:
Pine.LNX.4.53.0305262232190.5551@urth.org
On Mon, 26 May 2003, Nicholas Clark wrote:

> On 5.6.1 Doesn't look like a SEGV from here.
>
> ==20933== Memcheck, a.k.a. Valgrind, a memory error detector for x86-linux.
> ==20933== Copyright (C) 2002, and GNU GPL'd, by Julian Seward.
> ==20933== Using valgrind-1.9.6, a program instrumentation system for x86-linux.
> ==20933== Copyright (C) 2000-2002, and GNU GPL'd, by Julian Seward.
> ==20933== Estimated CPU clock rate is 1545 MHz
> ==20933== For more details, rerun with: -v
> ==20933==
> Using /home/nick/Params/Validate/blib
> Using /home/nick/Params/Validate/blib
> Checking...
> Will fail at bug.pl line 8.
> Checking eval at bug.pl line 8.
> Ref looks okay at bug.pl line 8.
> ==20933==
> ==20933== ERROR SUMMARY: 0 errors from 0 contexts (suppressed: 0 from 0)
> ==20933== malloc/free: in use at exit: 405518 bytes in 8761 blocks.
> ==20933== malloc/free: 17825 allocs, 9064 frees, 8529260 bytes allocated.
> ==20933== For a detailed leak analysis,  rerun with: --leak-check=yes
> ==20933== For counts of detected errors, rerun with: -v
>
> Looks like this die:
>
>
> > 	    if (SvROK(ERRSV)) {
> > 		warn("Ref looks okay");
> > 		croak(Nullch);
> > 	    }
> > 	}
>
>
> However, 5.8.0 does something different:
>
> $ /usr/local/perl5.8.0/bin/perl5.8.0 bug.pl
> Checking...
> Will fail at bug.pl line 8.
> Checking eval at bug.pl line 8.
> Ref looks okay at bug.pl line 8.
> main=HASH(0x814a600)
>
> There's no newline at the end of that last line.

For reference, I've tested this quite a bit and it works fine under 5.8.0,
but 5.6.1.

In _some_ cases, 5.6.1 appears to be ok.  In others it dies.

Why?  I don't know.

The "croak(Nullch)" idiom is documented perlapi, so that's why I'm using
it.


-dave

/*=======================
House Absolute Consulting
www.houseabsolute.com
=======================*/

Thread Previous | Thread Next


nntp.perl.org: Perl Programming lists via nntp and http.
Comments to Ask Bjørn Hansen at ask@perl.org | Group listing | About