perl-modperl mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Michael Schout <>
Subject Re: Random segmentation fault
Date Tue, 15 Sep 2015 20:58:47 GMT
Steve, John:

I did a bisect today against perl git, using mod_perl 2.0.9 and apache
2.2.29 to find out where my two issues were caused.  It turns out that
both of my problems, which were:

- panic: attempt to copy freed scalar xxxx to yyyy

and also

- segmentation fault caused by a specific "return" statement

Are *BOTH* caused by the following commit made to perl between 5.19.6
and 5.19.7:

> commit 437e3a7dac994ebace1195549170c81f474d9c20
> Author: Matthew Horsfall <>
> Date:   Wed Dec 11 18:28:21 2013 -0500
>     Optimise out PUSHMARK/RETURN if return is the last statement in a sub.
>     This makes:
>       sub baz { return $cat; }
>     Behave like:
>       sub baz { $cat; }
>     Which is notably faster.

I created a patch that reverses this (at least the change to op.c.. the
other parts of the patch are just new macros, and a test case), then
both of my problems are fixed.

John:  I'd be interested to know if your problem is related.  If
possible, can you build perl with the attached patch applied and see  if
that fixes your segfault also?

This seems to be mod_perl specific.  I have a very
straightforward/minimal test case that causes the "panic" error under
mod_perl, but the same code runs fine under the command line outside of

Michael Schout

View raw message