You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@perl.apache.org by Randy Kobes <ra...@theoryx5.uwinnipeg.ca> on 2004/06/15 07:49:40 UTC

[mp2] APR w/o mod_perl

I'd like to try to get the patch Stas had for getting APR to
work w/o mod_perl adjusted for Win32. As a starting point, I
applied the original patch against the current cvs, and it
mostly applied cleanly, but required a couple of manual
changes - I put this at
   http://theoryx5.uwinnipeg.ca/apr-ext-1.patch
This builds and tests OK on my linux box, but it's very
possible I missed something ... I was wondering the best way
to proceed - apply (a possibly updated and/or corrected)
version of this patch, and work at fixing things for Win32
(and possibly other platforms) from there?

-- 
best regards,
randy

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@perl.apache.org
For additional commands, e-mail: dev-help@perl.apache.org


Re: [mp2] APR w/o mod_perl

Posted by Joe Schaefer <jo...@sunstarsys.com>.
Stas Bekman <st...@stason.org> writes:

[...]

> Could you possibly contribute a test for modperl-2.0/t/apr-ext/, that you get
> that segfault with? Once we have it then it's easier to see why this doesn't
> work.

Errgh, I think this may just be user-error somewhere.  Today I retested &
reinstalled mp2's cvs-current; then rebuilt httpd-apreq-2, and apreq's
glue/perl/t/apreq/cgi.t test passed!  At this point I'm assuming that I 
screwed something up yesterday (maybe forgot to reinstall mp2 or do a
clean rebuild of httpd-apreq-2 after Randy's commit).

-- 
Joe Schaefer


Re: [mp2] APR w/o mod_perl

Posted by Stas Bekman <st...@stason.org>.
Joe Schaefer wrote:
> Stas Bekman <st...@stason.org> writes:
> 
> [...]
> 
> 
>>Why are you using BuildMM and not MM for libapreq? BuildMM is for
>>mod_perl only or do you mean something else?
> 
> 
> It's the .so's (like APR/Pool/Pool.so) in mp2 that need to be linked to 
> libapr.  apreq's .so's are already linked correctly.

Ah, OK, so it's mp2's APR-stand-alone issue. I suppose Randy handles that at 
the moment.

>>>  2) Expose APR::General::initialize in xs/maps/apr_functions.map
>>>     and call it at the top of the (generated) test_cgi.pl script.
>>
>>That shouldn't be the case if you 'use APR', which does that thing already. I
>>was thinking to have all APR:: modules load APR.pm internally.
>  
> That's what I was expecting to happen, but Randy's cgi.t test was
> segfaulting for me in apr_pool_create without this change.

Could you possibly contribute a test for modperl-2.0/t/apr-ext/, that you get 
that segfault with? Once we have it then it's easier to see why this doesn't work.

-- 
__________________________________________________________________
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: [mp2] APR w/o mod_perl

Posted by Joe Schaefer <jo...@sunstarsys.com>.
Stas Bekman <st...@stason.org> writes:

[...]

> Why are you using BuildMM and not MM for libapreq? BuildMM is for
> mod_perl only or do you mean something else?

It's the .so's (like APR/Pool/Pool.so) in mp2 that need to be linked to 
libapr.  apreq's .so's are already linked correctly.

> 
> >   2) Expose APR::General::initialize in xs/maps/apr_functions.map
> >      and call it at the top of the (generated) test_cgi.pl script.
> 
> That shouldn't be the case if you 'use APR', which does that thing already. I
> was thinking to have all APR:: modules load APR.pm internally.

That's what I was expecting to happen, but Randy's cgi.t test was
segfaulting for me in apr_pool_create without this change.

-- 
Joe Schaefer


Re: [mp2] APR w/o mod_perl

Posted by Joe Schaefer <jo...@sunstarsys.com>.
Stas Bekman <st...@stason.org> writes:

[...]

> Why are you using BuildMM and not MM for libapreq? BuildMM is for
> mod_perl only or do you mean something else?

It's the .so's (like APR/Pool/Pool.so) in mp2 that need to be linked to 
libapr.  apreq's .so's are already linked correctly.

> 
> >   2) Expose APR::General::initialize in xs/maps/apr_functions.map
> >      and call it at the top of the (generated) test_cgi.pl script.
> 
> That shouldn't be the case if you 'use APR', which does that thing already. I
> was thinking to have all APR:: modules load APR.pm internally.

That's what I was expecting to happen, but Randy's cgi.t test was
segfaulting for me in apr_pool_create without this change.

-- 
Joe Schaefer


Re: [mp2] APR w/o mod_perl

