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

Re: format changes go SEGV

Thread Previous | Thread Next
Nicholas Clark
March 2, 2003 16:19
Re: format changes go SEGV
Message ID:
On Sun, Mar 02, 2003 at 11:06:38AM +0000, Nicholas Clark wrote:
> This is just a heads up because I don't have time right now to investigate
> this further. [I need to have a tutorial written before I start trying to
> present it :-) ]
> It looks like recent changes to the format code can cause SEGVs:

My apologies. I've been accusing the wrong patches. It's actually because
my /usr/local/bin/perl is built with -DPERL_COPY_ON_WRITE

The recent UTF8 patches are entirely innocent.

> I've no idea what dprofpp is doing, but clearly it's doing something that's
> not in a regression test.

Well, that bit of my original message is still Vail.

I've tried putting

    if (SvIsCOW(tmpForm))
	sv_force_normal_flags(tmpForm, 0);

near the start of pp_formline but that doesn't solve it. The SEGV is:

0x80f5ab9 in Perl_pp_formline () at pp_ctl.c:605
605                     if ( !((*t++ = *s++) & ~31) )
(gdb) print t
$1 = 0x81d627e ""
(gdb) print s
$2 = 0x81ee000 <Error reading address 0x81ee000: Bad address>

which is in this loop:

	    while (arg--) {
#ifdef EBCDIC
		int ch = *t++ = *s++;
		if (iscntrl(ch))
		if ( !((*t++ = *s++) & ~31) )
		    t[-1] = ' ';

I can't easily work out how it's all screwed up as calling Perl_dump_sv
on tmpForm causes a SEGV within the called routine. I think I'm going to
go to bed instead.

Nicholas Clark

Thread Previous | Thread Next Perl Programming lists via nntp and http.
Comments to Ask Bjørn Hansen at | Group listing | About