You are viewing a plain text version of this content. The canonical link for it is here.
Posted to modperl@perl.apache.org by Bjoern Hoehrmann <de...@gmx.net> on 2005/08/16 19:21:03 UTC

Apache crash when using next outside loop

Hi,

  http://dev.w3.org/cvsweb/validator/httpd/cgi-bin/check v1.437, there
is a callback with 'return; # Don't report this as a normal error.' at
the end of the script. If the return is changed into a "next" it will
crash Apache when running under mod_perl 2.0.1 / Apache/2.0.54 on w2k3
though I could not come up with a smaller test case for this yet. The
callback is called from XS code (see http://spo.sf.net/), basically

    dSP;
    ENTER;
    SAVETMPS;
    PUSHMARK(SP);
    XPUSHs(m_handler);
    XPUSHs(hv ? sv_2mortal(newRV_noinc((SV*)hv)) : &PL_sv_undef);
    PUTBACK;
    call_method(name, G_DISCARD | G_SCALAR | G_EVAL);
    SPAGAIN;
    if (SvTRUE(ERRSV))
    {
        m_egp->halt();
        POPs;
    }
    PUTBACK;
    FREETMPS;
    LEAVE;

Is this crash something I should worry about (as the author of most
code involved)? Perhaps there is some subtle bug in the code above,
but it's also possible that this is a bug in other code, maybe some-
one wants to investigate this further... I would also have expected
that Perl reports `Can't "next" outside a loop block` some time when
processing this code but I did not see anything like that...

regards,
-- 
Björn Höhrmann · mailto:bjoern@hoehrmann.de · http://bjoern.hoehrmann.de
Weinh. Str. 22 · Telefon: +49(0)621/4309674 · http://www.bjoernsworld.de
68309 Mannheim · PGP Pub. KeyID: 0xA4357E78 · http://www.websitedev.de/