You are viewing a plain text version of this content. The canonical link for it is here.
Posted to modperl@perl.apache.org by Ken Williams <ke...@mathforum.org> on 2002/04/28 04:41:18 UTC
problems on OS X
Hi,
I used to be able to compile mod_perl pretty easily on Mac OS X, but now
for some reason (upgrades of modules? OS upgrades?) I'm having a lot of
trouble getting past 'make test'. Here's what happens (no matter
whether I compile statically with just EVERYTHING=1, or as a DSO as per
http://david.wheeler.net/osx.html):
====================================================================
[junior:~/Downloads/perl/mod_perl-1.26] ken% make test
cp t/conf/mod_perl_srm.conf t/conf/srm.conf
/usr/local/src/apache_1.3.23/src/httpd -f `pwd`/t/conf/httpd.conf -X -d
`pwd`/t &
httpd listening on port 8529
will write error_log to: t/logs/error_log
letting apache warm up...\c
[Sun Apr 28 12:29:28 2002] [error] Insecure $ENV{PATH} while running
with -T switch at /System/Library/Perl/Cwd.pm line 92.
BEGIN failed--compilation aborted at
/System/Library/Perl/ExtUtils/testlib.pm line 6.
Compilation failed in require at
/Users/ken/Downloads/perl/mod_perl-1.26/t//docs/startup.pl line 9.
BEGIN failed--compilation aborted at
/Users/ken/Downloads/perl/mod_perl-1.26/t//docs/startup.pl line 9.
Compilation failed in require at (eval 1) line 1.
<....>
====================================================================
It's possible that it might have something to do with
ExtUtils::MakeMaker and its seedy friends, because I've been helping
work on that and installing betas from time to time. But I'm not sure
where to start looking at that. I'm currently using EU::MM 5.91_01.
Any suggestions?
-Ken
% uname -a:
Darwin junior 5.4 Darwin Kernel Version 5.4: Wed Apr 10 09:27:47 PDT
2002; root:xnu/xnu-201.19.3.obj~1/RELEASE_PPC Power Macintosh powerpc
Summary of my perl5 (revision 5.0 version 6 subversion 1) configuration:
Platform:
osname=darwin, osvers=5.2, archname=darwin
uname='darwin junior 5.2 darwin kernel version 5.2: fri dec 7
21:39:35 pst 2001; root:xnuxnu-201.14.obj~1release_ppc power macintosh
powerpc '
config_args='-des -Dfirstmakefile=GNUmakefile
-Dldflags=-flat_namespace'
hint=previous, useposix=true, d_sigaction=define
usethreads=undef use5005threads=undef useithreads=undef
usemultiplicity=undef
useperlio=undef d_sfio=undef uselargefiles=define usesocks=undef
use64bitint=undef use64bitall=undef uselongdouble=undef
Compiler:
cc='cc', ccflags ='-pipe -fno-common -DHAS_TELLDIR_PROTOTYPE
-fno-strict-aliasing',
optimize='-O3',
cppflags='-pipe -fno-common -DHAS_TELLDIR_PROTOTYPE
-fno-strict-aliasing'
ccversion='', gccversion='Apple devkit-based CPP 6.02',
gccosandvers=''
intsize=4, longsize=4, ptrsize=4, doublesize=8, byteorder=4321
d_longlong=define, longlongsize=8, d_longdbl=define, longdblsize=8
ivtype='long', ivsize=4, nvtype='double', nvsize=8, Off_t='off_t',
lseeksize=8
alignbytes=8, usemymalloc=n, prototype=define
Linker and Libraries:
ld='cc', ldflags ='-flat_namespace -L/usr/local/lib'
libpth=/usr/local/lib /usr/lib
libs=-lm -lc
perllibs=-lm -lc
libc=/System/Library/Frameworks/System.framework/System, so=dylib,
useshrplib=true, libperl=libperl.dylib
Dynamic Linking:
dlsrc=dl_dyld.xs, dlext=bundle, d_dlsymun=undef, ccdlflags=' '
cccdlflags=' ', lddlflags='-flat_namespace -bundle -undefined
suppress -L/usr/local/lib'
Characteristics of this binary (from libperl):
Compile-time options: USE_LARGE_FILES
Built under darwin
Compiled at 12/31/01 02:02:01
@INC:
/System/Library/Perl/darwin
/System/Library/Perl
/Library/Perl/darwin
/Library/Perl
/Library/Perl
/Network/Library/Perl/darwin
/Network/Library/Perl
/Network/Library/Perl
.
Re: problems on OS X
Posted by Stas Bekman <st...@stason.org>.
Stas Bekman wrote:
> Ken Williams wrote:
...
> Ken, CWD.pm, has always suffered from taint problems. This problem has
> been fixed in the bleadperl, try this patch:
>
> --- /tmp/Cwd.pm Sun Apr 28 11:44:38 2002
> +++ /home/stas/perl.org/perl-5.6.1/lib/Cwd.pm Fri Sep 14 17:09:10 2001
> @@ -89,7 +89,6 @@
> # The 'natural and safe form' for UNIX (pwd may be setuid root)
>
> sub _backtick_pwd {
> - local @ENV{qw(PATH IFS CDPATH ENV BASH_ENV)};
oops, s/^-/+/ here
> my $cwd = `pwd`;
> # `pwd` may fail e.g. if the disk is full
> chomp($cwd) if defined $cwd;
>
> and if it works for you consider submitting it to Sarathy for 5.6.2.
>
> __________________________________________________________________
> Stas Bekman JAm_pH ------> Just Another mod_perl Hacker
> http://stason.org/ mod_perl Guide ---> http://perl.apache.org
> mailto:stas@stason.org http://use.perl.org http://apacheweek.com
> http://modperlbook.org http://apache.org http://ticketmaster.com
>
--
__________________________________________________________________
Stas Bekman JAm_pH ------> Just Another mod_perl Hacker
http://stason.org/ mod_perl Guide ---> http://perl.apache.org
mailto:stas@stason.org http://use.perl.org http://apacheweek.com
http://modperlbook.org http://apache.org http://ticketmaster.com
Re: problems on OS X
Posted by Michael G Schwern <sc...@pobox.com>.
On Mon, Apr 29, 2002 at 12:39:32AM +1000, Ken Williams wrote:
> I sent a message earlier today saying that this patch seems to help
> things, but I just noticed something disturbing. After hand-applying
> this patch to my CWD.pm from 5.6.1, I ran a 'perl Makefile.PL' for a
> different module (Apache::SSI), and it created the Makefile not in the
> current directory, but in my *home* directory! Weird. I don't know why
> it happened yet, but obviously this isn't a good thing.
Likely something passed chdir() an undef or '' which means "chdir to
$ENV{HOME}". Unfortunate shell holdover. Likely the pwd/chdir combination
in eval_in_subdirs().
--- lib/ExtUtils/MakeMaker.pm 24 Apr 2002 05:30:36 -0000 1.44
+++ lib/ExtUtils/MakeMaker.pm 29 Apr 2002 04:06:20 -0000
@@ -79,7 +79,8 @@
sub eval_in_subdirs {
my($self) = @_;
use Cwd qw(cwd abs_path);
- my $pwd = cwd();
+ my $pwd = cwd() || die "Can't figure out your cwd!";
+
local @INC = map eval {abs_path($_) if -e} || $_, @INC;
push @INC, '.'; # '.' has to always be at the end of @INC
--
Michael G. Schwern <sc...@pobox.com> http://www.pobox.com/~schwern/
Perl Quality Assurance <pe...@perl.org> Kwalitee Is Job One
You're the sickest teenager I've ever set my wallet on.
Re: problems on OS X
Posted by Stas Bekman <st...@stason.org>.
Ken Williams wrote:
>
> On Sunday, April 28, 2002, at 04:48 PM, Stas Bekman wrote:
>
>> it does solve the problem on linux. Ken, can you test the bleadperl?
>> This fix was applied as a solution. If `pwd` doesn't work for you,
>> that sucks! Meaning that the problem wasn't fixed in bleadperl :( Can
>> you check the recent Cwd thread on p5p (started by me) and try running
>> cwd.t under -T?
>
>
> All bleadperl tests pass for me, except 'ext/DB_File/t/db-recno' which I
> think is known to fail.
>
> Both Cwd tests pass, in particular:
>
> ext/Cwd/t/cwd.......................ok
> ext/Cwd/t/taint.....................ok
>
> But you mention running them with -T - how do I do that?
you add -T, to ext/Cwd/t/cwd.t's shebang line, and run it as
PERL_CORE=1 LD_LIBRARY_PATH=/home/stas/perl.org/perl-current ./perl
ext/Cwd/t/cwd.t
I think my patch untainting the test's code went in
http://www.xray.mpe.mpg.de/mailing-lists/perl5-porters/2002-04/msg01274.html
>>> If I also do "$ENV{PATH} = '/bin';" after that, the server gets
>>> farther before failing (this is with a fully static build - I'm
>>> giving up on APACI for now, I get link errors there). Now I get this
>>> error in t/logs/error_log:
>>> ============
>>> Insecure dependency in eval while running with -T switch.
>>> Callback called exit.
>>> ============
>>> Doesn't exactly tell me where to start looking for the error, anyone
>>> have hints? The above is the entire contents of the log.
>>
>>
>> Doug has started fixing this problem, but didn't finish. See:
>> http://marc.theaimsgroup.com/?t=101880934700003&r=1&w=2
>
>
> Hmm, I'm now seeing different behavior than what I saw before. Using
> APACI and your Cwd.pm patch, the server never started, nor did it create
> t/logs/error_log. I just tried it now with a simple static build,
> though, and it did succeed. All mod_perl tests pass, though there are
> lots of warnings during the tests about "Can't exec 'pwd': No such file
> or directory". That's to be expected?
As you said earlier, my patch, fixed Cwd's _backtick_pwd under the taint
mode on linux, but broke on yours. must be reported as a bug to p5p and
fixed. 5.8.0 should be out any week now. I'm not sure what the
alternative fix for the taint problem there, you cannot know where pwd
util resides, so you cannot just say $ENV{PATH}='/bin/', can you?
in any case let's move this discussion to p5p.
__________________________________________________________________
Stas Bekman JAm_pH ------> Just Another mod_perl Hacker
http://stason.org/ mod_perl Guide ---> http://perl.apache.org
mailto:stas@stason.org http://use.perl.org http://apacheweek.com
http://modperlbook.org http://apache.org http://ticketmaster.com
Re: problems on OS X
Posted by Ken Williams <ke...@mathforum.org>.
On Sunday, April 28, 2002, at 04:48 PM, Stas Bekman wrote:
> it does solve the problem on linux. Ken, can you test the
> bleadperl? This fix was applied as a solution. If `pwd` doesn't
> work for you, that sucks! Meaning that the problem wasn't fixed
> in bleadperl :( Can you check the recent Cwd thread on p5p
> (started by me) and try running cwd.t under -T?
All bleadperl tests pass for me, except 'ext/DB_File/t/db-recno'
which I think is known to fail.
Both Cwd tests pass, in particular:
ext/Cwd/t/cwd.......................ok
ext/Cwd/t/taint.....................ok
But you mention running them with -T - how do I do that?
>> If I also do "$ENV{PATH} = '/bin';" after that, the server
>> gets farther before failing (this is with a fully static
>> build - I'm giving up on APACI for now, I get link errors
>> there). Now I get this error in t/logs/error_log:
>> ============
>> Insecure dependency in eval while running with -T switch.
>> Callback called exit.
>> ============
>> Doesn't exactly tell me where to start looking for the error,
>> anyone have hints? The above is the entire contents of the
>> log.
>
> Doug has started fixing this problem, but didn't finish. See:
> http://marc.theaimsgroup.com/?t=101880934700003&r=1&w=2
Hmm, I'm now seeing different behavior than what I saw before.
Using APACI and your Cwd.pm patch, the server never started, nor
did it create t/logs/error_log. I just tried it now with a
simple static build, though, and it did succeed. All mod_perl
tests pass, though there are lots of warnings during the tests
about "Can't exec 'pwd': No such file or directory". That's to
be expected?
-Ken
Re: problems on OS X
Posted by Ken Williams <ke...@mathforum.org>.
On Sunday, April 28, 2002, at 04:48 PM, Stas Bekman wrote:
> Ken Williams wrote:
>> On Sunday, April 28, 2002, at 01:47 PM, Stas Bekman wrote:
>>> Ken, CWD.pm, has always suffered from taint problems. This problem
>>> has been fixed in the bleadperl, try this patch:
>>>
>>> --- /tmp/Cwd.pm Sun Apr 28 11:44:38 2002
>>> +++ /home/stas/perl.org/perl-5.6.1/lib/Cwd.pm Fri Sep 14 17:09:10
>>> 2001
>>> @@ -89,7 +89,6 @@
>>> # The 'natural and safe form' for UNIX (pwd may be setuid root)
>>>
>>> sub _backtick_pwd {
>>> + local @ENV{qw(PATH IFS CDPATH ENV BASH_ENV)};
>>> my $cwd = `pwd`;
>>> # `pwd` may fail e.g. if the disk is full
>>> chomp($cwd) if defined $cwd;
>> This still fails, because it won't find `pwd` without a path.
>
> it does solve the problem on linux. Ken, can you test the bleadperl?
> This fix was applied as a solution.
I sent a message earlier today saying that this patch seems to help
things, but I just noticed something disturbing. After hand-applying
this patch to my CWD.pm from 5.6.1, I ran a 'perl Makefile.PL' for a
different module (Apache::SSI), and it created the Makefile not in the
current directory, but in my *home* directory! Weird. I don't know why
it happened yet, but obviously this isn't a good thing.
I don't see how this patch can be right - how is it supposed to execute
`pwd` if there's nothing in $ENV{PATH}?
-Ken
Re: problems on OS X
Posted by Stas Bekman <st...@stason.org>.
Ken Williams wrote:
>
> On Sunday, April 28, 2002, at 01:47 PM, Stas Bekman wrote:
>
>> Ken, CWD.pm, has always suffered from taint problems. This problem has
>> been fixed in the bleadperl, try this patch:
>>
>> --- /tmp/Cwd.pm Sun Apr 28 11:44:38 2002
>> +++ /home/stas/perl.org/perl-5.6.1/lib/Cwd.pm Fri Sep 14 17:09:10 2001
>> @@ -89,7 +89,6 @@
>> # The 'natural and safe form' for UNIX (pwd may be setuid root)
>>
>> sub _backtick_pwd {
>> - local @ENV{qw(PATH IFS CDPATH ENV BASH_ENV)};
>> my $cwd = `pwd`;
>> # `pwd` may fail e.g. if the disk is full
>> chomp($cwd) if defined $cwd;
>
>
> This still fails, because it won't find `pwd` without a path.
it does solve the problem on linux. Ken, can you test the bleadperl?
This fix was applied as a solution. If `pwd` doesn't work for you, that
sucks! Meaning that the problem wasn't fixed in bleadperl :( Can you
check the recent Cwd thread on p5p (started by me) and try running cwd.t
under -T?
> If I also
> do "$ENV{PATH} = '/bin';" after that, the server gets farther before
> failing (this is with a fully static build - I'm giving up on APACI for
> now, I get link errors there). Now I get this error in t/logs/error_log:
>
> ============
> Insecure dependency in eval while running with -T switch.
> Callback called exit.
> ============
>
> Doesn't exactly tell me where to start looking for the error, anyone
> have hints? The above is the entire contents of the log.
Doug has started fixing this problem, but didn't finish. See:
http://marc.theaimsgroup.com/?t=101880934700003&r=1&w=2
__________________________________________________________________
Stas Bekman JAm_pH ------> Just Another mod_perl Hacker
http://stason.org/ mod_perl Guide ---> http://perl.apache.org
mailto:stas@stason.org http://use.perl.org http://apacheweek.com
http://modperlbook.org http://apache.org http://ticketmaster.com
Re: problems on OS X
Posted by Ken Williams <ke...@mathforum.org>.
Great, the CVS version passes all tests for me now when built
under 'perl Makefile.PL EVERYTHING=1' using apache 1.3.24.
On Tuesday, May 21, 2002, at 07:19 AM, Doug MacEachern wrote:
> On Sun, 28 Apr 2002, Ken Williams wrote:
>
>> ============
>> Insecure dependency in eval while running with -T switch.
>> Callback called exit.
>> ============
>
> this has been fixed in modperl cvs, just remove the 'use
> ExtUtils::testlib;' line in t/docs/startup.pl
>
>
>
-Ken
Re: problems on OS X
Posted by Doug MacEachern <do...@covalent.net>.
On Sun, 28 Apr 2002, Ken Williams wrote:
> ============
> Insecure dependency in eval while running with -T switch.
> Callback called exit.
> ============
this has been fixed in modperl cvs, just remove the 'use
ExtUtils::testlib;' line in t/docs/startup.pl
Re: problems on OS X
Posted by Ken Williams <ke...@mathforum.org>.
On Sunday, April 28, 2002, at 01:47 PM, Stas Bekman wrote:
> Ken, CWD.pm, has always suffered from taint problems. This problem has
> been fixed in the bleadperl, try this patch:
>
> --- /tmp/Cwd.pm Sun Apr 28 11:44:38 2002
> +++ /home/stas/perl.org/perl-5.6.1/lib/Cwd.pm Fri Sep 14 17:09:10 2001
> @@ -89,7 +89,6 @@
> # The 'natural and safe form' for UNIX (pwd may be setuid root)
>
> sub _backtick_pwd {
> - local @ENV{qw(PATH IFS CDPATH ENV BASH_ENV)};
> my $cwd = `pwd`;
> # `pwd` may fail e.g. if the disk is full
> chomp($cwd) if defined $cwd;
This still fails, because it won't find `pwd` without a path. If I also
do "$ENV{PATH} = '/bin';" after that, the server gets farther before
failing (this is with a fully static build - I'm giving up on APACI for
now, I get link errors there). Now I get this error in t/logs/error_log:
============
Insecure dependency in eval while running with -T switch.
Callback called exit.
============
Doesn't exactly tell me where to start looking for the error, anyone
have hints? The above is the entire contents of the log.
-Ken
Re: problems on OS X
Posted by Stas Bekman <st...@stason.org>.
Ken Williams wrote:
> Hi,
>
> I used to be able to compile mod_perl pretty easily on Mac OS X, but now
> for some reason (upgrades of modules? OS upgrades?) I'm having a lot of
> trouble getting past 'make test'. Here's what happens (no matter
> whether I compile statically with just EVERYTHING=1, or as a DSO as per
> http://david.wheeler.net/osx.html):
>
>
> ====================================================================
> [junior:~/Downloads/perl/mod_perl-1.26] ken% make test
> cp t/conf/mod_perl_srm.conf t/conf/srm.conf
> /usr/local/src/apache_1.3.23/src/httpd -f `pwd`/t/conf/httpd.conf -X -d
> `pwd`/t &
> httpd listening on port 8529
> will write error_log to: t/logs/error_log
> letting apache warm up...\c
> [Sun Apr 28 12:29:28 2002] [error] Insecure $ENV{PATH} while running
> with -T switch at /System/Library/Perl/Cwd.pm line 92.
> BEGIN failed--compilation aborted at
> /System/Library/Perl/ExtUtils/testlib.pm line 6.
> Compilation failed in require at
> /Users/ken/Downloads/perl/mod_perl-1.26/t//docs/startup.pl line 9.
> BEGIN failed--compilation aborted at
> /Users/ken/Downloads/perl/mod_perl-1.26/t//docs/startup.pl line 9.
> Compilation failed in require at (eval 1) line 1.
> <....>
> ====================================================================
>
> It's possible that it might have something to do with
> ExtUtils::MakeMaker and its seedy friends, because I've been helping
> work on that and installing betas from time to time. But I'm not sure
> where to start looking at that. I'm currently using EU::MM 5.91_01.
>
> Any suggestions?
Ken, CWD.pm, has always suffered from taint problems. This problem has
been fixed in the bleadperl, try this patch:
--- /tmp/Cwd.pm Sun Apr 28 11:44:38 2002
+++ /home/stas/perl.org/perl-5.6.1/lib/Cwd.pm Fri Sep 14 17:09:10 2001
@@ -89,7 +89,6 @@
# The 'natural and safe form' for UNIX (pwd may be setuid root)
sub _backtick_pwd {
- local @ENV{qw(PATH IFS CDPATH ENV BASH_ENV)};
my $cwd = `pwd`;
# `pwd` may fail e.g. if the disk is full
chomp($cwd) if defined $cwd;
and if it works for you consider submitting it to Sarathy for 5.6.2.
__________________________________________________________________
Stas Bekman JAm_pH ------> Just Another mod_perl Hacker
http://stason.org/ mod_perl Guide ---> http://perl.apache.org
mailto:stas@stason.org http://use.perl.org http://apacheweek.com
http://modperlbook.org http://apache.org http://ticketmaster.com
Re: problems on OS X
Posted by Ken Williams <ke...@mathforum.org>.
On Sunday, April 28, 2002, at 12:41 PM, Ken Williams wrote:
> I used to be able to compile mod_perl pretty easily on Mac OS
> X, but now for some reason (upgrades of modules? OS upgrades?)
> I'm having a lot of trouble getting past 'make test'. Here's
> what happens (no matter whether I compile statically with just
> EVERYTHING=1, or as a DSO as per
> http://david.wheeler.net/osx.html):
Oops - as David pointed out to me, he doesn't recommend
compiling as a DSO on that page. I should have said "whether or
not I compile Apache with mod_so". Or maybe "whether I use
APACI or build by hand."
-Ken