On Wed, May 30, 2007 at 06:20:47PM +0100, Nicholas Clark
wrote:
> On Tue, May 29, 2007 at 09:26:54PM -0700, eirik
allverden. no wrote:
>
> Thanks for the report
>
> > eirik blackbox[05:14:50]~$ bleadperl -e 'local
* ;
eval '
> > Segmentation fault
> > eirik blackbox[05:16:50]~$
>
> > It's just blead, as far as I can tell. This runs
just fine in 5.8.8
> > and older releases, as well as in maint (as of a
week ago, at least).
>
> ==10919== Invalid read of size 4
> ==10919== at 0x8107B0D: Perl_sv_setpvn (sv.c:3859)
> ==10919== by 0x81641CD: Perl_create_eval_scope
(pp_ctl.c:3620)
> ==10919== by 0x81641FF: Perl_pp_entertry
(pp_ctl.c:3630)
> ==10919== by 0x80AD2F2: Perl_runops_debug
(dump.c:1920)
> ==10919== Address 0x8 is not stack'd, malloc'd or
(recently) free'd
> ==10919==
> ==10919== ---- Attach to debugger ? ---
[Return/N/n/Y/y/C/c] ---- y
>
> 0x08107b0d in Perl_sv_setpvn (sv=0x0, ptr=0x8254c40
"", len=0) at sv.c:3859
> 3859 SV_CHECK_THINKFIRST_COW_DROP(sv);
> (gdb) up
> #1 0x081641ce in Perl_create_eval_scope (flags=0) at
pp_ctl.c:3620
> 3620 sv_setpvn(ERRSV,"",0);
> (gdb) P PL_errgv
> $1 = (GV *) 0x1bab42c0
>
> (gdb) p *(PL_errgv->sv_u.svu_gp)
> $4 = {gp_sv = 0x0, gp_io = 0x0, gp_cv = 0x0, gp_cvgen =
0, gp_refcnt = 1,
> gp_hv = 0x0, gp_av = 0x0, gp_form = 0x0, gp_egv =
0x1bab42c0, gp_line = 1,
> gp_file_hek = 0x1bac4d64}
>
> so, ERRSV is clearly a NULL pointer. But quite why, I
don't know.
> And whether it's "allowed" to be, I also
don't know.
>
Looking in perl.c, my guess is that it shouldn't be allowed
to be NULL.
PL_errgv is initialized along with the rest of the stash in
S_init_main_stash().
If PL_errgv is NULL, then I'd not be surprised if other
necessary things are
missing as well.
(This is the point Dave M. usually pulls out his wand,
repeating his incantation
mentioning stashes and COPs until my eyes water. Suddenly,
a fix appears.)
Steve Peters
steve fisharerojo.org
|