On Sat, Nov 19, 2005 at 06:48:06PM +0000, Nicholas Clark wrote:

> I can cut the problem down to:

#!./perl -w

BEGIN {
      $SIG{INT} = sub {exit(0)};
      kill 'INT', $$;
}

which gives

==18734== Invalid read of size 4
==18734==    at 0x80CE2D8: S_unwind_handler_stack (mg.c:2826)
==18734==    by 0x810C45C: Perl_leave_scope (scope.c:884)
==18734==    by 0x8109685: Perl_pop_scope (scope.c:94)
==18734==    by 0x806854F: Perl_call_list (perl.c:5135)
==18734==    by 0x809B8DB: Perl_newATTRSUB (op.c:4556)
==18734==    by 0x808DEFE: Perl_yyparse (perly.y:326)
==18734==    by 0x8062EDA: S_parse_body (perl.c:2164)
==18734==    by 0x8061F31: perl_parse (perl.c:1555)
==18734==    by 0x805E9C3: main (perlmain.c:101)
==18734==  Address 0x4FFFDDB4 is just below %esp.  Possibly a bug in GCC/G++
==18734==   v 2.96 or 3.0.X.  To suppress, use: --workaround-gcc296-bugs=yes


It's not a gcc bug. It's a real bug. The only reference to
S_unwind_handler_stack is in

Perl_sighandler:

    /* Max number of items pushed there is 3*n or 4. We cannot fix
       infinity, so we fix 4 (in fact 5): */
    if (flags & 1) {
        PL_savestack_ix += 5;           /* Protect save in progress. */
        SAVEDESTRUCTOR_X(S_unwind_handler_stack, (void*)&flags);
    }

and flags is a local variable in Perl_sighandler, a function which has been
returned from by the time that the scope unwinds
(with that seemingly sane change to op.c)

Nicholas Clark

Reply via email to