Posted by Stas Bekman <st...@stason.org>.
Joe Schaefer wrote:
> Stas Bekman <st...@stason.org> writes:
> 
> [...]
> 
> 
>>>>The rest is hard to tell as it's a big patch. Hopefully
>>>>nothing was missed. So go ahead and apply it and we will
>>>>take it from there. As I originally mentioned there were a
>>>>few minor issues with my original patch, but they may
>>>>remove themselves as you adjust it to work with win32.
> 
> 
> A data point:
> 
> The cgi.t test in httpd-apreq-2/glue/perl/t/apreq can be made to pass
> all its tests now.  However there were two things I needed to do to
> make that happen:
> 
>   1)  Add a LIBS=> "$aprutil_libs $apr_libs" argument to the
>       ModPerl::BuildMM::WriteMakefile call in lib/ModPerl/WrapXS.pm,
>       similar to the line in httpd-apreq2/build/xsbuilder.pl.

Perhaps we need to add a special wrapper to add these flags.

Why are you using BuildMM and not MM for libapreq? BuildMM is for mod_perl 
only or do you mean something else?

>   2) Expose APR::General::initialize in xs/maps/apr_functions.map
>      and call it at the top of the (generated) test_cgi.pl script.

That shouldn't be the case if you 'use APR', which does that thing already. I 
was thinking to have all APR:: modules load APR.pm internally.


-- 
__________________________________________________________________
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: [mp2] APR w/o mod_perl

Posted by Stas Bekman <st...@stason.org>.
Joe Schaefer wrote:
> Stas Bekman <st...@stason.org> writes:
> 
> [...]
> 
> 
>>>>The rest is hard to tell as it's a big patch. Hopefully
>>>>nothing was missed. So go ahead and apply it and we will
>>>>take it from there. As I originally mentioned there were a
>>>>few minor issues with my original patch, but they may
>>>>remove themselves as you adjust it to work with win32.
> 
> 
> A data point:
> 
> The cgi.t test in httpd-apreq-2/glue/perl/t/apreq can be made to pass
> all its tests now.  However there were two things I needed to do to
> make that happen:
> 
>   1)  Add a LIBS=> "$aprutil_libs $apr_libs" argument to the
>       ModPerl::BuildMM::WriteMakefile call in lib/ModPerl/WrapXS.pm,
>       similar to the line in httpd-apreq2/build/xsbuilder.pl.

Perhaps we need to add a special wrapper to add these flags.

Why are you using BuildMM and not MM for libapreq? BuildMM is for mod_perl 
only or do you mean something else?

>   2) Expose APR::General::initialize in xs/maps/apr_functions.map
>      and call it at the top of the (generated) test_cgi.pl script.

That shouldn't be the case if you 'use APR', which does that thing already. I 
was thinking to have all APR:: modules load APR.pm internally.


-- 
__________________________________________________________________
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

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@perl.apache.org
For additional commands, e-mail: dev-help@perl.apache.org


Re: [mp2] APR w/o mod_perl

Posted by Joe Schaefer <jo...@sunstarsys.com>.
Stas Bekman <st...@stason.org> writes:

[...]

> >>The rest is hard to tell as it's a big patch. Hopefully
> >>nothing was missed. So go ahead and apply it and we will
> >>take it from there. As I originally mentioned there were a
> >>few minor issues with my original patch, but they may
> >>remove themselves as you adjust it to work with win32.

A data point:

The cgi.t test in httpd-apreq-2/glue/perl/t/apreq can be made to pass
all its tests now.  However there were two things I needed to do to
make that happen:

  1)  Add a LIBS=> "$aprutil_libs $apr_libs" argument to the
      ModPerl::BuildMM::WriteMakefile call in lib/ModPerl/WrapXS.pm,
      similar to the line in httpd-apreq2/build/xsbuilder.pl.

  2) Expose APR::General::initialize in xs/maps/apr_functions.map
     and call it at the top of the (generated) test_cgi.pl script.

-- 
Joe Schaefer


---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@perl.apache.org
For additional commands, e-mail: dev-help@perl.apache.org


Re: [mp2] APR w/o mod_perl

Posted by Stas Bekman <st...@stason.org>.
Randy Kobes wrote:
[...]
>>Please drop that part:
>>
>>Index: Apache-Test/lib/Apache/TestRun.pm
[...]
>>-    $original_command = "ulimit -c unlimited; $original_command";
>>+    $original_command = "ulimit -c unlimited; PERL_DL_NONLAZY=1
>>$original_command";

Though I'd like to somehow reimplant PERL_DL_NONLAZY=1 only into apr-ext 
tests, because w/o it we may miss problems on all but a few platforms.

