Re: panic: attempt to copy freed scalar caused by calling cgi->param with TryCatch since perl 5.19.7

Michael Schout <[email protected]>
Newsgroups gmane.comp.apache.mod-perl
Message-ID <[email protected]>
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 PPAddr.so[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://github.com/mschout/modperl-trycatch-bug

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
127.0.0.1:60632] panic: attempt to copy freed scalar 7f4e0971ec80 to
7f4e0971eb30 at
/home/vagrant/modperl-trycatch-bug/blib/lib/Apache/TryCatch.pm line 20.\n


Regards,
Michael Schout
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.