Wed, 28 Jun 2006, Jerry D. Hedden wrote:
In threads.xs, the 'die/exit' in the warn handler is 'contained'
using a JMPENV:
/* Check for failure */
if (SvTRUE(ERRSV) && ckWARN_d(WARN_THREADS)) {
oldscope = PL_scopestack_ix;
JMPENV_PUSH(jmp_rc);
if (jmp_rc == 0) {
Perl_warn(aTHX_ "Thread %" UVuf " terminated
abnormally:
%" SVf, thread->tid, ERRSV);
while (PL_scopestack_ix oldscope) {
LEAVE;
}
}
JMPENV_PP;
}
Sorry, I'm still very busy and have no time to try this myself, but the
code above looks wrong. You need to do the scope cleanup when my_exit()
has been called, not in the standard code path. Something like:
oldscope = PL_scopestack_ix;
JMPENV_PUSH(rc);
if (rc == 0)
Perl_warn();
else if (rc == 2) {
/* Perl_warn() called my_exit() */
while (PL_scopestack_ix oldscope) {
LEAVE;
}
}
JMPENV_PP;
Cheers,
-Jan