You are viewing a plain text version of this content. The canonical link for it is here.
Posted to test-dev@httpd.apache.org by Rodent of Unusual Size <Ke...@Golux.Com> on 2004/03/01 19:00:16 UTC

new one: rwrite on aix with 1.3

the same sources configured the same way on linux runs fine, but
on aix i get:

/home/coar/web/server/bin/httpd -d /home/coar/ibm/testpak/perl-framework/t -f
/home/coar/ibm/testpak/perl-framework/t/conf/httpd.conf -DAPACHE1
using Apache/1.3.30-dev

waiting 60 seconds for server to start: .Syntax error on line 138 of
/home/coar/ibm/testpak/perl-framework/t/conf/httpd.conf:
Can't locate API module structure `test_rwrite_module' in file
/home/coar/ibm/testpak/perl-framework/c-modules/test_rwrite/mod_test_rwrite.so:
Function not implemented (test_rwrite_module)
.............................................................
waiting 60 seconds for server to start: giving up after 61 secs
[  error] server failed to start! (t/logs/error_log wasn't created, start the
server in the debug mode)

anyone seen anything like this before?
-- 
#ken	P-)}

Ken Coar, Sanagendamgagwedweinini  http://Ken.Coar.Org/
Author, developer, opinionist      http://Apache-Server.Com/

"Millennium hand and shrimp!"


Re: new one: rwrite on aix with 1.3

Posted by Rodent of Unusual Size <Ke...@Golux.Com>.
Stas Bekman wrote:
> 
> Was httpd and the mod_test_rwrite.so module compiled with the same compiler?

i presume so, since i just built and installed the server and the
framework used the resulting apxs to build its module.  but just
to make sure, let me rung through it all again.

one thing that's particularly irksome is that this error occurs
and blocks execution even if i have apache.rwrite in the t/SKIP file.
-- 
#ken	P-)}

Ken Coar, Sanagendamgagwedweinini  http://Ken.Coar.Org/
Author, developer, opinionist      http://Apache-Server.Com/

"Millennium hand and shrimp!"


Re: new one: rwrite on aix with 1.3

Posted by Stas Bekman <st...@stason.org>.
Rodent of Unusual Size wrote:
> Stas Bekman wrote:
> 
>>What assumption are you talking about? Using '/'? so your change is to use 
>>catfile?
> 
> 
> yes.  is good?  or no?

It depends: If the path is only ever handled internally by perl than you can 
always use '/' and it will do the right thing on any platform. When it 
interacts with external world than nothing is sure.

So, yes, it's always a good idea to use catfile when building a path with a 
file, and catdir when it's only a directory path.

But be careful when that path is then used as a part of URI in which case 
http://example/foo\bar won't make a happy URI since it may live on a non-win32 
server, when the client is win32. But you know that already. This is just 
something I had tripped over several times.

So yes, your change is good and if you would like to fix the main function, 
that would be great.

__________________________________________________________________
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: new one: rwrite on aix with 1.3

Posted by Rodent of Unusual Size <Ke...@Golux.Com>.
Stas Bekman wrote:
> 
> What assumption are you talking about? Using '/'? so your change is to use 
> catfile?

yes.  is good?  or no?
-- 
#ken	P-)}

Ken Coar, Sanagendamgagwedweinini  http://Ken.Coar.Org/
Author, developer, opinionist      http://Apache-Server.Com/

"Millennium hand and shrimp!"


Re: new one: rwrite on aix with 1.3

Posted by Stas Bekman <st...@stason.org>.
Rodent of Unusual Size wrote:
> Stas Bekman wrote:
> 
>>Rodent of Unusual Size wrote:
>>
>>
>>>the options are correct, but the module isn't being created properly.
>>
>>coolio, so now you know what the problem is ;)
> 
> 
> actually, the options *aren't* correct for AIX and apache 1.3.
> and in dealing with that, i found another set of '/' path
> concatenation assumptions.  here's a patch that seems to get
> this working for apache 1.3 on aix.

looks ok to me, but please drop () around 'catfile' to be consistent with the 
rest of the file.

I can't test it, though I'd assume that it's correct. please commit, Ken. And 
please add a log entry in Changes.

