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

John Dunlap <[email protected]>
Newsgroups gmane.comp.apache.mod-perl
Message-ID <CAC5eUSvb_zdcTkEqBeMJbFgenzGh8BuLSwWJCPFUuv9yAd4xyg@mail.gmail.com>
I use the Debian apreq package from apt, to install mod_perl, but the rest
of my dependencies I install through cpan
On Sep 16, 2015 9:33 AM, "Michael Schout" <[email protected]> wrote:

> On 9/16/15 7:08 AM, Vincent Veyron wrote:
>
> > I put your test handler on a machine running Debian 8 (jessie), it works
> just fine.
>
> Fails for me on both CentOS 7 and Darwin (OS X 10.10.5). I see you are
> using Apache 2.4 (I was using 2.2).  I tested with Apache 2.4.16 and it
> also fails for me on that as well
>
> Server version: Apache/2.4.16 (Unix)
> Server built:   Sep 16 2015 09:21:11
>
> I built perl myself to rule out vendor applied patches to the perl dist.
> I wonder if one of the many patches debian applies to perl works around
> this issue somehow.  Debian also applies a bunch of patches (18 as of
> current dpkg src) to the mod_perl package.  Maybe one of those works
> around the issue.  I'll sift through those patches and see if any of
> those help.
>
> Are you using debian packages for the CPAN modules at all?  Or did you
> install all CPAN packages using a CPAN client?  Because I also wonder if
> they patched TryCatch, Devel::Declare, or one of its dependencies to
> work around this issue.
>
> Here is the failure on CentOS 7, apache 2.4, perl 5.20.3, mod_perl
> 2.0.9, all built from scratch, no vendor packages used:
>
> [mschout@centos7 modperl-trycatch-bug]$ make test
> /home/mschout/perlbug/bin/perl -Iblib/arch -Iblib/lib \
> t/TEST  -clean
> [warning] setting ulimit to allow core files
> ulimit -c unlimited; /home/mschout/perlbug/bin/perl
> /home/mschout/modperl-trycatch-bug/t/TEST -clean
> APACHE_TEST_APXS= APACHE_TEST_GROUP= APACHE_TEST_HTTPD=
> APACHE_TEST_PORT= APACHE_TEST_USER= \
> /home/mschout/perlbug/bin/perl -Iblib/arch -Iblib/lib \
> t/TEST  -bugreport -verbose=0
> [warning] setting ulimit to allow core files
> ulimit -c unlimited; /home/mschout/perlbug/bin/perl
> /home/mschout/modperl-trycatch-bug/t/TEST -bugreport -verbose=0
> /home/mschout/perlbug/bin/httpd  -d /home/mschout/modperl-trycatch-bug/t
> -f /home/mschout/modperl-trycatch-bug/t/conf/httpd.conf -D APACHE2 -D
> APACHE2_4 -D PERL_USEITHREADS
> using Apache/2.4.16 (prefork MPM)
>
> waiting 60 seconds for server to start: ..
> waiting 60 seconds for server to start: ok (waited 1 secs)
> server localhost:8529 started
> t/crash.t .. Dubious, test returned 2 (wstat 512, 0x200)
> Failed 2/2 subtests
>
> t/logs/error_log
> [Wed Sep 16 09:27:19.394249 2015] [mpm_prefork:notice] [pid 4129]
> AH00163: Apache/2.4.16 (Unix) mod_perl/2.0.9 Perl/v5.20.3 configured --
> resuming normal operations
> [Wed Sep 16 09:27:19.394372 2015] [mpm_prefork:info] [pid 4129] AH00164:
> Server built: Sep 16 2015 09:21:11
> [Wed Sep 16 09:27:19.394381 2015] [core:notice] [pid 4129] AH00094:
> Command line: '/home/mschout/perlbug/bin/httpd -d
> /home/mschout/modperl-trycatch-bug/t -f
> /home/mschout/modperl-trycatch-bug/t/conf/httpd.conf -D APACHE2 -D
> APACHE2_4 -D PERL_USEITHREADS'
> [Wed Sep 16 09:27:19.394386 2015] [mpm_prefork:debug] [pid 4129]
> prefork.c(995): AH00165: Accept mutex: sysvsem (default: sysvsem)
> [Wed Sep 16 09:27:20.246297 2015] [authz_core:debug] [pid 4130]
> mod_authz_core.c(835): [client 127.0.0.1:46738] AH01628: authorization
> result: granted (no directives)
> [Wed Sep 16 09:27:20.498088 2015] [authz_core:debug] [pid 4130]
> mod_authz_core.c(835): [client 127.0.0.1:46739] AH01628: authorization
> result: granted (no directives)
> [Wed Sep 16 09:27:20.500796 2015] [perl:error] [pid 4130] [client
> 127.0.0.1:46739] panic: attempt to copy freed scalar 34259c0 to 3425870
> at /home/mschout/modperl-trycatch-bug/blib/lib/Apache/TryCatch.pm line
> 20.\n
> [Wed Sep 16 09:27:20.526382 2015] [core:info] [pid 4129] AH00096:
> removed PID file /home/mschout/modperl-trycatch-bug/t/logs/httpd.pid
> (pid=4129)
> [Wed Sep 16 09:27:20.526398 2015] [mpm_prefork:notice] [pid 4129]
> AH00169: caught SIGTERM, shutting down
>
>
>  But you are likely not seeing it because one of:
>
> - vendor patches applied by debian packaging team
> - you are using Apache 2.4.  I tested with Apache 2.2.
>
>
> 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.