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

Re: odd (or not so odd?) segmentation fault in 5.8.0

Thread Previous
From:
Rafael Garcia-Suarez
Date:
March 10, 2003 13:06
Subject:
Re: odd (or not so odd?) segmentation fault in 5.8.0
Message ID:
20030310220703.74f631f8.rgarciasuarez@free.fr
Yitzchak Scott-Thoennes wrote:
> This uses the same hack as av_fetch, which won't work if the sv is
> reallocated for another purpose, but should stop the seg faults even
> in that case.

Thanks, applied as #18889.

> --- perl/mg.c.orig	Sat Feb 15 14:33:28 2003
> +++ perl/mg.c	Thu Mar  6 22:48:04 2003
> @@ -131,6 +131,12 @@
>  
>  	if (!(mg->mg_flags & MGf_GSKIP) && vtbl && vtbl->svt_get) {
>  	    CALL_FPTR(vtbl->svt_get)(aTHX_ sv, mg);
> +
> +	    /* guard against sv having been freed */
> +	    if (SvTYPE(sv) == SVTYPEMASK) {
> +		Perl_croak(aTHX_ "Tied variable freed while still in use");
> +	    }
...

Thread Previous


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