> thanks to bill stoddard for pointing out the weird and not-so-wonderful
> link options needed for aix.
> 
> note the
> 
>     my $makefile = "$mod->{dir}/Makefile";
> 
> path concatenation assumption.  i fixed that in the new sub i added
> for aix, but left the original (and any others) alone..

What assumption are you talking about? Using '/'? so your change is to use 
catfile?

my $makefile = catfile($mod->{dir}, 'Makefile');


__________________________________________________________________
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: new one: rwrite on aix with 1.3

Posted by Rodent of Unusual Size <Ke...@Golux.Com>.
Stas Bekman wrote:
> Rodent of Unusual Size wrote:
> 
>> the options are correct, but the module isn't being created properly.
> 
> coolio, so now you know what the problem is ;)

actually, the options *aren't* correct for AIX and apache 1.3.
and in dealing with that, i found another set of '/' path
concatenation assumptions.  here's a patch that seems to get
this working for apache 1.3 on aix.

thanks to bill stoddard for pointing out the weird and not-so-wonderful
link options needed for aix.

note the

    my $makefile = "$mod->{dir}/Makefile";

path concatenation assumption.  i fixed that in the new sub i added
for aix, but left the original (and any others) alone..
-- 
#ken	P-)}

Ken Coar, Sanagendamgagwedweinini  http://Ken.Coar.Org/
Author, developer, opinionist      http://Apache-Server.Com/

"Millennium hand and shrimp!"

Re: new one: rwrite on aix with 1.3

Posted by Stas Bekman <st...@stason.org>.
Geoffrey Young wrote:
>>the leading '-' tells make to ignore any errors. removing it makes the
>>error fatal. 
> 
> 
>>-            print $fh "$dir-$targ:\n\t-cd $dir && \$(MAKE) $targ\n\n";
>>+            print $fh "$dir-$targ:\n\tcd $dir && \$(MAKE) $targ\n\n";
> 
> 
> I always thought that the - only applied to the cd command (in this case)
> and wouldn't distribute across the &&.  but make certainly isn't one of my
> better areas.

Command line prefixes always apply to the whole line so you can read them as:

   -(cd $dir && \$(MAKE) $targ)

like in verbosity level:

   @cd $dir && \$(MAKE) $targ

but I had no idea that '-' makes things non-fatal ;)

__________________________________________________________________
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: new one: rwrite on aix with 1.3

Posted by Geoffrey Young <ge...@modperlcookbook.org>.
> the leading '-' tells make to ignore any errors. removing it makes the
> error fatal. 

> -            print $fh "$dir-$targ:\n\t-cd $dir && \$(MAKE) $targ\n\n";
> +            print $fh "$dir-$targ:\n\tcd $dir && \$(MAKE) $targ\n\n";

I always thought that the - only applied to the cd command (in this case)
and wouldn't distribute across the &&.  but make certainly isn't one of my
better areas.

--Geoff


Re: new one: rwrite on aix with 1.3

Posted by Stas Bekman <st...@stason.org>.
Stas Bekman wrote:
> Stas Bekman wrote:
> [...]
> 
>> The patch below fixes that. But I haven't written that code, so I 
>> don't know why it was written to specifically ignore any failures. So 
>> I'm hesitant to commit it.
> 
> 
> I've pinged Doug who wrote this code, and he said:
> 
> "i seem to recall it being intentional.  if a module couldn't be compiled
> then don't try to test it.  but i can't recall an example of such a case
> where ignoring the compile error would be reasonable.  your patch seems
> fine."
> 
> So if that works for you, Ken (i.e. it aborts 'make test') I'll commit it.

Now committed.

__________________________________________________________________
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: new one: rwrite on aix with 1.3

Posted by Stas Bekman <st...@stason.org>.
Stas Bekman wrote:
[...]
> The patch below fixes that. But I haven't written that code, so I don't 
> know why it was written to specifically ignore any failures. So I'm 
> hesitant to commit it.

I've pinged Doug who wrote this code, and he said:

"i seem to recall it being intentional.  if a module couldn't be compiled
then don't try to test it.  but i can't recall an example of such a case
where ignoring the compile error would be reasonable.  your patch seems
fine."

So if that works for you, Ken (i.e. it aborts 'make test') I'll commit it.

