Skip Menu |

This queue is for tickets about the Apache-Test CPAN distribution.

Report information
The Basics
Id: 22748
Status: resolved
Priority: 0/
Queue: Apache-Test

People
Owner: pgollucci [...] p6m7g8.com
Requestors: mschwern [...] cpan.org
Cc:
AdminCc:

Bug Information
Severity: Normal
Broken in: 1.28
Fixed in: (no value)



Subject: OS X default config does not load mod_env
Its hard to believe but the default OS X Apache does not have mod_env loaded. This causes the SetEnv in extra.conf to be a syntax error. /usr/sbin/httpd -d /private/var/local/cpan_shell/build/Apache-Test-1.28/t -f /private/var/local/cpan_shell/build/Apache-Test-1.28/t/conf/httpd.conf -D APACHE1 -D PERL_USEITHREADS using Apache/1.3.33 waiting 60 seconds for server to start: .Syntax error on line 52 of /private/var/local/cpan_shell/build/Apache-Test-1.28/t/conf/extra.conf: Invalid command 'SetEnv', perhaps mis-spelled or defined by a module not included in the server configuration I patched in code to load mod_env and got test failures. 1 windhund /private/var/local/cpan_shell/build/Apache-Test-1.28$ make test /usr/local/bin/perl -Iblib/arch -Iblib/lib \ t/TEST -clean APACHE_TEST_GROUP= APACHE_TEST_HTTPD= APACHE_TEST_PORT= APACHE_TEST_USER= APACHE_TEST_APXS= \ /usr/local/bin/perl -Iblib/arch -Iblib/lib \ t/TEST -bugreport -verbose=0 /usr/sbin/httpd -d /private/var/local/cpan_shell/build/Apache-Test-1.28/t -f /private/var/local/cpan_shell/build/Apache-Test-1.28/t/conf/httpd.conf -D APACHE1 -D PERL_USEITHREADS using Apache/1.3.33 waiting 60 seconds for server to start: . waiting 60 seconds for server to start: ok (waited 0 secs) server localhost:8529 started t/bad_coding.............ok t/cookies................# Failed test 1 in t/cookies.t at line 17 t/cookies................NOK 1/2# Failed test 2 in t/cookies.t at line 18 t/cookies................FAILED tests 1-2 Failed 2/2 tests, 0.00% okay t/next_available_port....# Test 1 got: "<!DOCTYPE HTML PUBLIC \"-//IETF//DTD HTML 2.0//EN\">\n<HTML><HEAD>\n<TITLE>404 Not Found</TITLE>\n</HEAD><BODY>\n<H1>Not Found</H1>\nThe requested URL /cgi-bin/next_available_port.pl was not found on this server.<P>\n</BODY></HTML>\n" (t/next_available_port.t at line 15) # Expected: "(?-xism:^\\d+$)" (next available port number) t/next_available_port....FAILED test 1 Failed 1/1 tests, 0.00% okay t/ping...................ok t/redirect...............ok t/request................ok Failed Test Stat Wstat Total Fail List of Failed ------------------------------------------------------------------------------- t/cookies.t 2 2 1-2 t/next_available_port.t 1 1 1 Failed 2/6 test scripts. 3/22 subtests failed. Files=6, Tests=22, 3 wallclock secs ( 2.07 cusr + 0.54 csys = 2.61 CPU) Failed 2/6 test programs. 3/22 subtests failed. [warning] server localhost:8529 shutdown [ error] error running tests (please examine t/logs/error_log) +-----------------------------------------------------+ | To report problems please refer to the SUPPORT file | +-----------------------------------------------------+ make: *** [run_tests] Error 1 $ perl -V Summary of my perl5 (revision 5 version 8 subversion 8) configuration: Platform: osname=darwin, osvers=8.8.1, archname=darwin-thread-multi-2level uname='darwin windhund.local 8.8.1 darwin kernel version 8.8.1: mon sep 25 19:42:00 pdt 2006; root:xnu-792.13.8.obj~1release_i386 i386 i386 macbook1,1 darwin ' config_args='-Dprefix=/usr/local/perl/5.8.8 -Duseithreads -Dccflags=-I/sw/include -Dldflags=-L/sw/lib -Dperladmin=schwern@pobox.com -Dcf_email=schwern@pobox.com -Dmyhostname=windhund -Dmydomain=.schwern.org -Dprivlib=/usr/local/perl/5.8.8/lib -Dsiteprefix=/usr/local -Dsitelib=/usr/local/lib/site_perl -Dlibpth=/usr/local/lib /sw/lib /opt/local/lib /usr/lib -Dnetdb_host_type=const char * -Dnetdb_hlen_type=socklen_t -Uinstallusrbinperl' hint=recommended, useposix=true, d_sigaction=define usethreads=define use5005threads=undef useithreads=define usemultiplicity=define useperlio=define d_sfio=undef uselargefiles=define usesocks=undef use64bitint=undef use64bitall=undef uselongdouble=undef usemymalloc=n, bincompat5005=undef Compiler: cc='cc', ccflags ='-I/sw/include -fno-common -DPERL_DARWIN -no-cpp-precomp -fno-strict-aliasing -pipe -Wdeclaration-after-statement -I/opt/local/include', optimize='-O3', cppflags='-no-cpp-precomp -I/sw/include -fno-common -DPERL_DARWIN -no-cpp-precomp -fno-strict-aliasing -pipe -Wdeclaration-after-statement -I/opt/local/include' ccversion='', gccversion='4.0.1 (Apple Computer, Inc. build 5363)', gccosandvers='' intsize=4, longsize=4, ptrsize=4, doublesize=8, byteorder=1234 d_longlong=define, longlongsize=8, d_longdbl=define, longdblsize=16 ivtype='long', ivsize=4, nvtype='double', nvsize=8, Off_t='off_t', lseeksize=8 alignbytes=8, prototype=define Linker and Libraries: ld='env MACOSX_DEPLOYMENT_TARGET=10.3 cc', ldflags ='-L/sw/lib -L/usr/local/lib -L/opt/local/lib' libpth=/usr/local/lib /sw/lib /opt/local/lib /usr/lib libs=-lgdbm -ldbm -ldl -lm -lc perllibs=-ldl -lm -lc libc=/usr/lib/libc.dylib, so=dylib, useshrplib=false, libperl=libperl.a gnulibc_version='' Dynamic Linking: dlsrc=dl_dlopen.xs, dlext=bundle, d_dlsymun=undef, ccdlflags=' ' cccdlflags=' ', lddlflags='-L/sw/lib -bundle -undefined dynamic_lookup -L/usr/local/lib -L/opt/local/lib' Characteristics of this binary (from libperl): Compile-time options: MULTIPLICITY PERL_IMPLICIT_CONTEXT PERL_MALLOC_WRAP USE_ITHREADS USE_LARGE_FILES USE_PERLIO USE_REENTRANT_API Built under darwin Compiled at Oct 14 2006 18:50:36 %ENV: PERL5LIB="/sw/lib/perl5:/sw/lib/perl5/darwin" @INC: /sw/lib/perl5 /sw/lib/perl5/darwin /usr/local/perl/5.8.8/lib/darwin-thread-multi-2level /usr/local/perl/5.8.8/lib /usr/local/lib/site_perl/5.8/darwin-thread-multi-2level /usr/local/lib/site_perl /usr/local/lib/site_perl .
------------------------------------------------------------------------ r383939 | geoff | 2006-03-07 09:47:42 -0800 (Tue, 07 Mar 2006) | 3 lines wrap SetEnv calls with <IfModule mod_env.c> http://rt.cpan.org/Ticket/Display.html?id=18039 When I roll Apache-Test 1.29-RC2 Thursday night, can you double check Thanks.
Subject: Re: [rt.cpan.org #22748] OS X default config does not load mod_env
Date: Wed, 01 Nov 2006 18:33:37 -0500
To: bug-Apache-Test [...] rt.cpan.org
From: Michael G Schwern <schwern [...] gmail.com>
Philip M. Gollucci via RT wrote: Show quoted text
> <URL: http://rt.cpan.org/Ticket/Display.html?id=22748 > > > ------------------------------------------------------------------------ > r383939 | geoff | 2006-03-07 09:47:42 -0800 (Tue, 07 Mar 2006) | 3 lines > > wrap SetEnv calls with <IfModule mod_env.c> > http://rt.cpan.org/Ticket/Display.html?id=18039 > > > > When I roll Apache-Test 1.29-RC2 Thursday night, can you double check > Thanks.
I just checked out the latest version from SVN trunk and its still a little explodey. I assume what's happening is simply wrapping "SetEnv NextAvailablePort" means that environment variable isn't there for the next_available_port test. /usr/local/bin/perl -Iblib/arch -Iblib/lib \ t/TEST -clean APACHE_TEST_GROUP= APACHE_TEST_HTTPD= APACHE_TEST_PORT= APACHE_TEST_USER= APACHE_TEST_APXS= \ /usr/local/bin/perl -Iblib/arch -Iblib/lib \ t/TEST -bugreport -verbose=0 /usr/sbin/httpd -d /usr/local/src/CPAN/Apache-Test-trunk/t -f /usr/local/src/CPAN/Apache-Test-trunk/t/conf/httpd.conf -D APACHE1 -D PERL_USEITHREADS using Apache/1.3.33 waiting 60 seconds for server to start: . waiting 60 seconds for server to start: ok (waited 0 secs) server localhost:8529 started [ info] adding source lib /usr/local/src/CPAN/Apache-Test-trunk/lib to @INC [ info] adding source lib /usr/local/src/CPAN/Apache-Test-trunk/lib to @INC [ info] adding source lib /usr/local/src/CPAN/Apache-Test-trunk/lib to @INC t/alltest/all............skipped all skipped: testing all.t t/alltest2/all...........skipped all skipped: testing more than one all.t t/bad_coding.............ok t/cookies................ok t/more/all...............skipped all skipped: cannot find module 'mod_perl.c' t/next_available_port....# Test 1 got: "" (t/next_available_port.t at line 15) t/next_available_port....NOK 1/1# Expected: "(?-xism:^\\d+$)" (next available port number) t/next_available_port....FAILED test 1 Failed 1/1 tests, 0.00% okay t/ping...................ok t/redirect...............ok t/request................ok Failed Test Stat Wstat Total Fail List of Failed ------------------------------------------------------------------------------- t/next_available_port.t 1 1 1 3 tests skipped. Failed 1/9 test scripts. 1/22 subtests failed. Files=9, Tests=22, 4 wallclock secs ( 2.98 cusr + 0.73 csys = 3.71 CPU) Failed 1/9 test programs. 1/22 subtests failed. [warning] server localhost:8529 shutdown [ error] error running tests (please examine t/logs/error_log) +-----------------------------------------------------+ | To report problems please refer to the SUPPORT file | +-----------------------------------------------------+ make: *** [run_tests] Error 1
From: GEOFF [...] cpan.org
Show quoted text
> I just checked out the latest version from SVN trunk and its still a > little explodey. I assume what's happening is simply wrapping > "SetEnv NextAvailablePort" means that environment variable isn't > there for the next_available_port test.
Show quoted text
> Failed Test Stat Wstat Total Fail List of Failed >
------------------------------------------------------------------------------- Show quoted text
> t/next_available_port.t 1 1 1
that test will need something like plan tests => 1, need_module('env'); or somesuch, in addition to the <IfModule> changes. bad osx for not including mod_env - that's a staple module for most people. no cookie. --Geoff
Hmmm... I'm baffeled. uname -sr FreeBSD 7.0-CURRENT ./httpd -v Server version: Apache/1.3.37 (Unix) Server built: Nov 3 2006 00:10:44 ./httpd -l Compiled-in modules: http_core.c mod_so.c grep mod_env httpd.conf #LoadModule env_module libexec/mod_env.so #AddModule mod_env.c svn info . | egrep 'URL|Revision' URL: https://svn.apache.org/repos/asf/perl/Apache-Test/trunk Revision: 470692 perl -V | head -1 Summary of my perl5 (revision 5 version 9 subversion 5 patch 29166) configuration: perl Makefile.PL -httpd /home/pgollucci/dev/software/freebsd-7.0-current/3.4.6/httpd/1.3.37-dso/bin/httpd make test server localhost:8529 started [ info] adding source lib /usr/home/pgollucci/dev/repos/asf/perl/Apache-Test/trunk/lib to @INC [ info] adding source lib /usr/home/pgollucci/dev/repos/asf/perl/Apache-Test/trunk/lib to @INC [ info] adding source lib /usr/home/pgollucci/dev/repos/asf/perl/Apache-Test/trunk/lib to @INC t/alltest/all............skipped all skipped: testing all.t t/alltest2/all...........skipped all skipped: testing more than one all.t t/bad_coding.............ok t/cookies................ok t/more/01testpm..........ok t/more/02testmore........ok t/more/03testpm..........ok t/more/04testmore........ok t/next_available_port....skipped all skipped: cannot find module 'env' t/ping...................ok t/redirect...............ok t/request................ok All tests successful, 3 tests skipped. Files=12, Tests=27, 90 wallclock secs ( 8.62 cusr + 1.04 csys = 9.66 CPU) [warning] server localhost:8529 shutdown Also, grep env next_available_port.t plan tests => 1, need need_cgi, need_module('env'); is already here. maybe a ./t/TEST -verbose t/next_available_port. ?
http://svn.apache.org/viewvc?view=rev&revision=383939 mean to say that both the IfModule and need_() were added by geoff here.
Subject: Re: [rt.cpan.org #22748] OS X default config does not load mod_env
Date: Fri, 03 Nov 2006 07:38:52 -0500
To: bug-Apache-Test [...] rt.cpan.org
From: Michael G Schwern <schwern [...] gmail.com>
Philip M. Gollucci via RT wrote: Show quoted text
> maybe a ./t/TEST -verbose t/next_available_port.
0 windhund /usr/local/src/CPAN/Apache-Test-trunk$ ./t/TEST -verbose t/next_available_port.t /usr/sbin/httpd -d /usr/local/src/CPAN/Apache-Test-trunk/t -f /usr/local/src/CPAN/Apache-Test-trunk/t/conf/httpd.conf -D APACHE1 -D PERL_USEITHREADS using Apache/1.3.33 waiting 60 seconds for server to start: . waiting 60 seconds for server to start: ok (waited 0 secs) server localhost:8529 started t/next_available_port....1..1 # Running under perl version 5.008008 for darwin # Current time local: Fri Nov 3 07:37:13 2006 # Current time GMT: Fri Nov 3 12:37:13 2006 # Using Test.pm version 1.25 # Using Apache/Test.pm version 1.29 # Test 1 got: "" (t/next_available_port.t at line 15) not ok 1 # Expected: "(?-xism:^\\d+$)" (next available port number) FAILED test 1 Failed 1/1 tests, 0.00% okay Failed Test Stat Wstat Total Fail List of Failed ------------------------------------------------------------------------------- t/next_available_port.t 1 1 1 Failed 1/1 test scripts. 1/1 subtests failed. Files=1, Tests=1, 1 wallclock secs ( 0.34 cusr + 0.10 csys = 0.44 CPU) Failed 1/1 test programs. 1/1 subtests failed. [warning] server localhost:8529 shutdown [ error] error running tests (please examine t/logs/error_log) And here's t/logs/error_log [Fri Nov 3 07:22:02 2006] [debug] mod_bonjour.c(1455): mod_bonjour: Module init count=1 pid=14151. [Fri Nov 3 07:22:02 2006] [debug] mod_bonjour.c(1455): mod_bonjour: Module init count=2 pid=14152. [Fri Nov 3 07:22:02 2006] [notice] Apache/1.3.33 (Darwin) configured -- resumin g normal operations [Fri Nov 3 07:22:02 2006] [info] Server built: Jan 13 2006 08:49:59 [Fri Nov 3 07:22:02 2006] [notice] Accept mutex: flock (Default: flock) [Fri Nov 3 07:22:08 2006] [info] removed PID file /usr/local/src/CPAN/Apache-Te st-trunk/t/logs/httpd.pid (pid=14152) [Fri Nov 3 07:22:08 2006] [notice] caught SIGTERM, shutting down [Fri Nov 3 07:37:12 2006] [debug] mod_bonjour.c(1455): mod_bonjour: Module init count=1 pid=14284. [Fri Nov 3 07:37:12 2006] [debug] mod_bonjour.c(1455): mod_bonjour: Module init count=2 pid=14285. [Fri Nov 3 07:37:12 2006] [notice] Apache/1.3.33 (Darwin) configured -- resumin g normal operations [Fri Nov 3 07:37:12 2006] [info] Server built: Jan 13 2006 08:49:59 [Fri Nov 3 07:37:12 2006] [notice] Accept mutex: flock (Default: flock) [Fri Nov 3 07:37:14 2006] [info] removed PID file /usr/local/src/CPAN/Apache-Te st-trunk/t/logs/httpd.pid (pid=14285) [Fri Nov 3 07:37:14 2006] [notice] caught SIGTERM, shutting down And access_log 127.0.0.1 - - [03/Nov/2006:07:22:03 -0500] "GET /index.html HTTP/1.0" 200 357 127.0.0.1 - - [03/Nov/2006:07:22:06 -0500] "GET /cgi-bin/cookies.pl HTTP/1.0" 20 0 3 127.0.0.1 - - [03/Nov/2006:07:22:06 -0500] "GET /cgi-bin/cookies.pl HTTP/1.0" 20 0 6 127.0.0.1 - - [03/Nov/2006:07:22:07 -0500] "GET /cgi-bin/next_available_port.pl HTTP/1.0" 200 0 127.0.0.1 - - [03/Nov/2006:07:22:08 -0500] "GET /redirect HTTP/1.0" 302 208 127.0.0.1 - - [03/Nov/2006:07:22:08 -0500] "GET /redirect HTTP/1.0" 302 208 127.0.0.1 - - [03/Nov/2006:07:22:08 -0500] "GET /redirect HTTP/1.0" 302 208 127.0.0.1 - - [03/Nov/2006:07:22:08 -0500] "GET /index.html HTTP/1.0" 200 357 127.0.0.1 - - [03/Nov/2006:07:22:08 -0500] "GET /index.html HTTP/1.0" 200 357 127.0.0.1 - - [03/Nov/2006:07:22:08 -0500] "GET /index.html HTTP/1.0" 200 357 127.0.0.1 - - [03/Nov/2006:07:22:08 -0500] "GET /index.html HTTP/1.0" 200 357 127.0.0.1 - - [03/Nov/2006:07:22:08 -0500] "HEAD /index.html HTTP/1.0" 200 0 127.0.0.1 - - [03/Nov/2006:07:22:08 -0500] "HEAD /index.html HTTP/1.0" 200 0 127.0.0.1 - - [03/Nov/2006:07:22:08 -0500] "HEAD /index.html HTTP/1.0" 200 0 127.0.0.1 - - [03/Nov/2006:07:22:08 -0500] "GET /index.html HTTP/1.0" 200 357 127.0.0.1 - - [03/Nov/2006:07:22:08 -0500] "GET /index.html HTTP/1.0" 200 357 127.0.0.1 - - [03/Nov/2006:07:37:13 -0500] "GET /index.html HTTP/1.0" 200 357 127.0.0.1 - - [03/Nov/2006:07:37:14 -0500] "GET /cgi-bin/next_available_port.pl HTTP/1.0" 200 0
CC: bug-Apache-Test [...] rt.cpan.org
Subject: Re: [rt.cpan.org #22748] OS X default config does not load mod_env
Date: Fri, 03 Nov 2006 08:08:49 -0500
From: Michael G Schwern <schwern [...] gmail.com>
Found yer problem. 0 windhund ~$ perl -Menv -e 1 0 windhund ~$ Case-insensitive file system + ambiguous function. need_module("env") will look for both the Apache mod_env.c and the Perl module env.pm. On a case insensitive file system "require env" will happily load Env.pm. The checking of Apache modules and Perl modules probably should not be mashed into one function. I would split them into need_perl_module() and need_apache_module(). Or the shorter need_pm() and need_am(). I'd also recommend deprecating the "prefix 'mod_' and postfix '.c'" heuristic on need_module(). It invites namespace collisions between Apache and Perl even on case-sensitive file systems all to save 6 characters.
On Fri Nov 03 08:09:44 2006, schwern@pobox.com wrote: Show quoted text
> Found yer problem. > > 0 windhund ~$ perl -Menv -e 1 > 0 windhund ~$ > > Case-insensitive file system + ambiguous function. > > need_module("env") will look for both the Apache mod_env.c and the > Perl module env.pm. On a case insensitive file system "require > env" will happily load Env.pm.
ugh. Show quoted text
> > The checking of Apache modules and Perl modules probably should not be > mashed into one function. I would split them into > need_perl_module() and need_apache_module(). Or the shorter > need_pm() and need_am().
that's unlikely for historical reasons. it's hard to undo some things :) but it's not the first time we've run across this. in fact, my standard advice is to need_module('mod_perl.c') precisely because if you don't spell it out need_module() will load mod_perl.pm, and having that in %INC isn't the same as having it loaded in your httpd.conf. Show quoted text
> > I'd also recommend deprecating the "prefix 'mod_' and postfix '.c'" > heuristic on need_module(). It invites namespace collisions > between Apache and Perl even on case-sensitive file systems all to > save 6 characters.
not that I don't agree, but the design of that function is from a legacy long ago, and it's been that way since 2000 at least iirc, so pulling it apart now might not be all that easy. but at any rate, I'm sorry this caused you trouble, and thanks for pinning it down. --Geoff
On Fri Nov 03 08:58:17 2006, GEOFF wrote: Show quoted text
> > The checking of Apache modules and Perl modules probably should not be > > mashed into one function. I would split them into > > need_perl_module() and need_apache_module(). Or the shorter > > need_pm() and need_am().
> > that's unlikely for historical reasons. it's hard to undo some things :)
You can leave need_module() alone and just deprecate it. Show quoted text
> but it's not the first time we've run across this. in fact, my standard > advice is to > > need_module('mod_perl.c') > > precisely because if you don't spell it out need_module() will load > mod_perl.pm, and having that in %INC isn't the same as having it loaded > in your httpd.conf.
Perhaps that should go into the docs for need_module? Show quoted text
> > I'd also recommend deprecating the "prefix 'mod_' and postfix '.c'" > > heuristic on need_module(). It invites namespace collisions > > between Apache and Perl even on case-sensitive file systems all to > > save 6 characters.
> > not that I don't agree, but the design of that function is from a legacy > long ago, and it's been that way since 2000 at least iirc, so pulling it > apart now might not be all that easy. > > but at any rate, I'm sorry this caused you trouble, and thanks for > pinning it down.
Perhaps a warning when it enters the "prefix mod_, postfix .c" logic? I did a google code search for "need_module(" and came up with a few more questionable uses out there. http://search.cpan.org/src/OPI/Apache2-Translation-0.08/t/011directives.t need_module('alias') and 'cgi' Apache-IncludeHook-2.00_05/t/03perl-nada.t mod_perl-2.0.0/t/modules/include.t need_module('include') (yes, there's an Include.pm on CPAN)
Fixed in svn. Will be in 1.29 Thanks All.