perl-modperl mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Michael Schout <>
Subject Re: panic: attempt to copy freed scalar caused by calling cgi->param with TryCatch since perl 5.19.7
Date Thu, 17 Sep 2015 18:13:54 GMT
On 9/17/15 8:13 AM, Vincent Veyron wrote:

> Sep 17 15:08:31 eeepc kernel: [ 7737.194398] traps: /usr/sbin/apach[8769] general protection
ip:7f1199d45d70 sp:7ffe7e3dc410 error:0 in[7f1199d45000+2000]

I saw these first as well on debian jessie.  I fixed it by switching
from mpm-event to mpm-prefork.

I will say that I find debian's packaging to makes it pretty difficult
with Apache::Test.  Apache::Test fails to generate a working config
because it does not source the Include files in
/etc/apache2/mods-enabled (among other things).  I much prefer to just
build apache from scratch, which also eliminates the possibility that a
vendor applied patch is causing any problems.

Here is how I produced the panic on jessie, using nothing but vendor
packages if you *really* do want to reproduce this:

In fresh debian 8/jessie do this (I used a vagrant box):

sudo apt-get update

sudo apt-get install apache2-mpm-prefork libapache2-request-perl \
	libapache2-mod-perl2 libapache2-mod-apreq2 \
	apache2-dev git libtrycatch-perl

git clone git://

cd modperl-trycatch-bug

# now we have to jump through several hoops to make Apache::Test work

# make symlinks that apache2.conf needs *sigh*
ln -s /etc/apache2/mods-enabled t/mods-enabled
ln -s /etc/apache2/conf-enabled t/conf-enabled

# disable mpm-event and use mpm-prefork instead
cd /etc/apache2/mods-enabled/
sudo rm -f mpm_event.*
sudo ln -s ../mods-available/mpm_prefork.conf mpm_prefork.conf
sudo ln -s ../mods-available/mpm_prefork.load mpm_prefork.load
cd -

# change IncludeOptional to Include
sudo sed -i 's/IncludeOptional/Include/' /etc/apache2/apache2.conf

# need to source apache2 envvars
source /etc/apache2/envvars

# now actually run the test
perl Makefile.PL -apxs /usr/bin/apxs2 \
	-httpd_conf /etc/apache2/apache2.conf

make test

... which fails ...

t/logs/error_log contains:

[Thu Sep 17 20:08:09.333854 2015] [perl:error] [pid 10319] [client] panic: attempt to copy freed scalar 7f4e0971ec80 to
7f4e0971eb30 at
/home/vagrant/modperl-trycatch-bug/blib/lib/Apache/ line 20.\n

Michael Schout

View raw message