>>it's only needed for testing. Shouldn't be in the core (at least not now).
>>
>>The rest is hard to tell as it's a big patch. Hopefully
>>nothing was missed. So go ahead and apply it and we will
>>take it from there. As I originally mentioned there were a
>>few minor issues with my original patch, but they may
>>remove themselves as you adjust it to work with win32.
>>
>>Thanks Randy!
> 
> 
> Thanks, Stas - I just did that ... But I'm afraid I missed
> that there was still an Apache-Test file included in the
> changes, and I didn't commit that separately. Sorry about
> that ...

No problem :)

The only missing part is an entry in Changes, but I suppose we can add it once 
win32 is happy.

Thanks Randy!

-- 
__________________________________________________________________
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

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@perl.apache.org
For additional commands, e-mail: dev-help@perl.apache.org


Re: [mp2] APR w/o mod_perl

Posted by Randy Kobes <ra...@theoryx5.uwinnipeg.ca>.
On Tue, 15 Jun 2004, Stas Bekman wrote:

> Randy Kobes wrote:
> > I'd like to try to get the patch Stas had for getting APR to
> > work w/o mod_perl adjusted for Win32. As a starting point, I
> > applied the original patch against the current cvs, and it
> > mostly applied cleanly, but required a couple of manual
> > changes - I put this at
> >    http://theoryx5.uwinnipeg.ca/apr-ext-1.patch
> > This builds and tests OK on my linux box, but it's very
> > possible I missed something ... I was wondering the best way
> > to proceed - apply (a possibly updated and/or corrected)
> > version of this patch, and work at fixing things for Win32
> > (and possibly other platforms) from there?
>
> Please drop that part:
>
> Index: Apache-Test/lib/Apache/TestRun.pm
> ===================================================================
> RCS file: /home/cvs/httpd-test/perl-framework/Apache-Test/lib/Apache/TestRun.pm,v
> retrieving revision 1.170
> diff -u -r1.170 TestRun.pm
> --- Apache-Test/lib/Apache/TestRun.pm	26 May 2004 02:14:36 -0000	1.170
> +++ Apache-Test/lib/Apache/TestRun.pm	15 Jun 2004 05:31:42 -0000
> @@ -656,7 +656,7 @@
>       }
>       close $sh;
>
> -    $original_command = "ulimit -c unlimited; $original_command";
> +    $original_command = "ulimit -c unlimited; PERL_DL_NONLAZY=1
> $original_command";
>
> it's only needed for testing. Shouldn't be in the core (at least not now).
>
> The rest is hard to tell as it's a big patch. Hopefully
> nothing was missed. So go ahead and apply it and we will
> take it from there. As I originally mentioned there were a
> few minor issues with my original patch, but they may
> remove themselves as you adjust it to work with win32.
>
> Thanks Randy!

Thanks, Stas - I just did that ... But I'm afraid I missed
that there was still an Apache-Test file included in the
changes, and I didn't commit that separately. Sorry about
that ...

-- 
best regards,
randy

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@perl.apache.org
For additional commands, e-mail: dev-help@perl.apache.org


Re: [mp2] APR w/o mod_perl

Posted by Stas Bekman <st...@stason.org>.
Randy Kobes wrote:
> I'd like to try to get the patch Stas had for getting APR to
> work w/o mod_perl adjusted for Win32. As a starting point, I
> applied the original patch against the current cvs, and it
> mostly applied cleanly, but required a couple of manual
> changes - I put this at
>    http://theoryx5.uwinnipeg.ca/apr-ext-1.patch
> This builds and tests OK on my linux box, but it's very
> possible I missed something ... I was wondering the best way
> to proceed - apply (a possibly updated and/or corrected)
> version of this patch, and work at fixing things for Win32
> (and possibly other platforms) from there?

Please drop that part:

Index: Apache-Test/lib/Apache/TestRun.pm
===================================================================
RCS file: /home/cvs/httpd-test/perl-framework/Apache-Test/lib/Apache/TestRun.pm,v
retrieving revision 1.170
diff -u -r1.170 TestRun.pm
--- Apache-Test/lib/Apache/TestRun.pm	26 May 2004 02:14:36 -0000	1.170
+++ Apache-Test/lib/Apache/TestRun.pm	15 Jun 2004 05:31:42 -0000
@@ -656,7 +656,7 @@
      }
      close $sh;

-    $original_command = "ulimit -c unlimited; $original_command";
+    $original_command = "ulimit -c unlimited; PERL_DL_NONLAZY=1 
$original_command";

it's only needed for testing. Shouldn't be in the core (at least not now).

The rest is hard to tell as it's a big patch. Hopefully nothing was missed. So 
go ahead and apply it and we will take it from there. As I originally 
mentioned there were a few minor issues with my original patch, but they may 
remove themselves as you adjust it to work with win32.

Thanks Randy!

-- 
__________________________________________________________________
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

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@perl.apache.org
For additional commands, e-mail: dev-help@perl.apache.org