__________________________________________________________________
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: new one: rwrite on aix with 1.3

Posted by Stas Bekman <st...@stason.org>.
Stas Bekman wrote:
> Rodent of Unusual Size wrote:
> 
>> -bI:/home/coar/web/server/libexec/httpd.exp -lc -o mod_test_rwrite.so
>> mod_test_rwrite.o
>> ld: 0711-244 ERROR: No csects or exported symbols have been saved.
>> apxs:Break: Command failed with rc=8
>> make: 1254-004 The error code from the last command is 1.
>>
>> the options are correct, but the module isn't being created properly.

It seems that it has been written this way on purpose:

c-modules/Makefile:
...
test_rwrite/.libs/mod_test_rwrite.so: test_rwrite/mod_test_rwrite.c
	-cd test_rwrite && $(MAKE) .libs/mod_test_rwrite.so

the leading '-' tells make to ignore any errors. removing it makes the error 
fatal. And we also lacked a check for the c-modules total make status.

The patch below fixes that. But I haven't written that code, so I don't know 
why it was written to specifically ignore any failures. So I'm hesitant to 
commit it.

Index: lib/Apache/TestConfigC.pm
===================================================================
RCS file: 
/home/cvs/httpd-test/perl-framework/Apache-Test/lib/Apache/TestConfigC.pm,v
retrieving revision 1.24
diff -u -r1.24 TestConfigC.pm
--- lib/Apache/TestConfigC.pm	8 Jan 2004 17:15:37 -0000	1.24
+++ lib/Apache/TestConfigC.pm	1 Mar 2004 21:02:24 -0000
@@ -123,13 +123,13 @@

      for my $dir (@dirs) {
          for my $targ (@targets) {
-            print $fh "$dir-$targ:\n\t-cd $dir && \$(MAKE) $targ\n\n";
+            print $fh "$dir-$targ:\n\tcd $dir && \$(MAKE) $targ\n\n";
          }

          my $lib = $self->cmodules_build_so($dir);
          my $cfile = "$dir/mod_$dir.c";
          push @libs, "$dir/$lib";
-        print $fh "$libs[-1]: $cfile\n\t-cd $dir && \$(MAKE) $lib\n\n";
+        print $fh "$libs[-1]: $cfile\n\tcd $dir && \$(MAKE) $lib\n\n";
      }

      for my $targ (@targets) {
@@ -211,6 +211,10 @@
      my $cmd = "cd $self->{cmodules_dir} && $Config{make} $targ";
      debug $cmd;
      system $cmd;
+    if ($?) {
+        die "Failed to build c-modules";
+    }
+
  }

  sub cmodules_compile {



__________________________________________________________________
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: new one: rwrite on aix with 1.3

Posted by Stas Bekman <st...@stason.org>.
Rodent of Unusual Size wrote:

> -bI:/home/coar/web/server/libexec/httpd.exp -lc -o mod_test_rwrite.so
> mod_test_rwrite.o
> ld: 0711-244 ERROR: No csects or exported symbols have been saved.
> apxs:Break: Command failed with rc=8
> make: 1254-004 The error code from the last command is 1.
> 
> the options are correct, but the module isn't being created properly.

coolio, so now you know what the problem is ;)

> so, two problems here:
> 
> 1. what needs to be done to get the module to build correctly?  (working
>    on that; it's obviously some bogus aix thing)
> 2. the framework needs to varf and bail out if it gets errors building
>    its modules -- currently it ignores the error status, evidently.
> 
> i'll tackle the former, while maybe stas can look at the latter.

may be ;)

__________________________________________________________________
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: new one: rwrite on aix with 1.3

Posted by Rodent of Unusual Size <Ke...@Golux.Com>.
Stas Bekman wrote:
>> 
>> just went through and reconfigured the server build, built it, installed
>> it, cleaned out the .so files in the framework tree, and re-ran
>> t/TEST -{stop,clean,configure) and then t/TEST .  same results.
> 
> it doesn't mean that the compiler and the same compile options were used, does it?

should be, since the apxs file store the compiler and options so that
modules will be built the same way.

>> how could i tell how the module was built?
> 
> by looking at the output of 'make test' (after 'make clean').

