Skip Menu |

This queue is for tickets about the PersistentPerl CPAN distribution.

Report information
The Basics
Id: 16419
Status: open
Priority: 0/
Queue: PersistentPerl

People
Owner: Nobody in particular
Requestors: dan.horne [...] redbone.co.nz
Cc:
AdminCc:

Bug Information
Severity: Important
Broken in: (no value)
Fixed in: (no value)



Subject: memleak test fail on RHEL 4/ CentOS v4
PERPERL_TIMEOUT=300 /usr/local/bin/perl "-MExtUtils::Command::MM" "-e" "test_harness(0, '../blib/lib', '../blib/arch')" t/*.t t/alarm...............ok t/argv................ok t/basic1..............ok t/basic2..............ok t/be_memleak..........ok 1/2 mem usage went from 5852K to 7768K in 1000 runs t/be_memleak..........FAILED test 2 Failed 1/2 tests, 50.00% okay t/begin_block.........ok t/begin_dup...........ok t/cgi_reset...........ok t/chdir...............ok t/detach..............ok t/eagain..............ok t/exit................ok t/group...............ok t/hold_stdio..........ok t/initial_eof.........ok t/killfe..............ok t/maxbackend..........ok t/maxruns.............ok t/misc................ok t/mungefds............ok t/register_cleanup....ok t/setopt..............ok t/sh_bang.............ok t/shutdown............ok t/signal..............ok t/stdin...............ok t/stdio...............ok t/stdio2..............ok t/stdio_close.........ok t/thread..............skipped all skipped: Not running a threaded perl t/timeout.............ok t/touch...............ok t/wrongfd.............ok Failed Test Stat Wstat Total Fail Failed List of Failed ------------------------------------------------------------------------------- t/be_memleak.t 2 1 50.00% 2 1 test skipped. Failed 1/33 test scripts, 96.97% okay. 1/72 subtests failed, 98.61% okay.
similar happens on FreeBSD 6.1/amd64: t/be_memleak..........ok 1/2 mem usage went from 8108K to 11916K in 1000 runs
Subject: memleak test fail on Perl >= 5.8.6
From: banb [...] yahoo.co.jp
I've posted patch against this memleak bug on RT for SpeedyCGI. http://rt.cpan.org/Public/Bug/Display.html?id=13521 PersistentPerl and SpeedyCGI are currently identical, but method names and path names are changed. So I re-created a huge patch for PerPerl (Attached: perperl.patch). In my environment, some test scripts for mod_perperl do not work correctly. Patches for tests also attached (perperl_test.patch). (But this patch for tests may not work on Apache 1 & mod_perl-1)
--- src/perperl_backend_main.c.orig 2003-10-12 13:49:02.000000000 +0900 +++ src/perperl_backend_main.c 2007-03-28 11:24:41.291195701 +0900 @@ -177,4 +177,8 @@ perl_construct(my_perl); +#if defined(PL_use_safe_putenv) || defined(PL_Guse_safe_putenv) + PL_use_safe_putenv = 0; +#endif + #ifdef PERPERL_DEBUG dont_fork = getenv("PERPERL_NOPARENT") != NULL; --- src/mod_persistentperl2.c.orig 2003-10-12 13:48:59.000000000 +0900 +++ src/mod_persistentperl2.c 2007-03-28 11:29:35.260348864 +0900 @@ -341,12 +341,12 @@ apr_size_t len; apr_status_t rv; - APR_BRIGADE_FOREACH(e, bb) { - if (APR_BUCKET_IS_EOS(e)) { - break; - } + /* macro APR_BRIGADE_FOREACH() is deprecated */ + e = APR_BRIGADE_FIRST(bb); + while (e != APR_BRIGADE_SENTINEL(bb) && ! APR_BUCKET_IS_EOS(e)) { rv = apr_bucket_read(e, &buf, &len, APR_BLOCK_READ); if (rv != APR_SUCCESS) { break; } + e = APR_BUCKET_NEXT(e); } } @@ -381,5 +381,5 @@ } - argv0 = apr_filename_of_pathname(r->filename); + argv0 = apr_filepath_name_get(r->filename); nph = !(strncmp(argv0, "nph-", 4)); @@ -437,5 +437,5 @@ ap_log_rerror(APLOG_MARK, APLOG_ERR|APLOG_TOCLIENT, rv, r, "don't know how to spawn child process: %s", - apr_filename_of_pathname(r->filename)); + apr_filepath_name_get(r->filename)); return HTTP_INTERNAL_SERVER_ERROR; } @@ -446,5 +446,5 @@ ap_log_rerror(APLOG_MARK, APLOG_ERR|APLOG_TOCLIENT, rv, r, "couldn't spawn child process: %s", - apr_filename_of_pathname(r->filename)); + apr_filepath_name_get(r->filename)); return HTTP_INTERNAL_SERVER_ERROR; } @@ -466,5 +466,8 @@ } - APR_BRIGADE_FOREACH(bucket, bb) { + /* macro APR_BRIGADE_FOREACH() is deprecated */ + for (bucket = APR_BRIGADE_FIRST(bb); + bucket != APR_BRIGADE_SENTINEL(bb); + bucket = APR_BUCKET_NEXT(bucket)) { const char *data; apr_size_t len; --- perperl/t/scripts/thread.orig 2003-10-12 13:48:51.000000000 +0900 +++ perperl/t/scripts/thread 2007-03-28 11:31:09.653948528 +0900 @@ -5,4 +5,11 @@ use Thread; +BEGIN { + if ($] >= 5.008001 && $Config{useithreads}) { + require threads; + import threads; + } +} + if ($ARGV[0] == 1) { # Just report if threads are available.
--- mod_persistentperl/t/ModTest.pm.orig 2003-10-12 13:48:50.000000000 +0900 +++ mod_persistentperl/t/ModTest.pm 2007-03-28 12:10:32.580874931 +0900 @@ -86,5 +86,7 @@ sub find_httpd { - my $x = `apxs -q SBINDIR` . '/httpd'; + my $x = `apxs -q SBINDIR`; + chomp $x; + $x .= '/httpd'; return -x $x ? $x : 'httpd'; } --- mod_persistentperl/t/mod_perl.t.orig 2003-10-12 13:48:49.000000000 +0900 +++ mod_persistentperl/t/mod_perl.t 2007-03-28 12:17:41.297471527 +0900 @@ -10,8 +10,14 @@ use ModTest; -my $libperl = `apxs -q LIBEXECDIR` . '/libperl.so'; +my $version = `httpd -v` =~ /Apache.2/ ? 2 : 1; +my $libperl = `apxs -q LIBEXECDIR`; +chomp $libperl; + $libperl .= $version > 1 ? '/mod_perl.so' : '/libperl.so'; my $docroot = ModTest::docroot; my $scr = 'perperl/mod_perl'; +my $addmodule = $version > 1 ? '' : 'AddModule mod_perl.c'; +my $registry = $version > 1 ? 'ModPerl::Registry' : 'Apache::Registry'; + ModTest::test_init( 5, @@ -20,9 +26,9 @@ <IfModule !mod_perl.c> LoadModule perl_module $libperl - AddModule mod_perl.c + $addmodule </IfModule> <Directory $docroot/mod_perl> DefaultType perl-script - PerlHandler Apache::Registry + PerlHandler $registry </Directory> " --- mod_persistentperl/t/env.t.orig 2003-10-12 13:48:49.000000000 +0900 +++ mod_persistentperl/t/env.t 2007-03-28 12:21:09.557700123 +0900 @@ -11,9 +11,18 @@ use ModTest; +my $version = `httpd -v` =~ /Apache.2/ ? 2 : 1; +my $moddir = `apxs -q LIBEXECDIR`; +chomp $moddir; +my $addmodule = $version > 1 ? '' : 'AddModule mod_env.c'; + my $scr = 'perperl/env'; -ModTest::test_init(5, [$scr], ' - SetEnv "ENVTEST" "XXX" -'); +ModTest::test_init(5, [$scr], " + <IfModule !mod_env.c> + LoadModule env_module $moddir/mod_env.so + $addmodule + </IfModule> + SetEnv \"ENVTEST\" \"XXX\" +"); print "1..1\n";