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

Re: Seg fault in dying from XS

Thread Previous | Thread Next
From:
Nicholas Clark
Date:
May 26, 2003 15:08
Subject:
Re: Seg fault in dying from XS
Message ID:
20030526230813.H1149@plum.flirble.org
On Mon, May 26, 2003 at 02:41:48PM -0500, Ken Williams wrote:
> Hi,
> 
> Below is a short test case in which I'm calling some callback perl code 
> from XS and using the G_EVAL flag to trap exceptions.  I then call 
> croak(Nullch) to propagate the exception, and I get a segmentation 
> fault.  Does anyone see something wrong with it?  The code is below.  
> I'm running it under perl 5.6.1 on Mac OS X 10.2.6.

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.

No, I don't know what's going on.

Nicholas Clark

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