nothing there suggests that it's being built with anything other than the
standard options.

okey, cding down into perl-framework/c-modules/test_rwrite and

rm mod_test_rwrite.so
make mod_test_rwrite.so
/home/coar/web/server/bin/apxs -DAPACHE1
-I/home/coar/ibm/testpak/perl-framework/c-modules -c mod_test_rwrite.c
xlc -DAIX=510 -U__STR__ -DAIX_BIND_PROCESSOR -DUSE_HSREGEX -DUSE_EXPAT
-I../lib/expat-lite -g -O2 -DSHARED_MODULE -I/home/coar/web/server/include
-I/home/coar/ibm/testpak/perl-framework/c-modules -DAPACHE1  -c mod_test_rwrite.c
ld -H512 -T512 -bhalt:4 -bM:SRE -bnoentry
-bI:/home/coar/web/server/libexec/httpd.exp -lc -o mod_test_rwrite.so
mod_test_rwrite.o
ld: 0711-244 ERROR: No csects or exported symbols have been saved.
apxs:Break: Command failed with rc=8
make: 1254-004 The error code from the last command is 1.

the options are correct, but the module isn't being created properly.

so, two problems here:

1. what needs to be done to get the module to build correctly?  (working
   on that; it's obviously some bogus aix thing)
2. the framework needs to varf and bail out if it gets errors building
   its modules -- currently it ignores the error status, evidently.

i'll tackle the former, while maybe stas can look at the latter.
-- 
#ken	P-)}

Ken Coar, Sanagendamgagwedweinini  http://Ken.Coar.Org/
Author, developer, opinionist      http://Apache-Server.Com/

"Millennium hand and shrimp!"


Re: new one: rwrite on aix with 1.3

Posted by Stas Bekman <st...@stason.org>.
Rodent of Unusual Size wrote:
> Stas Bekman wrote:
> 
>>Was httpd and the mod_test_rwrite.so module compiled with the same compiler?
> 
> 
> just went through and reconfigured the server build, built it, installed
> it, cleaned out the .so files in the framework tree, and re-ran
> t/TEST -{stop,clean,configure) and then t/TEST .  same results.

it doesn't mean that the compiler and the same compile options were used, does it?

> how could i tell how the module was built?

by looking at the output of 'make test' (after 'make clean').

p.s. I'm not on AIX, so I'm just guessing here.

__________________________________________________________________
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: new one: rwrite on aix with 1.3

Posted by Rodent of Unusual Size <Ke...@Golux.Com>.
Stas Bekman wrote:
> 
> Was httpd and the mod_test_rwrite.so module compiled with the same compiler?

just went through and reconfigured the server build, built it, installed
it, cleaned out the .so files in the framework tree, and re-ran
t/TEST -{stop,clean,configure) and then t/TEST .  same results.

how could i tell how the module was built?
-- 
#ken	P-)}

Ken Coar, Sanagendamgagwedweinini  http://Ken.Coar.Org/
Author, developer, opinionist      http://Apache-Server.Com/

"Millennium hand and shrimp!"


Re: new one: rwrite on aix with 1.3

Posted by Stas Bekman <st...@stason.org>.
Rodent of Unusual Size wrote:
> the same sources configured the same way on linux runs fine, but
> on aix i get:
> 
> /home/coar/web/server/bin/httpd -d /home/coar/ibm/testpak/perl-framework/t -f
> /home/coar/ibm/testpak/perl-framework/t/conf/httpd.conf -DAPACHE1
> using Apache/1.3.30-dev
> 
> waiting 60 seconds for server to start: .Syntax error on line 138 of
> /home/coar/ibm/testpak/perl-framework/t/conf/httpd.conf:
> Can't locate API module structure `test_rwrite_module' in file
> /home/coar/ibm/testpak/perl-framework/c-modules/test_rwrite/mod_test_rwrite.so:
> Function not implemented (test_rwrite_module)
> .............................................................
> waiting 60 seconds for server to start: giving up after 61 secs
> [  error] server failed to start! (t/logs/error_log wasn't created, start the
> server in the debug mode)
> 
> anyone seen anything like this before?

Was httpd and the mod_test_rwrite.so module compiled with the same compiler?

__________________________________________________________________
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