Re: [RELEASE CANDIDATE] Apache-Test-1.41 RC1

2019-07-10 Thread Philippe M. Chiasson
Tested on Fedora 30 with Apache/2.4.39, looking good to me

That's my +1

On 2019-07-03 3:45 a.m., Steve Hay wrote:
> Please download, test, and report back on this Apache-Test 1.41
> release candidate.
>
> https://dist.apache.org/repos/dist/dev/perl/Apache-Test-1.41-rc1.tar.gz
>
> MD5  = 7933d3a6a762f087bf7883a1ac2086eb
> SHA1 = 17aa9a8669023aa2f485aa83f8f389969b8e5f0c
>
> Major changes in this release are as follows:
>
> Set DefaultStateDir for > 2.5.1 and add -t_state to override. [jorton]
>
> Inherit config via IncludeOptional as well as Include. [jorton]
>
> Increase size of MinSpare, MaxSpare and MaxClients to improve httpd
> test framework runs with worker and preform MPMs. [rjung]
>
> Changed the openssl version detection to work with other *SSL libraries. 
> [icing]
>
> Switch test framework from using Net::SSL for raw TLS sockets to
> IO::Socket::SSL. [rjung]
>
> Fix mod_ssl tests under OpenSSL 1.1.1 / TLSv1.3. [jorton]
>
> Add cwd to generated lib path in TEST script since Perl >=5.26 don't
> do that any more. [jorton]
>
> Override loglevel to trace8 if running in 2.4. [covener]
>
> Allow an empty PREFIX. [sf]
>
> Add need_min_apache_fix(). [covener]
>
> -
> To unsubscribe, e-mail: dev-unsubscr...@perl.apache.org
> For additional commands, e-mail: dev-h...@perl.apache.org
>



signature.asc
Description: OpenPGP digital signature


Re: [RELEASE CANDIDATE]: mod_perl-2.0.8 RC1

2013-04-06 Thread Philippe M. Chiasson
We do not support httpd 2.4 yet.

There is a 2.4 branch in svn that you might want to try, however.

--
Philippe M. Chiasson
go...@ectoplasm.org

On 2013-04-05, at 10:46 PM, Bruce Pettyjohn bruce.pettyj...@gmail.com wrote:

 Fred,
 
 Just tried to compile and ran into some trouble here. 
 
 
 chmod 755 ../../../blib/arch/auto/Apache2/Command/Command.so
 cp Command.bs ../../../blib/arch/auto/Apache2/Command/Command.bs
 chmod 644 ../../../blib/arch/auto/Apache2/Command/Command.bs
 make[3]: Leaving directory
 `/var/downloads/mod_perl-2.0.8-rc1/WrapXS/Apache2/Command'
 make[3]: Entering directory
 `/var/downloads/mod_perl-2.0.8-rc1/WrapXS/Apache2/Connection'
 cp Connection.pm ../../../blib/lib/Apache2/Connection.pm
 /usr/local/bin/perl /usr/local/lib/perl5/5.16.0/ExtUtils/xsubpp  -typemap
 /usr/local/lib/perl5/5.16.0/ExtUtils/typemap -typemap
 /var/downloads/mod_perl-2.0.8-rc1/xs/typemap  Connection.xs  Connection.xsc
  mv Connection.xsc Connection.c
 cc -c  -I/var/downloads/mod_perl-2.0.8-rc1/src/modules/perl
 -I/var/downloads/mod_perl-2.0.8-rc1/xs -I/usr/local/apr/include/apr-1
 -I/usr/local/apache2/httpd/prefork/include -D_REENTRANT -D_GNU_SOURCE
 -fno-strict-aliasing -pipe -fstack-protector -I/usr/local/include
 -DMOD_PERL -DMP_COMPAT_1X -DLINUX=2 -D_REENTRANT -D_GNU_SOURCE
 -D_LARGEFILE64_SOURCE  -O2   -DVERSION=\2.08\
 -DXS_VERSION=\2.08\ -fPIC
 -I/usr/local/lib/perl5/5.16.0/i686-linux-thread-multi/CORE
 -DMP_HAVE_APR_LIBS Connection.c
 Connection.xs: In function âXS_Apache2__Connection_remote_addrâ:
 Connection.xs:117: error: âconn_recâ has no member named âremote_addrâ
 Connection.xs: In function âXS_Apache2__Connection_remote_ipâ:
 Connection.xs:134: error: âconn_recâ has no member named âremote_ipâ
 Connection.xs:138: error: âconn_recâ has no member named âremote_ipâ
 make[3]: *** [Connection.o] Error 1
 make[3]: Leaving directory
 `/var/downloads/mod_perl-2.0.8-rc1/WrapXS/Apache2/Connection'
 make[2]: *** [subdirs] Error 2
 make[2]: Leaving directory
 `/var/downloads/mod_perl-2.0.8-rc1/WrapXS/Apache2'
 make[1]: *** [subdirs] Error 2
 make[1]: Leaving directory `/var/downloads/mod_perl-2.0.8-rc1/WrapXS'
 make: *** [subdirs] Error 2
 [root@dev2 mod_perl-2.0.8-rc1]#
 
 I'm using Perl 5.16.0 and Apache 2.4.2 on CentOS Linux 5.5
 
 Thanks for any help to get this working.
 
 Bruce
 
 
 
 -Original Message-
 From: Fred Moyer [mailto:f...@redhotpenguin.com] 
 Sent: Monday, April 01, 2013 8:24 PM
 To: mod_perl Dev
 Cc: mod_perl list
 Subject: [RELEASE CANDIDATE]: mod_perl-2.0.8 RC1
 
 A release candidate for mod_perl 2.0.8 is now available! Please
 download, test, and report back.
 
 http://people.apache.org/~phred/mod_perl-2.0.8-rc1.tar.gz
 
 MD5 (mod_perl-2.0.8-rc1.tar.gz) = ed056c6910914f5ecc2ac8171082a264
 
 =item 2.0.8-rc1
 
 Perl 5.16.3's fix for a rehash-based DoS makes it more difficult to invoke
 the workaround for the old hash collision attack, which breaks mod_perl's
 t/perl/hash_attack.t. Patch from rt.cpan.org #83916 improves the fix
 previously applied as revision 1455340. [Zefram]
 
 On Perl 5.17.6 and above, hash seeding has changed, and HvREHASH has
 disappeared. Patch to update mod_perl accordingly from rt.cpan.org #83921.
 [Zefram]
 
 Restore build with Perl 5.8.1, 5.8.2 etc: take care to use
 $Config{useithreads} rather than $Config{usethreads}, and supply definitions
 of Newx and Newxz as necessary. [Steve Hay]
 
 On Perl 5.17.9, t/apache/read2.t fails because an uninitialized value
 warning is generated for the buffer being autovivified. This is because
 the sv_setpvn() that's meant to vivify the buffer doesn't perform set
 magic; the warning is generated by the immediately following SvPV_force().
 Patch to fix this from rt.cpan.org #83922. [Zefram]
 
 Fix t/perl/hash_attack.t to work with Perl 5.14.4, 5.16.3 etc, which
 contain a fix for CVE-2013-1667 (memory exhaustion with arbitrary hash
 keys). This resolves rt.perl.org #116863, from where the patch was taken.
 [Hugo van der Sanden]
 
 use APR::Finfo instead of Perl's stat() in ModPerl::RegistryCooker to
 generate HTTP code 404 even if the requested filename contains newlines
 [Torsten]
 
 Remove all uses of deprecated core perl symbols. [Steve Hay]
 
 Add branch release tag to 'make tag' target. [Phred]
 


Re: Apache2::PerlSections $PerlConfig

2011-11-21 Thread Philippe M. Chiasson
On 11-11-21 09:49 , Perrin Harkins wrote:
 On Mon, Nov 21, 2011 at 9:03 AM, Josh Narins jnar...@seniorbridge.com wrote:
 So, different ways to get this config to apache include:

 my $r = Apache2::RequestUtil-request;
 $r-add_config($template-output);

 But that results in the error Global $r object is not available. and the 
 server does not start.

 Yes, that's what I was getting at: there's no request during startup
 when your httpd.conf is being processes, so there's no $r object to
 get.
 
 I don't use this config stuff at all, but looking in the docs I think
 this might work for you:
 
 use Apache2::ServerUtil ();
 $s = Apache2::ServerUtil-server;
 $s-add_config($config);

You can also use the simpler :

Apache2-httpd_conf(SetEnv foo);

 - Perrin
 The other two, similar, ways I know about involve $PerlConfig and 
 @PerlConfig, and while neither prevents server startup, Apache2::Directive 
 shows that they didn't do anything, with or without the hack mentioned by 
 Randal here:

 http://www.gossamer-threads.com/lists/modperl/modperl/85304?do=post_view_threaded#85304

 And, just so we are all sure, $template-output produces both the content I 
 expect and content that works to start the server. If I simply replace the 
 Perl section with the generated output the server starts.

Have you read
http://perl.apache.org/docs/2.0/api/Apache2/PerlSections.html#C_server_.
The Perl section stuff was re-implemented from scratch between v1 and
v2, so this might be some bug.

Have you tried adding this:

 Perl
  print Apache2::PerlSections-dump;
 /Perl

To the bottom of your httpd.conf, so see what gets dumped ?

Also, it would greatly help if you could post a complete example
httpd.conf (even if simplified) that demonstrates the problem you are
having.

-- 
Philippe M. Chiasson GPG: F9BFE0C2480E7680 1AE53631CB32A107 88C3A5A5
http://gozer.ectoplasm.org/   m/gozer\@(apache|cpan|ectoplasm)\.org/



signature.asc
Description: OpenPGP digital signature


Re: [RELEASE CANDIDATE]: mod_perl-2.0.5 RC2

2011-02-02 Thread Philippe M. Chiasson
On 11-02-02 18:19 , Fred Moyer wrote:
 There were some issues with dev versions of the Apache::* modules
 being in RC1, so I branched 2.0.5, set the external targets to the
 tagged stable releases of Apache::*, and rolled this second release
 candidate.
 
 Please take this for a whirl and report back +/- 1.  I've got this
 version running in all my production environments currently.
 
 http://people.apache.org/~phred/mod_perl-2.0.5-rc2.tar.gz

All good on OS X 10.6:

 perl, v5.10.0 built for darwin-thread-multi-2level
 Server version: Apache/2.2.15 (Unix)

-- 
Philippe M. Chiasson GPG: F9BFE0C2480E7680 1AE53631CB32A107 88C3A5A5
http://gozer.ectoplasm.org/   m/gozer\@(apache|cpan|ectoplasm)\.org/



signature.asc
Description: OpenPGP digital signature


Re: [RELEASE CANDIDATE] Apache-Test-1.34 RC1

2010-12-14 Thread Philippe M. Chiasson
On 10-12-14 00:11 , Fred Moyer wrote:
 A release candidate for Apache-Test is now available at the following url:
 
 http://people.apache.org/~phred/Apache-Test-1.34-rc1.tar.gz
 
 Please download, test, and report back on this RC.  Summary of changes
 is below.  A couple of very old (8+ years) compatibility features have
 been removed, some bugs are fixed, and some maintenance features have
 been added.  Your setup will not be negatively affected unless you are
 running versions of mod_perl1 that are three versions out of date on a
 case insensitive filesystem.

OS X 10.6 Snow Leopard:

All tests successful, 2 tests skipped.
Files=13, Tests=39,  5 wallclock secs ( 2.29 cusr +  0.55 csys =  2.84 CPU)

-- 
Philippe M. Chiasson GPG: F9BFE0C2480E7680 1AE53631CB32A107 88C3A5A5
http://gozer.ectoplasm.org/   m/gozer\@(apache|cpan|ectoplasm)\.org/



signature.asc
Description: OpenPGP digital signature


Re: Custom directive and Location - bug?

2010-12-06 Thread Philippe M. Chiasson
On 10-11-30 07:51 , Alex J. G. Burzyński wrote:
 Hi,
 
 I've noticed that when using custom directives within nested Location
 the result of $r-location reports the parent one only, instead of the
 subdir.
 
 However if I add PerlSetVar the $r-location will report the correct one.

Yup, you've stumbled on an interesting bug.

 The way to replicate:
 please follow the example
 http://perl.apache.org/docs/2.0/user/config/custom.html#Merging_at_Work
 
 and now add:
 
 --- httpd.conf-orig2010-11-30 12:06:57.491843181 +
 +++ httpd.conf2010-11-30 12:07:39.217629859 +
 @@ -18,6 +18,7 @@
  PerlResponseHandler MyApache2::CustomDirectivesTest
  /Location
  Location /custom_directives_test/subdir
 +PerlSetVar fix problem
  MyPlus 1
  MyList SubDir
  MyAppend   SubDir

The reason this makes a difference is that without it, there are no
mod_perl directives (the custom ones are 'special'), so no configuration
pass for modperl in that directory.

Side-effect of that is that $r-location isn't tracked proprely.
Keep in mind that r-location is not an httpd api, but rather something
convenient mod_perl tracks. But not in this case, unfortunately.

-- 
Philippe M. Chiasson GPG: F9BFE0C2480E7680 1AE53631CB32A107 88C3A5A5
http://gozer.ectoplasm.org/   m/gozer\@(apache|cpan|ectoplasm)\.org/



signature.asc
Description: OpenPGP digital signature


Re: svn commit: r935519 - in /perl/modperl/trunk: t/response/TestAPR/socket.pm xs/APR/Socket/APR__Socket.h xs/maps/apr_functions.map xs/tables/current/ModPerl/FunctionTable.pm

2010-04-19 Thread Philippe M. Chiasson
On 10-04-19 06:43 , tors...@apache.org wrote:
 Author: torsten
 Date: Mon Apr 19 10:43:15 2010
 New Revision: 935519
 
 URL: http://svn.apache.org/viewvc?rev=935519view=rev
 Log:
 make the UNIX-level file descriptor of an APR::Socket available

I am wondering what the usage for this would/could be?

Also, this is introducing a non-portable API, something APR tries really
hard to avoid.

 Modified:
 perl/modperl/trunk/t/response/TestAPR/socket.pm
 perl/modperl/trunk/xs/APR/Socket/APR__Socket.h
 perl/modperl/trunk/xs/maps/apr_functions.map
 perl/modperl/trunk/xs/tables/current/ModPerl/FunctionTable.pm
 
 Modified: perl/modperl/trunk/t/response/TestAPR/socket.pm
 URL: 
 http://svn.apache.org/viewvc/perl/modperl/trunk/t/response/TestAPR/socket.pm?rev=935519r1=935518r2=935519view=diff
 ==
 --- perl/modperl/trunk/t/response/TestAPR/socket.pm (original)
 +++ perl/modperl/trunk/t/response/TestAPR/socket.pm Mon Apr 19 10:43:15 2010
 @@ -18,7 +18,7 @@ use APR::Const -compile = 'EMISMATCH';
  sub handler {
  my $r = shift;
  
 -my $tests = 4;
 +my $tests = 5;
  
  plan $r, tests = $tests;
  
 @@ -40,6 +40,15 @@ sub handler {
  $socket-timeout_set($orig_val);
  ok t_cmp($socket-timeout_get(), $orig_val, timeout_get());
  
 +my $fd=$socket-sock_get;
 +t_debug client socket fd=$fd;
 +if ($^O eq 'MSWin32') {
 +ok $fd==-1;
 +}
 +else {
 +ok $fd=0;
 +}
 +
  Apache2::Const::OK;
  }
  
 
 Modified: perl/modperl/trunk/xs/APR/Socket/APR__Socket.h
 URL: 
 http://svn.apache.org/viewvc/perl/modperl/trunk/xs/APR/Socket/APR__Socket.h?rev=935519r1=935518r2=935519view=diff
 ==
 --- perl/modperl/trunk/xs/APR/Socket/APR__Socket.h (original)
 +++ perl/modperl/trunk/xs/APR/Socket/APR__Socket.h Mon Apr 19 10:43:15 2010
 @@ -116,3 +116,14 @@ apr_status_t mpxs_APR__Socket_poll(apr_s
  
  return apr_poll(fd, 1, nsds, timeout);
  }
 +
 +static MP_INLINE int mpxs_APR__Socket_sock_get(pTHX_ apr_socket_t *sock)
 +{
 +#ifdef WIN32
 +return -1;   /* not implemented */
 +#else
 +apr_os_sock_t s;
 +apr_os_sock_get(s, sock);
 +return s;
 +#endif
 +}

Will this work on *all* non WIN32 platforms ?

-- 
Philippe M. Chiasson GPG: F9BFE0C2480E7680 1AE53631CB32A107 88C3A5A5
http://gozer.ectoplasm.org/   m/gozer\@(apache|cpan|ectoplasm)\.org/



signature.asc
Description: OpenPGP digital signature


Re: Is Apache2::Layout compatible with Apache 2.2.XX ?

2010-04-16 Thread Philippe M. Chiasson
On 10-03-25 17:36 , Rafael Caceres wrote:
 Hi All,
 
 I am migrating a server from apache 1.3 with mod_perl1 to apache 2.2.x
 with mod_perl2. The Apache2::Layout module used usefull as a
 replacement/starting-point for getting Apache::Sandwich functionality.
 The Apache2::Layout module compiles, but the test results in core dumps.
 Is this module compatible with apache 2.2.x ?

It should be, if something core dumps, that's not good. Can you provide
more debugging information ?

-- 
Philippe M. Chiasson GPG: F9BFE0C2480E7680 1AE53631CB32A107 88C3A5A5
http://gozer.ectoplasm.org/   m/gozer\@(apache|cpan|ectoplasm)\.org/



signature.asc
Description: OpenPGP digital signature


Re: [RELEASE CANDIDATE] Apache-Test-1.31 RC2

2010-02-09 Thread Philippe M. Chiasson
On 10-02-09 16:30 , Fred Moyer wrote:
 Greetings,
 
 Please, download, test, and report back on success or failure for this
 Apache::Test release candidate.
 
 Development from 1.30 has been ongoing for about two years, so this is
 as good a time as ever to make a release.
 
 http://people.apache.org/~phred/Apache-Test-1.31-rc2.tar.gz

Passes all tests on OSX/10.6 Apache/2.2.13/prefork mod_perl/2.0.4
Perl/v5.10.0

One small nit, not sure why, but t/next_available_port.t was modified
and will only be run if mod_cgi *and* mod_cgid is installed, which is
not very likely. Shouldn't this be what it does instead ?

diff -rdu Apache-Test-1.31-rc2/t/next_available_port.t
Apache-Test-1.31-rc2.test/t/next_available_port.t
--- Apache-Test-1.31-rc2/t/next_available_port.t2009-04-18
05:59:26.0 -0400
+++ Apache-Test-1.31-rc2.test/t/next_available_port.t   2010-02-09
21:20:26.0 -0500
@@ -7,8 +7,7 @@
 use Apache::TestRequest;
 use Apache::TestUtil;

-plan tests = 1, need need_module('mod_cgi.c'),
- need_module('mod_cgid.c'),
+plan tests = 1, need need_cgi,
  need_module('mod_env.c');

 my $url = '/cgi-bin/next_available_port.pl';


Looking at Changes, I can see

Use need_module('mod_cgi.c') and need_module('mod_cgid.c') in
t/next_available_port.t instead of need_cgi.  On case insensitive file
systems such as OS X, need_cgi will fulfill the requirement with cgi.pm,
when mod_cgi.c is the desired requirement.
[Fred Moyer ph...@apache.org]

Wouldn't the correct solution be to fix need_cgi then :

diff -ru Apache-Test-1.31-rc2.test/blib/lib/Apache/Test.pm
Apache-Test-1.31-rc2/blib/lib/Apache/Test.pm
--- Apache-Test-1.31-rc2.test/blib/lib/Apache/Test.pm   2010-02-09
13:21:39.0 -0500
+++ Apache-Test-1.31-rc2/blib/lib/Apache/Test.pm2010-02-09
21:27:47.0 -0500
@@ -348,7 +348,7 @@
 }

 sub need_cgi {
-return _need_multi(qw(cgi cgid));
+return _need_multi(qw(cgi.c cgid.c));
 }

-- 
Philippe M. Chiasson GPG: F9BFE0C2480E7680 1AE53631CB32A107 88C3A5A5
http://gozer.ectoplasm.org/   m/gozer\@(apache|cpan|ectoplasm)\.org/



signature.asc
Description: OpenPGP digital signature


Re: PerlOptions +Parent

2010-02-08 Thread Philippe M. Chiasson
On 10-02-01 06:32 , Torsten Förtsch wrote:
 On Monday 01 February 2010 11:48:19 Carl Johnstone wrote:
 So rather than +Parent which just gives a VirtualHost a separate instance
  -  what would be nice would be some way of specifying which perl instance
  to use in this VirtualHost. Something like:

 VirtualHost *
 ServerName www.example1.com
 PerlInstance myappv4
 /VirtualHost

 VirtualHost *
 ServerName www.example2.com
 PerlInstance myappv4
 /VirtualHost

 Feasible by patching modperl's interpreter pool handling.

Yes. and mod_python, IIRC, has such a mechanism. Might be worth
implementing, if there is a use for it.

 But how about using several apache instances and a mod_proxy-based proxy in 
 front to pass the requests to the appropriate instance? This can be 
 implemented without patching modperl.

That solution would also be my choice.

-- 
Philippe M. Chiasson GPG: F9BFE0C2480E7680 1AE53631CB32A107 88C3A5A5
http://gozer.ectoplasm.org/   m/gozer\@(apache|cpan|ectoplasm)\.org/



signature.asc
Description: OpenPGP digital signature


Re: seg fault in modperl_perl_global_request_save

2009-12-31 Thread Philippe M. Chiasson
On 09-12-31 12:52 , Alex Aminoff wrote:
 
 Most certainly, yes.  A stack trace without debugging symbols is not
 very useful in trying to pin down the source of a segfault bug.
 
 OK, I compiled mod_perl with MP_DEBUG and MP_TRACE, and
 got apache to produce a core dump (kern.sugid_coredump=1 appears to be
 needed on FreeBSD):
 
 (gdb) bt
 #0  0x28384eb4 in strncpy () from /lib/libc.so.7


 #1  0x287af9ee in modperl_perl_global_avcv_clear ()
from /usr/local/libexec/apache22/mod_perl.so
 #2  0x287afacf in modperl_perl_global_avcv_clear ()
from /usr/local/libexec/apache22/mod_perl.so


That's odd, modperl_perl_global_avcv_clear should not be able to call
itself. It looks like you don't have debugging symbols for mod_perl
itself, could you get that as well, as it would show me a little bit
more as to what's being double-freed, looks like.

Also, you can just try and run your test case with MOD_PERL_TRACE='g' in
your environment ? It turns on global handling debugging output.
error_log would contain information about what is going on in more details.

-- 
Philippe M. Chiasson GPG: F9BFE0C2480E7680 1AE53631CB32A107 88C3A5A5
http://gozer.ectoplasm.org/   m/gozer\@(apache|cpan|ectoplasm)\.org/



signature.asc
Description: OpenPGP digital signature


Re: seg fault in modperl_perl_global_request_save

2009-12-30 Thread Philippe M. Chiasson
On 09-12-30 16:28 , Alex Aminoff wrote:
 
 1. Problem Description:
 
 Our production apache22/mod_perl2 web server segfaults regularly. I
 have tracked down this problem as much as I can, and could use some
 help. This is running on FreeBSD; the same problem occurs on FreeBSD
 7.0, 7.2, and 8.0. apache22 is installed from ports, with WITH_DEBUG
 and WITH_EXECPTION_HOOK; mod_perl2 is installed from ports, my
 attempts to compile it with debug flags appear so far to be
 unsuccessful. (detailed version info below)
 
 For no reason I can fathom, I can not seem to get apache to dump core
 when it seg faults. I've set CoreDumpDirectory, I've set ulimit
 coredumpsize, nothing.  No matter; I was able to install
 mod_whatkilledus and mod_backtrace.
 
 mod_whatkilledus shows that the segfaults happen on a wide variety of
 requests; most requests to our main web server are handled by
 mod_perl, either with a ResponseHandler or a FilterHandler.
 
 mod_backtrace shows that the seg fault is always happening in
 modperl_perl_global_request_save:
 
 [Wed Dec 30 15:05:41 2009] pid 6955 mod_backtrace backtrace for sig 11
 (thread pid 6955)
 [Wed Dec 30 15:05:41 2009] pid 6955 mod_backtrace main() is at 8063880
 0x8085a26 ap_run_fatal_exception+70 at /usr/local/sbin/httpd
 0x808752e ap_mpm_set_exception_hook+238 at /usr/local/sbin/httpd
 0x8087569 ap_mpm_set_exception_hook+297 at /usr/local/sbin/httpd
 0xbfbfffb4
 0x287a83c5 modperl_perl_global_request_save+213 at
 /usr/local/libexec/apache22/mod_perl.so
 0x2879982d modperl_response_handler_cgi+141 at
 /usr/local/libexec/apache22/mod_perl.so
 0x807bc66 ap_run_handler+70 at /usr/local/sbin/httpd
 ...
 
 So, any general pointers for what direction to go next would be
 appreciated. I would like to have mod_backtrace tell me what in my
 perl code is triggering the error, in which case I could work around
 it. Should I continue to pursue recompiling mod_perl2 and possibly
 perl itself with more debugging turned on?

Most certainly, yes.  A stack trace without debugging symbols is not
very useful in trying to pin down the source of a segfault bug.

-- 
Philippe M. Chiasson GPG: F9BFE0C2480E7680 1AE53631CB32A107 88C3A5A5
http://gozer.ectoplasm.org/   m/gozer\@(apache|cpan|ectoplasm)\.org/



signature.asc
Description: OpenPGP digital signature


Re: Changing apache config with mod_perl, doesnt work!

2009-11-22 Thread Philippe M. Chiasson
On 09-11-22 17:42 , Devrim Yasar wrote:
 This script supposedly should take * out of *.domain.com, assign it to
 $subdomain variable, and $subdomain should be put to AssignUserId.
 
 However, no matter how hard I try, I can't get this to work. I've been
 working on this for days, and am really desperate. If you think this is
 a lot of work, please charge me consultancy and come get the root passwd.
 
 Any ideas though? Thanks...
 
 |Perl
  Use Apache2::ServerRec qw//; 
  use Apache2::ServerUtil qw//; 
  use Apache2::RequestRec qw//; 
  use Apache2::RequestUtil qw//; 
  use Apache2::Const qw/OK DECLINED/; 
 
  my $s = Apache2::ServerUtil-server; 
 
  $s-push_handlers(PerlHeaderParserHandler = sub { my($r) = @_; 

From a quick glance at the mpm-itk source-code, it does its magic in at
the headerparsing phase, so your attempt at using that phase to alter
it's behaviour was a good one.

 /* set the uid as fast as possible, but not before merging per-dit
config */
 ap_hook_header_parser(itk_post_perdir_config, NULL, NULL,
APR_HOOK_REALLY_FIRST);

Unfortunately, it seems to pick APR_HOOK_REALLY_FIRST as precedence,
which makes it run /before/ your code, in the same phase. So, even
though you actually succeed at changing it's run-time configuration, you
do it too late, and it doesn't even look at it.

  if ( $r-hostname =~ m/(.*)\.([^.]+\.\w+)$/ ) { 
  my($subdomain,$domain) = ($1,$2); 
 
  #
  # THIS WORKS!
  # ---
  # if requested domain is fio.domain.com http://fio.domain.com/,
  # this successfully assigns ServerAdmin f...@domain.com 
 mailto:f...@domain.com
  # so gathering domain parts working
 
  $r-server-server_admin($subdoma...@$domain);

Yes, as expected, and it uses a published API to do that.

  #
  # THIS DOESN'T!
  # --
  # this is supposed to insert this line inside Virtual host
  # --
  # IfModule mpm_itk_module AssignUserId fio domain/IfModule
  # --
 
  $r-add_config([ IfModule mpm_itk_module, 
  AssignUserId $subdomain $domain, 
  /IfModule, 
  ]); 
 

Except for my above explanation, this would work just fine. I would
however caution about using this kind of mechanism to alter run-time
configuration on a per-request basis. This comes at a non-negligable
performance impact, if that's important to your usage scenario.

Ideally, like in the server_admin() case outlined above, mpm-itk
could/should expose an API to allow for changing the userid/domain.

You could try and use PerlMapToStorageHandler as your phase, since it
happens before the PerlHeaderParserHandler phase.

-- 
Philippe M. Chiasson GPG: F9BFE0C2480E7680 1AE53631CB32A107 88C3A5A5
http://gozer.ectoplasm.org/   m/gozer\@(apache|cpan|ectoplasm)\.org/



signature.asc
Description: OpenPGP digital signature


Re: _apr_bucket_shared_copy symbol not found

2009-11-16 Thread Philippe M. Chiasson

On 09-11-14 14:43 , Fred Moyer wrote:

Platform:  Snow Leopard

Versions used:  perl 5.10.1, mod_perl 2.0.5-dev, httpd 2.2.14

Error found during make test:

t/apr-ext/uuid.t  Can't load
'/Users/phred/dev/svn/modperl/mod_perl-2.0/blib/arch/auto/APR/APR.bundle'
for module APR:
dlopen(/Users/phred/dev/svn/modperl/mod_perl-2.0/blib/arch/auto/APR/APR.bundle,
9): Symbol not found: _apr_bucket_shared_copy

I compiled apache using the --with-included-apr option.  This is a new
toolchain setup.  Any thoughts?


Can you send me the exact version of httpd you built, and with what 
arguments?
mod_perl Makefile.PL arguments too. I just upgraded to Snow Leopard, so 
I should be able to try and reproduce.


--
Philippe M. Chiasson GPG: F9BFE0C2480E7680 1AE53631CB32A107 88C3A5A5
http://gozer.ectoplasm.org/   m/gozer\@(apache|cpan|ectoplasm)\.org/


Re: Getting domain info on each hit.

2009-11-16 Thread Philippe M. Chiasson
On 09-11-16 13:54 , Devrim Yasar wrote:
 Hi,
 
 We want to retrieve URL and use it inside our vhosts, realtime.
 
 To demonstrate my case, I placed random numbers on ServerAdmin directive
 (just to test),
 
 Perl
 $ServerAdmin = int(rand(100)).lo...@koko.com;
 /Perl
 
 
 
 
 As you may know, this random number is assigned only when you restart
 the server, and never changes until another restart.
 
 This is what we want: 
 
 if julie.myperl.com http://julie.myperl.com/ is the requested domain,
 then $ServerAdmin = ju...@myperl.com mailto:ju...@myperl.com, that is,
 realtime.
 
 Hopefully there is a solution, since this will help us remove thousands
 of config files, and save us from thousands of apache reloads.

Something like this is probably what you are looking like

$r-server-server_hostname;
$r-server-server_admin('ju...@myperl.com');

Read from here:

http://perl.apache.org/docs/2.0/api/Apache2/ServerRec.html#C_server_admin_

-- 
Philippe M. Chiasson GPG: F9BFE0C2480E7680 1AE53631CB32A107 88C3A5A5
http://gozer.ectoplasm.org/   m/gozer\@(apache|cpan|ectoplasm)\.org/



signature.asc
Description: OpenPGP digital signature


Re: Apache::Registry executing scripts multiple times

2009-11-05 Thread Philippe M. Chiasson
On 09-11-04 17:58 , Dave Morgan wrote:
 Hi All,
   Please forgive me if the answer is in the docs, I looked without 
 success.
 I have a very simple index_test.pl script which appears to get called by 
 Apache::Registry
 multiple times. I have tested in single server mode (httpd -X) and still get 
 the same
 results. The output is correct but the error_log shows multiple calls from the
 Apache::Registry module. While this simple program appears to get called 5 
 times
 our big one was only getting called twice, however, that did have a very 
 noticeable
 effect on response time.
 
 We have also removed the Apache::Reload module without effect.
 
 Any ideas, pointers or help appreciated
 
 Dave
 ###
 Environment:
   Apache 1.3.37
   mod-perl 1.30
   perl 5.8.8
 
 Relevent httpd.conf section:
 
 ScriptAlias /metapoint/ /home/tomcat/metapoint/trunk/
 Directory /home/tomcat/metapoint/trunk
 AllowOverride None
 SetHandler perl-script
   PerlInitHandler Apache::Reload
 PerlHandler Apache::Registry
 Options ExecCGI
 Order allow,deny
 Allow from all
 /Directory
 
 
 index_test.pl:
 
 our $i;

our ? shouldn't that be my ? our makes that variable a package global,
so it will stick around between requests, just like $some::package::name
would.

-- 
Philippe M. Chiasson GPG: F9BFE0C2480E7680 1AE53631CB32A107 88C3A5A5
http://gozer.ectoplasm.org/   m/gozer\@(apache|cpan|ectoplasm)\.org/



signature.asc
Description: OpenPGP digital signature


Re: Debugging seg faults in Apache mod_perl

2009-08-17 Thread Philippe M. Chiasson
On 17/08/09 19:54 , James Smith wrote:
 
 Futher to this I now have a stack trace if that helps anyone point me in
 the right direction:
 
 #0  0x7f17ee936fb1 in strncpy () from /lib/libc.so.6
 #1  0x7f17e808ecfc in modperl_perl_global_request_save () from
   /usr/lib/apache2/modules/mod_perl.so

That's hapenning in a fairly simple piece of code:

modperl_perl_global_svpv_save(pTHX_ modperl_perl_global_svpv_t *svpv)
{
svpv-cur = SvCUR(*svpv-sv);
strncpy(svpv-pv, SvPVX(*svpv-sv), sizeof(svpv-pv));
}

Looking at this, is there any chance you can get a mod_perl with
debugging symbols running this and post the content of :

*svpv
*(svpv-pv)
*(svpv-sv)

But looking at the guts, the only code path that will invoke this is
when saving/restoring the value of $/...  Can you check to see what part
of your code alters that variable and to what ?

It might point to something interesting.

 #2  0x7f17e807dabc in modperl_response_handler_cgi () from
   /usr/lib/apache2/modules/mod_perl.so
 #3  0x7f17ef7272d3 in ap_run_handler () from /usr/sbin/apache2
 #4  0x7f17ef72aa6f in ap_invoke_handler () from /usr/sbin/apache2
 #5  0x7f17ef7385de in ap_process_request () from /usr/sbin/apache2
 #6  0x7f17ef735418 in ?? () from /usr/sbin/apache2
 #7  0x7f17ef72eca3 in ap_run_process_connection () from
   /usr/sbin/apache2
 #8  0x7f17ef73cf46 in ?? () from /usr/sbin/apache2
 #9  0x7f17ef73d276 in ?? () from /usr/sbin/apache2
 #10 0x7f17ef73ddad in ap_mpm_run () from /usr/sbin/apache2
 #11 0x7f17ef71360d in main () from /usr/sbin/apache2
 
 
 On Mon, 17 Aug 2009, James Smith wrote:
 

 I have two handlers, one a response handler and a second an output
 filter.
 If either of these handlers run then they run fine for any number of
 requests, if I have both of these handlers I get an untraceable seg fault
 with the handlers, this segfault happens on the second request to that
 particular child.

 If the page is generated from:

 * the file system,
 * via mod_php or
 * mod_rails I don't have a problem

 If the page content is generated by mod_perl it works perfectly well for
 the first request - but fails for subsequent requests.

 [notice] child pid 14475 exit signal Segmentation fault (11)

 This appears to be before the page handler executes...

 If I turn off the output filter - everything is OK for all requests.

 Any suggestions on how I debug this... it makes life so much easier if
 I can handle all requests this way (and it seems to be the apache way)

 James


 -- 
 The Wellcome Trust Sanger Institute is operated by Genome Research
 Limited, a charity registered in England with number 1021457 and a
 company registered in England with number 2742969, whose registered
 office is 215 Euston Road, London, NW1 2BE.
 
 


-- 
Philippe M. Chiasson GPG: F9BFE0C2480E7680 1AE53631CB32A107 88C3A5A5
http://gozer.ectoplasm.org/   m/gozer\@(apache|cpan|ectoplasm)\.org/



signature.asc
Description: OpenPGP digital signature


Re: Debugging seg faults in Apache mod_perl

2009-08-17 Thread Philippe M. Chiasson
On 17/08/09 21:48 , Philippe M. Chiasson wrote:
 On 17/08/09 19:54 , James Smith wrote:

 Futher to this I now have a stack trace if that helps anyone point me in
 the right direction:

 #0  0x7f17ee936fb1 in strncpy () from /lib/libc.so.6
 #1  0x7f17e808ecfc in modperl_perl_global_request_save () from
   /usr/lib/apache2/modules/mod_perl.so
 
 That's hapenning in a fairly simple piece of code:
 
 modperl_perl_global_svpv_save(pTHX_ modperl_perl_global_svpv_t *svpv)
 {
 svpv-cur = SvCUR(*svpv-sv);
 strncpy(svpv-pv, SvPVX(*svpv-sv), sizeof(svpv-pv));
 }
 
[...]
 
 But looking at the guts, the only code path that will invoke this is
 when saving/restoring the value of $/...  Can you check to see what part
 of your code alters that variable and to what ?

Just had an idea, can't verify or test it right now, but I suspect this
might be caused by:

$/ = undef;

Could you have one of these lying around in your code somewhere ?

If so, can you try and change it to the usually recommended form:

local $/ = undef;

Hope this helps.

-- 
Philippe M. Chiasson GPG: F9BFE0C2480E7680 1AE53631CB32A107 88C3A5A5
http://gozer.ectoplasm.org/   m/gozer\@(apache|cpan|ectoplasm)\.org/



signature.asc
Description: OpenPGP digital signature


Re: graceful restarts, modperl and pre-loaded modules

2009-07-14 Thread Philippe M. Chiasson
On 14/07/09 14:04 , E R wrote:
 Hi,
 
 I was wondering how graceful restarts of apache interact with modperl
 and pre-loaded modules.
 
 Specifically, if the apache parent process loads module Foo.pm, and I
 modify Foo.pm, can I use a graceful restart to get the apache parent
 to read the new version of Foo.pm?

Yes, it should work that way.

On a gracefull restart, all perl interpreters are shutdown and new,
clean ones replace them, reloading any module you configure for preloading.

-- 
Philippe M. Chiasson GPG: F9BFE0C2480E7680 1AE53631CB32A107 88C3A5A5
http://gozer.ectoplasm.org/   m/gozer\@(apache|cpan|ectoplasm)\.org/



signature.asc
Description: OpenPGP digital signature


Re: graceful restarts, modperl and pre-loaded modules

2009-07-14 Thread Philippe M. Chiasson
On 14/07/09 15:00 , Perrin Harkins wrote:
 On Tue, Jul 14, 2009 at 2:36 PM, Philippe M.
 Chiassongo...@ectoplasm.org wrote:
 On a gracefull restart, all perl interpreters are shutdown and new,
 clean ones replace them, reloading any module you configure for preloading.
 
 I don't think this is right, Philippe, unless something has changed
 with it in mod_perl 2. 

Yup, this has certainly been fixed up in mod_perl 2.

 Graceful restart used to just re-read the
 conf, not restart the perl interpreter.

Now I believe it does, and it's easy to verify.

A loaded PerlModule will get reloaded on graceful restart, that's for sure.

-- 
Philippe M. Chiasson GPG: F9BFE0C2480E7680 1AE53631CB32A107 88C3A5A5
http://gozer.ectoplasm.org/   m/gozer\@(apache|cpan|ectoplasm)\.org/



signature.asc
Description: OpenPGP digital signature


Re: Apache::Bootstrap 0.07-rc1 available for testing

2009-07-09 Thread Philippe M. Chiasson
On 09/07/09 18:18 , Fred Moyer wrote:
 I'd love it if you could take this rc for a spin and report back.  Passing
 all tests on OS X 10.5, 5.8.8, 2.2.6
 and Centos 5.2, 5.8.9, 2.2.8.

Works on my OS X Leopard box with system and darwinports perl.

$ prove -b t ; /usr/bin/prove -b t
t/00-load.ok 1/11# bootstrapping mp1 only

# bootstrapping mp2 only
mod_perl2 not present, cannot bootstrap mp2 at
blib/lib/Apache/Bootstrap.pm line 121.
# Testing Apache::Bootstrap 0.07-rc1, Perl 5.008008, /opt/local/bin/perl
t/00-load.ok

7/11 skipped: various reasons
t/pod-coverageok

t/pod.ok

All tests successful, 7 subtests skipped.
Files=3, Tests=13,  1 wallclock secs ( 0.22 cusr +  0.05 csys =  0.27 CPU)
t/00-load.t ... 1/11 # bootstrapping mp1 only
mod_perl not present, cannot bootstrap mp1 at
/Users/gozer/tmp/Apache-Bootstrap-0.07-rc1/blib/lib/Apache/Bootstrap.pm
line 96.
# bootstrapping mp2 only
# Testing Apache::Bootstrap 0.07-rc1, Perl 5.008008, /usr/bin/perl
Apache::Test version is 1.30, minimum version required is 1.31, tests
will be skipped
t/00-load.t ... ok
t/pod-coverage.t .. ok
t/pod.t ... ok
All tests successful.
Files=3, Tests=13,  0 wallclock secs ( 0.03 usr  0.01 sys +  0.40 cusr
0.06 csys =  0.50 CPU)
Result: PASS

+1

-- 
Philippe M. Chiasson GPG: F9BFE0C2480E7680 1AE53631CB32A107 88C3A5A5
http://gozer.ectoplasm.org/   m/gozer\@(apache|cpan|ectoplasm)\.org/



signature.asc
Description: OpenPGP digital signature


Re: Running CGI scripts after mod_perl.

2009-06-26 Thread Philippe M. Chiasson
-BEGIN PGP SIGNED MESSAGE-
Hash: SHA1

On 25/06/09 17:51 , Anthony R Fletcher wrote:
 I have a mod_perl 2 module, running in Apache 2.2,
 
 -
 package Apache2::;
 
 use 5;
 use strict;
 
 use Apache2::Const -compile = qw(DECLINED);
 
 sub handler
 {
 return Apache2::Const::DECLINED;
 }
 
 
 1;
 -
 
 and this is enabled in a .htaccess file via
 
   SetHandler modperl
   PerlResponseHandler Apache2::
 
 Without the .htaccess config above CGI scripts run fine. With the above
 the actual script is returned.

That's because of 'SetHandler modperl'

When you use that, you are telling apache definitively that modperl
should be used to handle this request. When you return DECLINED, all
apache is left with is to fallback to the default handler, and that
serves static files.

 How do I get Apache to process the .cgi scripts as CGI scripts and not
 as just text files?

sub handler {
my $r = shift;
# Whatever logic to decide if it should be a cgi or not...
if ($r-filename =~ /\.cgi$/) {
$r-handler('cgi-script');
}
return Apache2::Const::DECLINED;
}
-BEGIN PGP SIGNATURE-
Version: GnuPG v1.4.7 (Darwin)
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org/

iD8DBQFKRScRyzKhB4jDpaURAmyGAJ0bKo9u7cdR1/pDnQTCB7QnL1PLWwCdE6Sf
BPnLzdh3OekzzvKsR/cXWII=
=2RHI
-END PGP SIGNATURE-


Re: Running CGI scripts after mod_perl.

2009-06-26 Thread Philippe M. Chiasson
-BEGIN PGP SIGNED MESSAGE-
Hash: SHA1

On 26/06/09 15:55 , Perrin Harkins wrote:
 On Thu, Jun 25, 2009 at 5:51 PM, Anthony R Fletchera...@mail.nih.gov wrote:
 I have a mod_perl 2 module, running in Apache 2.2,

 -
 package Apache2::;

 use 5;
 use strict;

 use Apache2::Const -compile = qw(DECLINED);

 sub handler
 {
return Apache2::Const::DECLINED;
 }


 1;
 -

 and this is enabled in a .htaccess file via

SetHandler modperl
PerlResponseHandler Apache2::

 Without the .htaccess config above CGI scripts run fine. With the above
 the actual script is returned.
 
 Hmm.  Why are you doing this?  It's not clear what you're really trying to do.
 
 If you want to change which module does the response handler phase,
 you can do that, and you should be able to set it to be the
 cgi-handler module, but I don't think you can do it when you're
 already in the response handler phase.

Yes, so my previous suggestion is most likely no good. It's sort of too
late indeed, once a content handler has been entered.
-BEGIN PGP SIGNATURE-
Version: GnuPG v1.4.7 (Darwin)
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org/

iD8DBQFKRSkbyzKhB4jDpaURArs/AKCwYDGegAmvQml1MpUaJF2LYQBEtwCfb8ET
6OE0366ojElzWlrg/GQPN2M=
=IZvN
-END PGP SIGNATURE-


Re: mod_perl 1.0 Compilation on Linux Ubuntu

2009-06-17 Thread Philippe M. Chiasson
-gnu/4.3.3/:/usr/lib/gcc/i486-linux-gnu/4.3.3/../../../../lib/:/lib/../lib/:/usr/lib/../lib/:/usr/lib/gcc/i486-linux-gnu/4.3.3/../../../:/lib/:/usr/lib/
 COLLECT_GCC_OPTIONS='-v' '-DLINUX=22' '-DMOD_PERL' '-DUSE_PERL_SSI' 
 '-D_REENTRANT' '-DDEBIAN' '-pipe' '-I/usr/local/include' 
 '-D_LARGEFILE_SOURCE' '-D_FILE_OFFSET_BITS=64' '-DUSE_HSREGEX' 
 '-DNO_DL_NEEDED' '-D_REENTRANT' '-DDEBIAN' '-fno-strict-aliasing' '-pipe' 
 '-I/usr/local/include' '-D_LARGEFILE_SOURCE' '-D_FILE_OFFSET_BITS=64' 
 '-DHTTPD_ROOT=/usr/local/apache' 
 '-DSUEXEC_BIN=/usr/local/apache/bin/suexec' 
 '-DSHARED_CORE_DIR=/usr/local/apache/libexec' 
 '-DDEFAULT_PIDLOG=logs/httpd.pid' 
 '-DDEFAULT_SCOREBOARD=logs/httpd.scoreboard' 
 '-DDEFAULT_LOCKFILE=logs/httpd.lock' '-DDEFAULT_ERRORLOG=logs/error_log' 
 '-DTYPES_CONFIG_FILE=conf/mime.types' 
 '-DSERVER_CONFIG_FILE=conf/httpd.conf' 
 '-DACCESS_CONFIG_FILE=conf/access.conf' 
 '-DRESOURCE_CONFIG_FILE=conf/srm.conf' '-I.' '-I/usr/lib/perl/5.10/CORE' 
 '-o' 'helpers/dummy' '-L/usr/local/lib' '-L/usr/lib/perl/5.10/CORE' 
 '-mtune=generic'
  /usr/lib/gcc/i486-linux-gnu/4.3.3/collect2 --eh-frame-hdr -m elf_i386 
 --hash-style=both -dynamic-linker /lib/ld-linux.so.2 -o helpers/dummy -z 
 relro /usr/lib/gcc/i486-linux-gnu/4.3.3/../../../../lib/crt1.o 
 /usr/lib/gcc/i486-linux-gnu/4.3.3/../../../../lib/crti.o 
 /usr/lib/gcc/i486-linux-gnu/4.3.3/crtbegin.o -L/usr/local/lib 
 -L/usr/lib/perl/5.10/CORE -L/usr/lib/gcc/i486-linux-gnu/4.3.3 
 -L/usr/lib/gcc/i486-linux-gnu/4.3.3 
 -L/usr/lib/gcc/i486-linux-gnu/4.3.3/../../../../lib -L/lib/../lib 
 -L/usr/lib/../lib -L/usr/lib/gcc/i486-linux-gnu/4.3.3/../../.. 
 /tmp/ccw05Poa.o -lm -E -lperl -ldl -lm -lpthread -lc -lcrypt -lgcc 
 --as-needed -lgcc_s --no-as-needed -lc -lgcc --as-needed -lgcc_s 
 --no-as-needed /usr/lib/gcc/i486-linux-gnu/4.3.3/crtend.o 
 /usr/lib/gcc/i486-linux-gnu/4.3.3/../../../../lib/crtn.o
 h...@energy:~/Desarrollo de Software/apache_1.3.39/src$
 
 
 Thanks
 Hans
 
 - Philippe M. Chiasson go...@ectoplasm.org escribió:
 
 On 17/06/09 11:08 , h...@welinux.cl wrote:
 Hi,

 I'm having trouble compiling mod_perl on latest ubuntu (Jaunty),
 i've tried the latest version of mod_perl: 1.31 and apache: 1.3.41
 without success, then i downgraded to some older versions once i was
 able to build: mod_perl.1.30 and apache 1.3.39, without success too.

 The problem is that after doing perl Makefile.PL DO_HTTPD=1
 USE_APACI=1 EVERYTHING=1

 I get the following error:

 ** A test compilation with your Makefile configuration
 ** failed.  The below error output from the compilation
 ** test will give you an idea what is failing. Note that
 ** Apache requires an ANSI C Compiler, such as gcc. 

  Error Output for sanity check 
 cd ..; cc  -DLINUX=22 -DMOD_PERL -DUSE_PERL_SSI -D_REENTRANT 
 -DDEBIAN -fno-strict-aliasing -pipe -I/usr/local/include
 -D_LARGEFILE_SOURCE -D_FILE_OFFSET_BITS=64 -DUSE_HSREGEX
 -DNO_DL_NEEDED -D_REENTRANT -DDEBIAN -fno-strict-aliasing -pipe
 -I/usr/local/include -D_LARGEFILE_SOURCE -D_FILE_OFFSET_BITS=64
 `./apaci` -I. -I/usr/lib/perl/5.10/CORE-o helpers/dummy
 helpers/dummy.c   -lm -Wl,-E  -L/usr/local/lib 
 -L/usr/lib/perl/5.10/CORE -lperl -ldl -lm -lpthread -lc -lcrypt 

 Have you tried running that cc command directly and see what happens
 ?

 Sounds like the compiler is failing and we are not capturing the
 reason somehow.

 -- 
 Philippe M. Chiasson GPG: F9BFE0C2480E7680 1AE53631CB32A107
 88C3A5A5
 http://gozer.ectoplasm.org/  
 m/gozer\@(apache|cpan|ectoplasm)\.org/
 

-- 
Philippe M. Chiasson GPG: F9BFE0C2480E7680 1AE53631CB32A107 88C3A5A5
http://gozer.ectoplasm.org/   m/gozer\@(apache|cpan|ectoplasm)\.org/



signature.asc
Description: OpenPGP digital signature


Re: svn commit: r781917 - in /perl/modperl/branches/1.x: Changes src/modules/perl/mod_perl.c

2009-06-05 Thread Philippe M. Chiasson


On 05/06/09 01:57 , pgollu...@apache.org wrote:
 Author: pgollucci
 Date: Fri Jun  5 05:57:17 2009
 New Revision: 781917
 
 URL: http://svn.apache.org/viewvc?rev=781917view=rev
 Log:
 Address FreeBSD PR: ports/134749
 
 This is actually a bug in gcc 4.2.1?x where
 the array is optimized incorrectly causing
 sefaults during startup.
 
 Apparently the bug does not exist in FreeBSD 8
 but is an issue in 7.x.
 
 Reported by:Troy t...@twisted.net
 Submitted by:   Tim Zingelman zingel...@fnal.gov
 Reviewed by:myself
 
 
 Modified:
 perl/modperl/branches/1.x/Changes
 perl/modperl/branches/1.x/src/modules/perl/mod_perl.c
 
 Modified: perl/modperl/branches/1.x/Changes
 URL: 
 http://svn.apache.org/viewvc/perl/modperl/branches/1.x/Changes?rev=781917r1=781916r2=781917view=diff
 ==
 --- perl/modperl/branches/1.x/Changes (original)
 +++ perl/modperl/branches/1.x/Changes Fri Jun  5 05:57:17 2009
 @@ -10,6 +10,10 @@
  
  =item 1.32-dev
  
 +Work around a gcc optimization specific bug which
 +cuased seg faults on FreeBSD 7.x during mod_perl startup.
 +[Tim Zingelman zingel...@fnal.gov]
 +
  =item 1.31 May 11, 2009
  
  Fix static APACI build on Mac OS X. [Gozer]
 
 Modified: perl/modperl/branches/1.x/src/modules/perl/mod_perl.c
 URL: 
 http://svn.apache.org/viewvc/perl/modperl/branches/1.x/src/modules/perl/mod_perl.c?rev=781917r1=781916r2=781917view=diff
 ==
 --- perl/modperl/branches/1.x/src/modules/perl/mod_perl.c (original)
 +++ perl/modperl/branches/1.x/src/modules/perl/mod_perl.c Fri Jun  5 05:57:17 
 2009
 @@ -596,6 +596,7 @@
  void perl_startup (server_rec *s, pool *p)
  {
  char *argv[] = { NULL, NULL, NULL, NULL, NULL, NULL, NULL };
 +char **temp_argv=argv;

Small nit, shouldn't it be :
char **temp_args = argv;

Also, feels like that bit of code needs a warning/comment to explain why
it's there, otherwise, it's tempting to optimize/clean it away.

-- 
Philippe M. Chiasson GPG: F9BFE0C2480E7680 1AE53631CB32A107 88C3A5A5
http://gozer.ectoplasm.org/   m/gozer\@(apache|cpan|ectoplasm)\.org/



signature.asc
Description: OpenPGP digital signature


Re: Environment variable problem in mod_perl 2

2009-06-03 Thread Philippe M. Chiasson
On 03/06/09 02:58 , Scott Gifford wrote:
 [ also posted on PerlMonks ]
 
 I'm working on porting some code that's been running on mod_perl 1 for
 a very long time to mod_perl 2. Mostly things have gone smoothly, but
 I'm having trouble with environment variables. Sometimes my scripts go
 off and run other scripts, and expect to be able to set things like
 $ENV{PATH} for the child processes. However, for some reason under
 mod_perl 2, my environment variables aren't getting passed to child
 processes! Quite bizarre.

Have you tried using $r-subprocess_env ?

http://perl.apache.org/docs/2.0/api/Apache2/RequestRec.html#C_subprocess_env_

-- 
Philippe M. Chiasson GPG: F9BFE0C2480E7680 1AE53631CB32A107 88C3A5A5
http://gozer.ectoplasm.org/   m/gozer\@(apache|cpan|ectoplasm)\.org/



signature.asc
Description: OpenPGP digital signature


Re: mod_perl content at ApacheCon US 2009 (and conferences in general)

2009-05-15 Thread Philippe M. Chiasson
On 23/04/09 13:31 , Adam Prime wrote:
 ApacheCon US is happen in Oakland CA this year from November 2nd to 6th,
 and the PMC's of the various projects are being given the opportunity to
 help organize content related to their projects.  In order for the PMC
 to do this effectively, it would be helpful to know what other people
 who are interested in mod_perl related content would find interesting,
 for ApacheCon specifically, as well as for conferences in general.  If
 you're interested in helping, please answer the following questions in
 an email to more (or to the list if you'd prefer):
 
 1) Do you plan to attend ApacheCon US this year?

I didn't specifically plan to, but if there was the possibility of a decent
Perl/mod_perl track, I'd probably try to attend+present.

 2) Do you play to attend any other Perl related conferences this year?

Not likely, no.

 3) What mod_perl related topics would you be interested in hearing talks
 about?

I am personally interested in new/wacky things done with mod_perl, serious
internals/guts stuff as well as possible future directions.

-- 
Philippe M. Chiasson GPG: F9BFE0C2480E7680 1AE53631CB32A107 88C3A5A5
http://gozer.ectoplasm.org/   m/gozer\@(apache|cpan|ectoplasm)\.org/



signature.asc
Description: OpenPGP digital signature


[ANNOUNCE] mod_perl 1.31

2009-05-12 Thread Philippe M. Chiasson
The uploaded file

mod_perl-1.31.tar.gz

has entered CPAN as

  file: $CPAN/authors/id/G/GO/GOZER/mod_perl-1.31.tar.gz
  size: 389960 bytes
   md5: d2188bf500e9f00cd78dc97c3fbf6b97

It's finally here! After quite a few release candidates, I am
happy to share with you all this new mod_perl release. Enjoy!

Changes since 1.30:

Fix static APACI build on Mac OS X. [Gozer]

Fix XSS vulnerability in Apache::Status reported by
Richard J. Brain, CVE-2009-0796
[Fred Moyer]

On Win32, mod_perl.h needs to include malloc.h before the perl
headers, at least when built with USE_ITHREADS
[Steve Hay]

Win32 needs PERL_SYS_INIT/PERL_SYS_TERM calls when built with
USE_ITHREADS [sic--that's different to USE_THREADS]. In fact,
they ought to be always called if they are defined
[Steve Hay]

Fix potential segfault when the environment contains
NULL values [Mike Schilli]

Fix static APACI build against newer apache-1.3.38+
[Gozer]

Fixed modules/regex.t test 4 on Win32
[Steve Hay]

Avoid possible segfault when PerlFreshRestart is On.
[Michael Rendell mich...@cs.mun.ca]

Prevent segfault when running with perl = 5.9.3
[Steve Hay]

Fix shared libary extensions on Win32 to be .dll not .so
[Nikolay Ananiev anan...@thegdb.com]

Patch to mod_perl.dsp to remove /D _WINSOCK2API_ on Win32
for perl = 5.8.6 [Steve Hay]

-- 
Philippe M. Chiasson GPG: F9BFE0C2480E7680 1AE53631CB32A107 88C3A5A5
http://gozer.ectoplasm.org/   m/gozer\@(apache|cpan|ectoplasm)\.org/



signature.asc
Description: OpenPGP digital signature


Re: Connection rate limiting with Apache2::ConnectionUtil pnotes

2009-05-12 Thread Philippe M. Chiasson
On 12/05/09 21:50 , Fred Moyer wrote:
 Greetings,
 
 I ran into an issue today where I had a load surge in my application
 server, so I looked around for a suitable throttling module and didn't
 see anything simple.

I personally have used mod_cband quite successfully for stuff like this,
give it a look.

Otherwise, nice solution! Especially if coded under the gun ;-)

Gozer out.

-- 
Philippe M. Chiasson GPG: F9BFE0C2480E7680 1AE53631CB32A107 88C3A5A5
http://gozer.ectoplasm.org/   m/gozer\@(apache|cpan|ectoplasm)\.org/



signature.asc
Description: OpenPGP digital signature


[RELEASE CANDIDATE] mod_perl-1.31 RC8

2009-05-10 Thread Philippe M. Chiasson
The mod_perl 1.31 release candidate 8 is ready. It can be downloaded here:

http://www.apache.org/~gozer/mp1/mod_perl-1.31-rc8.tar.gz

SHA1(mod_perl-1.31-rc8.tar.gz)= 36c0e59a374dbd490da061c6b45b8e11d1f80309
MD5(mod_perl-1.31-rc8.tar.gz)= 0c2808ccf669fea79760636e425f38b3

Please give it a spin in your favorite configuration and report
any problems. Especially needed against Perl-5.10 and on Windows.

The summary of what has changed since 1.30 are (from Changes):

Fix static APACI build on Mac OS X. [Gozer]

Fix XSS vulnerability in Apache::Status reported by
Richard J. Brain, CVE-2009-0796
[Fred Moyer]

On Win32, mod_perl.h needs to include malloc.h before the perl
headers, at least when built with USE_ITHREADS
[Steve Hay]

Win32 needs PERL_SYS_INIT/PERL_SYS_TERM calls when built with
USE_ITHREADS [sic--that's different to USE_THREADS]. In fact,
they ought to be always called if they are defined
[Steve Hay]

Fix potential segfault when the environment contains
NULL values [Mike Schilli]

Fix static APACI build against newer apache-1.3.38+
[Gozer]

Fixed modules/regex.t test 4 on Win32
[Steve Hay]

Avoid possible segfault when PerlFreshRestart is On.
[Michael Rendell mich...@cs.mun.ca]

Prevent segfault when running with perl = 5.9.3
[Steve Hay]

Fix shared libary extensions on Win32 to be .dll not .so
[Nikolay Ananiev anan...@thegdb.com]

Patch to mod_perl.dsp to remove /D _WINSOCK2API_ on Win32
for perl = 5.8.6 [Steve Hay]

-- 
Philippe M. Chiasson GPG: F9BFE0C2480E7680 1AE53631CB32A107 88C3A5A5
http://gozer.ectoplasm.org/   m/gozer\@(apache|cpan|ectoplasm)\.org/













signature.asc
Description: OpenPGP digital signature


Re: PerlIO :APR / apr_file_open() flag issue

2009-04-20 Thread Philippe M. Chiasson
On 20/04/09 19:59 , Marc Adkins wrote:
 Originally posted to the APR dev list.  The response (from jTrawick) was
 as follows:
 
 The Perl code that builds the apr_file_open() flags needs to turn on
 APR_WRITE.
 
 I think that this patch to mod_perl is what you need:
 
 --- modperl_apr_perlio.c.orig2007-12-31 02:39:50.0 -0500
 +++ modperl_apr_perlio.c2009-04-20 19:37:25.954107404 -0400
 @@ -85,7 +85,7 @@
  
  switch (*mode) {
case 'a':
 -apr_flag = APR_APPEND | APR_CREATE;
 +apr_flag = APR_WRITE | APR_CREATE | APR_APPEND;
  break;
case 'w':
  apr_flag = APR_WRITE | APR_CREATE | APR_TRUNCATE;
 

 The rest of this email is my original post.  I would still like a
 workaround is one exists.

Looks sensible to me. The only issue I could see is if APR_WRITE was
addeed at some point somewhat recently, and this change would break
against older APRs. Might need a version check of some sort.

Otherwise, +1

-- 
Philippe M. Chiasson GPG: F9BFE0C2480E7680 1AE53631CB32A107 88C3A5A5
http://gozer.ectoplasm.org/   m/gozer\@(apache|cpan|ectoplasm)\.org/



signature.asc
Description: OpenPGP digital signature


Re: mod_perl crashes with Perl 5.10

2009-04-07 Thread Philippe M. Chiasson
On 29/3/09 15:30, Jozef Kosoru wrote:
 Hello,
 
 I tested my mod_perl application using following combinations recently:
 
 * Apache/2.2.9 (Debian) mod_apreq2-20051231/2.6.0 mod_perl/2.0.4 Perl/v5.10.0
   (default Debian Lenny packages, mpm-prefork)
 
 * Apache/2.2.11 (Unix) mod_apreq2-20090110/2.7.1 mod_perl/2.0.4 Perl/v5.10.0
   (apache, apreq and mod_perl compiled from sources, mpm-prefork)
 
 and I see a crash of Apache process on each request.

Just to be sure, is that a 32/64 bit platform ?

 Here's the backtrace:
 
  Program received signal SIGSEGV, Segmentation fault.
  [Switching to Thread 0xb7ce0ad0 (LWP 11196)]
  0xb7bf2095 in Perl_pp_undef () from /usr/lib/libperl.so.5.10
  (gdb) bt
  #0  0xb7bf2095 in Perl_pp_undef () from /usr/lib/libperl.so.5.10
  #1  0xb7bc2dc1 in Perl_runops_standard () from /usr/lib/libperl.so.5.10
  #2  0xb7bbcd38 in Perl_call_sv () from /usr/lib/libperl.so.5.10
  #3  0xb7cb2bfc in modperl_callback (my_perl=0x9ab21a0, handler=0x9639b18, 
 p=0x9ad4578,
  r=0x9ad45b8, s=0x961bfe0, args=0x98a13c0) at modperl_callback.c:101

Hrm, if at all possible, while in gdb, could you dump more information from 
that frame ?

(gdb) info locals

Also, I'd love to see as much of the arguments as possible, expecially handler, 
r and args

(gdb) print *handler
(gdb) print *r
(gdb) print *args

Thanks.

Also, one thing that always help narrow things down is if you could boil down 
your application
to a small enough test case that you could share it with us.

-- 
Philippe M. Chiasson GPG: F9BFE0C2480E7680 1AE53631CB32A107 88C3A5A5
http://gozer.ectoplasm.org/   m/gozer\@(apache|cpan|ectoplasm)\.org/



signature.asc
Description: OpenPGP digital signature


Re: srand

2009-04-06 Thread Philippe M. Chiasson


On 4/4/09 19:52, Adam Prime wrote:
 Stanisław T. Findeisen wrote:
 Hello

 I have a question regarding srand() usage with mod_perl. The 
 documentation says:

 ===
 Do not call srand() (i.e. without an argument) more than once in a 
 script. The internal state of the random number generator should contain 
 more entropy than can be provided by any seed, so calling srand() again 
 actually loses randomness.

 http://perldoc.perl.org/functions/srand.html
 ===

 How does this relate to mod_perl? Is it safe to simply call srand() once 
 per CGI script?

 
 Personally, i call srand in my startup.pl, and not in individual cgi 
 scripts.  I have no idea if that's actually a good practice or not 
 though.  It might for example be a better idea to call it in a ChildInit 
   handler.

Yes, otherwise, each child httpd process (even these forked in the future),
will inherit the same random seed, so will go thru the exact same random
sequence. If you have multiple code paths consuming randomness, you might
not notice, but it can be a big problem, as your randomness will not be
nowhere as unpridictable as you'd think.

For instance, bugzilla.mozilla.org was hit by this very bug, as it was
making heavy use of rand() to generate unique tokens, and was finding itself
encountering a lot of duplicates, as each child process was starting at the
same exact random seed via a single srand() call from a PerlRequire'd file.

-- 
Philippe M. Chiasson GPG: F9BFE0C2480E7680 1AE53631CB32A107 88C3A5A5
http://gozer.ectoplasm.org/   m/gozer\@(apache|cpan|ectoplasm)\.org/



signature.asc
Description: OpenPGP digital signature


[RELEASE CANDIDATE] mod_perl-1.31 RC7

2009-04-02 Thread Philippe M. Chiasson
The mod_perl 1.31 release candidate 7 is ready. It can be downloaded here:

http://www.apache.org/~gozer/mp1/mod_perl-1.31-rc7.tar.gz

SHA1(mod_perl-1.31-rc7.tar.gz)= 4d73f33e6ed4786da1fb39f6e755746f680499c6
MD5(mod_perl-1.31-rc7.tar.gz)= ba44a09ec8383391857cbc47a21c99d4

Please give it a spin in your favorite configuration and report
any problems. Especially needed against Perl-5.10 and on Windows.

The summary of what has changed since 1.30 are (from Changes):

Fix XSS vulnerability in Apache::Status reported by
Richard J. Brain, CVE-2009-0796
[Fred Moyer]

On Win32, mod_perl.h needs to include malloc.h before the perl
headers, at least when built with USE_ITHREADS
[Steve Hay]

Win32 needs PERL_SYS_INIT/PERL_SYS_TERM calls when built with
USE_ITHREADS [sic--that's different to USE_THREADS]. In fact,
they ought to be always called if they are defined
[Steve Hay]

Fix potential segfault when the environment contains
NULL values [Mike Schilli]

Fix static APACI build against newer apache-1.3.38+
[Gozer]

Fixed modules/regex.t test 4 on Win32
[Steve Hay]

Avoid possible segfault when PerlFreshRestart is On.
[Michael Rendell mich...@cs.mun.ca]

Prevent segfault when running with perl = 5.9.3
[Steve Hay]

Fix shared libary extensions on Win32 to be .dll not .so
[Nikolay Ananiev anan...@thegdb.com]

Patch to mod_perl.dsp to remove /D _WINSOCK2API_ on Win32
for perl = 5.8.6 [Steve Hay]

-- 
Philippe M. Chiasson GPG: F9BFE0C2480E7680 1AE53631CB32A107 88C3A5A5
http://gozer.ectoplasm.org/   m/gozer\@(apache|cpan|ectoplasm)\.org/











signature.asc
Description: OpenPGP digital signature


Re: [RELEASE CANDIDATE] mod_perl-1.31 RC7

2009-04-02 Thread Philippe M. Chiasson
On 2/4/09 15:11, David E. Wheeler wrote:
 On Apr 2, 2009, at 10:42 AM, Philippe M. Chiasson wrote:
 
 The mod_perl 1.31 release candidate 7 is ready. It can be downloaded  
 here:

 http://www.apache.org/~gozer/mp1/mod_perl-1.31-rc7.tar.gz
 
 I'm still getting a failure to make. :-(
 
 % perl -v | grep This
 This is perl, v5.10.0 built for darwin-2level
 % uname -a
 Darwin benedict.local 9.6.0 Darwin Kernel Version 9.6.0: Mon Nov 24  
 17:37:00 PST 2008; root:xnu-1228.9.59~1/RELEASE_I386 i386
 % USER=dougm /usr/local/bin/perl Makefile.PL \
USE_APXS=1 \
WITH_APXS=/usr/local/apache/bin/apxs \
USE_DSO=1 \
EVERYTHING=1
 [...]
 % make
 (cd ./apaci  PERL5LIB=/usr/local/src/mod_perl-1.31-rc7/lib: make)
 make[1]: *** No rule to make target `libperl.so', needed by `lib'.   
 Stop.
 make: *** [apxs_libperl] Error 2

Now that I've had a chance to look into this, I swear I've debugged this
problem before, and I just can't find trace of it, or no patches.

In any case, can you try this 1-liner patch? I believe it would do the
trick just fine, it's because on OS X there are .so/.dylib/.bundles and
we made the wrong assumption that perl's dlext would always be .so, but
it's not on recent OS X, it's .bundle.

The simplest trick I can think of is to just blindly normalize perl's
dlext to .so, and it works just fine. It's not that important, as that
value is only used to pick the right libperl.* make rule to build libperl,
so should be safe.

Index: apaci/mod_perl.config.sh
===
--- apaci/mod_perl.config.sh(revision 753086)
+++ apaci/mod_perl.config.sh(working copy)
@@ -123,6 +123,14 @@
 perl_lddlflags=`$perl_config 'lddlflags'`
 perl_dlext=`$perl_config 'dlext'`

+# OS X has .bundle's, .so's and .dylib's, but we need to normalize
+# to .so, so keep it simple, and blindly normalize
+case $os_version in
+darwin*)
+perl_dlext=`echo $perl_dlext | sed -e's/bundle/so/' | sed 
-e's/dylib/so/'`
+;;
+esac
+
 case $os_version in
 aix*)
case $perl_cc in

-- 
Philippe M. Chiasson GPG: F9BFE0C2480E7680 1AE53631CB32A107 88C3A5A5
http://gozer.ectoplasm.org/   m/gozer\@(apache|cpan|ectoplasm)\.org/



signature.asc
Description: OpenPGP digital signature


Re: [RELEASE CANDIDATE] mod_perl-1.31 RC7

2009-04-02 Thread Philippe M. Chiasson


On 2/4/09 22:29, Philippe M. Chiasson wrote:
 On 2/4/09 15:11, David E. Wheeler wrote:
 On Apr 2, 2009, at 10:42 AM, Philippe M. Chiasson wrote:

 The mod_perl 1.31 release candidate 7 is ready. It can be downloaded  
 here:

 http://www.apache.org/~gozer/mp1/mod_perl-1.31-rc7.tar.gz

 I'm still getting a failure to make. :-(

 % perl -v | grep This
 This is perl, v5.10.0 built for darwin-2level
 % uname -a
 Darwin benedict.local 9.6.0 Darwin Kernel Version 9.6.0: Mon Nov 24  
 17:37:00 PST 2008; root:xnu-1228.9.59~1/RELEASE_I386 i386
 % USER=dougm /usr/local/bin/perl Makefile.PL \
USE_APXS=1 \
WITH_APXS=/usr/local/apache/bin/apxs \
USE_DSO=1 \
EVERYTHING=1
 [...]
 % make
 (cd ./apaci  PERL5LIB=/usr/local/src/mod_perl-1.31-rc7/lib: make)
 make[1]: *** No rule to make target `libperl.so', needed by `lib'.   
 Stop.
 make: *** [apxs_libperl] Error 2
 
 Now that I've had a chance to look into this, I swear I've debugged this
 problem before, and I just can't find trace of it, or no patches.
 
 In any case, can you try this 1-liner patch?

Obviously, I can't count ;-)

Or, I started writing this e-mail with a simple-minded 1-line patch, then
realized it wouldn't work, and came up with this more elaborate patch, but
failed to update the line count in the previous, already written, paragraph.

I'll let you figure it out.

If this resolved your problem David, I'll roll it into RC8 (eight??) and 
hopefully,
that will be that for a little while.

Cheers!

-- 
Philippe M. Chiasson GPG: F9BFE0C2480E7680 1AE53631CB32A107 88C3A5A5
http://gozer.ectoplasm.org/   m/gozer\@(apache|cpan|ectoplasm)\.org/



signature.asc
Description: OpenPGP digital signature


Re: [RELEASE CANDIDATE] mod_perl-1.31 RC7

2009-04-02 Thread Philippe M. Chiasson
On 2/4/09 23:35, David E. Wheeler wrote:
 On Apr 2, 2009, at 7:29 PM, Philippe M. Chiasson wrote:
 
 Now that I've had a chance to look into this, I swear I've debugged  
 this
 problem before, and I just can't find trace of it, or no patches.
 
 Yeah, I first reported it a year ago, with RC4.
 
 In any case, can you try this 1-liner patch? I believe it would do the
 trick just fine, it's because on OS X there are .so/.dylib/.bundles  
 and
 we made the wrong assumption that perl's dlext would always be .so,  
 but
 it's not on recent OS X, it's .bundle.

 The simplest trick I can think of is to just blindly normalize perl's
 dlext to .so, and it works just fine. It's not that important, as that
 value is only used to pick the right libperl.* make rule to build  
 libperl,
 so should be safe.
 
 That seems to work great. My server didn't start for the tests, but it  
 looks like Apache::Test is using the system apache instead of my  
 build; I can look into that in the morning, but at least it builds  
 now. Yay!

APXS/DSO make test was never supported, and needs some magic to get it to
work. USER=dougm is not enough...

-- 
Philippe M. Chiasson GPG: F9BFE0C2480E7680 1AE53631CB32A107 88C3A5A5
http://gozer.ectoplasm.org/   m/gozer\@(apache|cpan|ectoplasm)\.org/



signature.asc
Description: OpenPGP digital signature


Re: [RELEASE CANDIDATE] Apache-Bootstrap 0.05 rc1

2009-03-30 Thread Philippe M. Chiasson
On 20/1/09 20:17, Fred Moyer wrote:
 Greetings,
 
 Apache::Bootstrap 0.05 release candidate 1 is available for testing and 
 review:
 
 http://people.apache.org/~phred/Apache-Bootstrap-0.05-rc1.tar.gz

Linux Fedora 10
$ make test
PERL_DL_NONLAZY=1 /usr/bin/perl -MExtUtils::Command::MM -e test_harness(0, 
'blib/lib', 'blib/arch') t/*.t
t/00-load.t ... 1/11 # Testing Apache::Bootstrap 0.05-rc1, Perl 5.01, 
/usr/bin/perl
t/00-load.t ... ok
t/pod-coverage.t .. ok
t/pod.t ... ok
All tests successful.
Files=3, Tests=13,  1 wallclock secs ( 0.03 usr  0.02 sys +  0.41 cusr  0.06 
csys =  0.52 CPU)
Result: PASS
$ perl -v | grep This
This is perl, v5.10.0 built for x86_64-linux-thread-multi
$ uname -a
Linux huigui.shr.gescomstrategies.com 2.6.27.19-170.2.35.fc10.x86_64 #1 SMP Mon 
Feb 23 13:00:23 EST 2009 x86_64 x86_64 x86_64 GNU/Linux


DarwinPorts
$ make test
PERL_DL_NONLAZY=1 /opt/local/bin/perl -MExtUtils::Command::MM -e 
test_harness(0, 'blib/lib', 'blib/arch') t/*.t
t/00-load.ok 1/11# Testing Apache::Bootstrap 0.05-rc1, Perl 5.008008, 
/opt/local/bin/perl
t/00-load.ok
9/11 skipped: various reasons
t/pod-coverageskipped
all skipped: Test::Pod::Coverage 1.08 required for testing POD coverage
t/pod.skipped
all skipped: Test::Pod 1.22 required for testing POD
All tests successful, 2 tests and 9 subtests skipped.
Files=3, Tests=11,  0 wallclock secs ( 0.06 cusr +  0.04 csys =  0.10 CPU)
$ /opt/local/bin/perl -v | grep This
This is perl, v5.8.8 built for darwin-2level
$ uname -a
Darwin shenlong 9.6.0 Darwin Kernel Version 9.6.0: Mon Nov 24 17:37:00 PST 
2008; root:xnu-1228.9.59~1/RELEASE_I386 i386 i386

Apple
$ make test
PERL_DL_NONLAZY=1 /usr/bin/perl -MExtUtils::Command::MM -e test_harness(0, 
'blib/lib', 'blib/arch') t/*.t
t/00-load.t ... 1/11 # Testing Apache::Bootstrap 0.05-rc1, Perl 5.008008, 
/usr/bin/perl
t/00-load.t ... ok
t/pod-coverage.t .. ok
t/pod.t ... ok
All tests successful.
Files=3, Tests=13,  2 wallclock secs ( 0.05 usr  0.02 sys +  0.56 cusr  0.13 
csys =  0.76 CPU)
Result: PASS
$ /usr/bin/perl -v | grep This
This is perl, v5.8.8 built for darwin-thread-multi-2level
$ uname -a
Darwin shenlong 9.6.0 Darwin Kernel Version 9.6.0: Mon Nov 24 17:37:00 PST 
2008; root:xnu-1228.9.59~1/RELEASE_I386 i386 i386

Looks very good to me.

-- 
Philippe M. Chiasson GPG: F9BFE0C2480E7680 1AE53631CB32A107 88C3A5A5
http://gozer.ectoplasm.org/   m/gozer\@(apache|cpan|ectoplasm)\.org/



signature.asc
Description: OpenPGP digital signature


Re: Help needed for mod_perl 1.31-rc6 and Apache::Bootstrap

2009-03-30 Thread Philippe M. Chiasson
On 30/3/09 12:02, David E. Wheeler wrote:
 On Mar 26, 2009, at 1:20 PM, Fred Moyer wrote:
 
 There's a couple of mod_perl related releases now that need people to
 test them out.  It takes less time to download, untar, and run the
 test suite for these two releases than it does to write a response to
 the 'decline of mod_perl' thread that has been going around :)  Plus,
 it will help make you a better mod_perl user and developer.


 Help needed with testing mod_perl 1.31 rc6

 http://marc.info/?l=apache-modperlm=123726111905517w=2
 
 benedict% USER=dougm /usr/local/bin/perl Makefile.PL \
 USE_APXS=1 \
 WITH_APXS=/usr/local/apache/bin/apxs \
 USE_DSO=1 \
 EVERYTHING=1
 Will configure via APXS (apxs=/usr/local/apache/bin/apxs)
 Will configure via APACI (DSO enabled)
 PerlDispatchHandler.enabled
 PerlChildInitHandlerenabled
 PerlChildExitHandlerenabled
 PerlPostReadRequestHandler..enabled
 PerlTransHandlerenabled
 PerlHeaderParserHandler.enabled
 PerlAccessHandler...enabled
 PerlAuthenHandler...enabled
 PerlAuthzHandlerenabled
 PerlTypeHandler.enabled
 PerlFixupHandlerenabled
 PerlHandler.enabled
 PerlLogHandler..enabled
 PerlInitHandler.enabled
 PerlCleanupHandler..enabled
 PerlRestartHandler..enabled
 PerlStackedHandlers.enabled
 PerlMethodHandlers..enabled
 PerlDirectiveHandlers...enabled
 PerlTableApienabled
 PerlLogApi..enabled
 PerlUriApi..enabled
 PerlUtilApi.enabled
 PerlFileApi.enabled
 PerlConnectionApi...enabled
 PerlServerApi...enabled
 PerlSectionsenabled
 PerlSSI.enabled
 Will run tests as User: 'david' Group: 'david'
 Configuring mod_perl for building via APXS
   + Creating a local mod_perl source tree
   + Setting up mod_perl build environment (Makefile)
   + id: mod_perl/1.31-rc6
   + id: Perl/v5.10.0 (darwin) [/usr/local/bin/perl]
 Now please type 'make' to build libperl.so
 Checking CGI.pm VERSION..ok
 Checking for LWP::UserAgent..ok
 Checking for HTML::HeadParserok
 Checking if your kit is complete...
 Looks good
 Writing Makefile for Apache
 Writing Makefile for Apache::Connection
 Writing Makefile for Apache::Constants
 Writing Makefile for Apache::File
 Writing Makefile for Apache::Leak
 Writing Makefile for Apache::Log
 Writing Makefile for Apache::ModuleConfig
 Writing Makefile for Apache::PerlRunXS
 Writing Makefile for Apache::Server
 Writing Makefile for Apache::Symbol
 Writing Makefile for Apache::Table
 Writing Makefile for Apache::URI
 Writing Makefile for Apache::Util
 Writing Makefile for mod_perl
 benedict% make
 (cd ./apaci  PERL5LIB=/Users/david/Downloads/mod_perl-1.31-rc6/lib:  
 make)
 make[1]: *** No rule to make target `libperl.so', needed by `lib'.   
 Stop.
 make: *** [apxs_libperl] Error 2
 benedict% make
 (cd ./apaci  PERL5LIB=/Users/david/Downloads/mod_perl-1.31-rc6/lib:  
 make)
 make[1]: *** No rule to make target `libperl.so', needed by `lib'.   
 Stop.
 make: *** [apxs_libperl] Error 2
 
 % perl -v
 
 This is perl, v5.10.0 built for darwin-2level

Hrm, that's strange, I can build that combo just fine on Linux, so something
is up. Any chance I could have a look at that Makefile ?

-- 
Philippe M. Chiasson GPG: F9BFE0C2480E7680 1AE53631CB32A107 88C3A5A5
http://gozer.ectoplasm.org/   m/gozer\@(apache|cpan|ectoplasm)\.org/



signature.asc
Description: OpenPGP digital signature


Re: strange mod_deflate behaviour on binary output

2009-03-22 Thread Philippe M. Chiasson
On 22/3/09 15:25, Louis-David Mitterrand wrote:
 Hi,
 
 I noticed something interesting with mod_deflate when serving binary
 content from a mason component:
 
   %init
   $m-clear_buffer();
   $r-content_type(video/mp4);
   $r-headers_out-add('Content-length' = -s $file);
   $r-sendfile($file);
   $m-abort(200);
   /%init
 
 mod_deflate is enabled with the default:
 
   AddOutputFilterByType DEFLATE text/html text/plain text/xml
 
 and .md mason components have:
 
   AddType text/html .md
 
 But when I change the content-type from within the component mod_deflate
 doesn't seem to notice and keeps gzip'ing the video/mp4 output, which
 FlowPlayer doesn't appreciate.
 
 I certainly could disable mod_deflate and be on my merry way. 
 
 But I thought I'd ask the modperl list (already posted to mason-users)
 whether this mod_deflate behaviour is expected and/or normal?

Sounds like Mason runs exclusively in the PerlResponse phase, at which
point, AddOutputFilterByType has already decided if it should apply the
filter or not, so it's too late to change that.

One easy way to disable mod_deflate from that point in time, from mason,
would be to do:

$r-subprocess_env('no-gzip' = 1);

Since from mod_deflate.c:

/* some browsers might have problems, so set no-gzip
 * (with browsermatch) for them
 */
if (apr_table_get(r-subprocess_env, no-gzip)) {
ap_remove_output_filter(f);
return ap_pass_brigade(f-next, bb);
}

Give it a try, this is untested!

-- 
Philippe M. Chiasson GPG: F9BFE0C2480E7680 1AE53631CB32A107 88C3A5A5
http://gozer.ectoplasm.org/   m/gozer\@(apache|cpan|ectoplasm)\.org/



signature.asc
Description: OpenPGP digital signature


[RELEASE CANDIDATE] mod_perl-1.31 RC6

2009-03-13 Thread Philippe M. Chiasson
note
Apologies, but RC5 was generated on a Mac and included bogus resource forks
in the tarball, breaking MakeMaker on any non-mac platform. This RC is the
exact same thing as RC5, without the resource forks.
/note

The mod_perl 1.31 release candidate 6 is ready. It can be downloaded here:

http://www.apache.org/~gozer/mp1/mod_perl-1.31-rc6.tar.gz

SHA1(mod_perl-1.31-rc6.tar.gz)= 1b917d51fd4b0030cd8d018a35d3d98cdfcca0a4
MD5(mod_perl-1.31-rc6.tar.gz)= db7b0bde837ba8b2ffef855218d9360f

Please give it a spin in your favorite configuration and report
any problems. Especially needed against Perl-5.10 and on Windows.

The summary of what has changed since 1.30 are (from Changes):

On Win32, mod_perl.h needs to include malloc.h before the perl
headers, at least when built with USE_ITHREADS
[Steve Hay]

Win32 needs PERL_SYS_INIT/PERL_SYS_TERM calls when built with
USE_ITHREADS [sic--that's different to USE_THREADS]. In fact,
they ought to be always called if they are defined
[Steve Hay]

Fix potential segfault when the environment contains
NULL values [Mike Schilli]

Fix static APACI build against newer apache-1.3.38+
[Gozer]

Fixed modules/regex.t test 4 on Win32
[Steve Hay]

Avoid possible segfault when PerlFreshRestart is On.
[Michael Rendell mich...@cs.mun.ca]

Prevent segfault when running with perl = 5.9.3
[Steve Hay]

Fix shared libary extensions on Win32 to be .dll not .so
[Nikolay Ananiev anan...@thegdb.com]

Patch to mod_perl.dsp to remove /D _WINSOCK2API_ on Win32
for perl = 5.8.6 [Steve Hay]

-- 
Philippe M. Chiasson GPG: F9BFE0C2480E7680 1AE53631CB32A107 88C3A5A5
http://gozer.ectoplasm.org/   m/gozer\@(apache|cpan|ectoplasm)\.org/









signature.asc
Description: OpenPGP digital signature


[RELEASE CANDIDATE] mod_perl-1.31 RC5

2009-03-12 Thread Philippe M. Chiasson
The mod_perl 1.31 release candidate 5 is ready. It can be downloaded here:

http://www.apache.org/~gozer/mp1/mod_perl-1.31-rc5.tar.gz

MD5(mod_perl-1.31-rc5.tar.gz)= 68dafd0a864603bd977739b06b56954a
SHA1(mod_perl-1.31-rc5.tar.gz)= 2b4e24673ca6e1387dbc2f86faf84f63e8bb298c

Please give it a spin in your favorite configuration and report
any problems. Especially needed against Perl-5.10 and on Windows.

The summary of what has changed since 1.30 are (from Changes):

On Win32, mod_perl.h needs to include malloc.h before the perl
headers, at least when built with USE_ITHREADS
[Steve Hay]

Win32 needs PERL_SYS_INIT/PERL_SYS_TERM calls when built with
USE_ITHREADS [sic--that's different to USE_THREADS]. In fact,
they ought to be always called if they are defined
[Steve Hay]

Fix potential segfault when the environment contains
NULL values [Mike Schilli]

Fix static APACI build against newer apache-1.3.38+
[Gozer]

Fixed modules/regex.t test 4 on Win32
[Steve Hay]

Avoid possible segfault when PerlFreshRestart is On.
[Michael Rendell mich...@cs.mun.ca]

Prevent segfault when running with perl = 5.9.3
[Steve Hay]

Fix shared libary extensions on Win32 to be .dll not .so
[Nikolay Ananiev anan...@thegdb.com]

Patch to mod_perl.dsp to remove /D _WINSOCK2API_ on Win32
for perl = 5.8.6 [Steve Hay]

-- 
Philippe M. Chiasson GPG: F9BFE0C2480E7680 1AE53631CB32A107 88C3A5A5
http://gozer.ectoplasm.org/   m/gozer\@(apache|cpan|ectoplasm)\.org/







signature.asc
Description: OpenPGP digital signature


Re: tracking a coredump problem

2009-01-27 Thread Philippe M. Chiasson
On 27/1/09 15:55, Carl Brewer wrote:
 Following up on this, I'm still stuck, but maybe someone here can help 
 with a debugging step?
 
 I'm trying to get httpd to dump cores, as we're seeing this a lot :
 
 [Sun Jan 25 18:14:17 2009] [notice] child pid 20822 exit signal 
 Segmentation fault (11)
 
 
 and I figure a core might just help.  So, in httpd-perl's config :
 
 CoreDumpDirectory /var/cores
 
 and /var/cores is 777
 
 And in the (RHEL/CentOS format) init.d script
 start() {
  echo -n $Starting $prog: 
  ulimit -S -c unlimited /dev/null 21
  LANG=$HTTPD_LANG daemon $httpd $OPTIONS -f $conf
  RETVAL=$?
  echo
  ulimit -c
  [ $RETVAL = 0 ]  touch ${lockfile}
  return $RETVAL
 }
 
 
 I think I got just about everything needed to get a coredump, but 
 nothing shows up in /var/cores, despite many segfaults in the logs.
 
 Anything I've missed?

Selinux enabled ?

-- 
Philippe M. Chiasson GPG: F9BFE0C2480E7680 1AE53631CB32A107 88C3A5A5
http://gozer.ectoplasm.org/   m/gozer\@(apache|cpan|ectoplasm)\.org/



signature.asc
Description: OpenPGP digital signature


Re: Apache::Reload/ModPerl::Util/base.pm incompatibility prospective patch

2009-01-07 Thread Philippe M. Chiasson

Have you tried the alternate unload_package implementation, the one in C/XS?

You can try it out by doing

BEGIN {
  $ModPerl::Util::DEFAULT_UNLOAD_METHOD = 'unload_package_xs';
}
use ModPerl::Util;

Somewhere early in your server startup scripts.

On 29/12/08 15:08, David Ihnen wrote:

Philip M. Gollucci wrote:

David Ihnen wrote:

1. Problem Description:

While developing with CGI::Application and utilizing Apache::Reload,
we encountered an issue where our modules were not being succesfully
reinitialized on reload. It was traced down to @ISA not containing
the proper values after a 'use base' directive, but only on automatic
reload, and freshly on perl 5.10, not our previous version of perl
5.8.8!

Are you able to try 5.8.9, its at least a smaller change set to look
at if 5.8.9 breaks too.


No, not easily when I considered the mod_perl ramifications
particularly. I did find a way around this particular problem on the web
server though.

I noticed line 79. of base.pm

79 next if grep $_-isa($base), ($inheritor, @bases);

Experimentally, if I commented it out, the web server could reload
properly! Score!

Hm. I know -isa is a UNIVERSAL function. UNIVERSAL.pm is... not
implimented in perl. Must be in the C code.

So I found UNIVERSAL.c

whose isa function implimentation said after some error checks essentially

ST(0) = boolSV(sv_derived_from(sv, name));


which function had the documentation

=head1 SV Manipulation Functions

=for apidoc sv_derived_from

Returns a boolean indicating whether the SV is derived from the specified class
Iat the C level.  To check derivation at the Perl level, call Cisa()  as a
normal Perl method.

=cut


Ooh. at the **C** level. I bet the unload utility doesn't even *affect*
the C level!

Those who understand perl C code might be better able to tell if
unloading in the C levels is possible, a good idea, or just bad mojo.
Having taken some medicine to deal with the C-inspired headache that
inspection brought on, I returned to base.pm.

ISA is a package local variable list that lists the parents. In order to
see all-the-parents, or replicate -isa, I have to get the list of all
the packages in ISA, all THEIR ISAs, and so on, as long as there are
contents therein. And my scan will pay attention only to the interpreter
state, not the C state...

I should be able to do that in perl easily enough. PATCH

--- 510base.pm 2008-12-29 12:48:27.0 -0700
+++ /usr/share/perl/5.10.0/base.pm 2008-12-29 12:48:48.0 -0700
@@ -76,7 +76,20 @@
warn Class '$inheritor' tried to inherit from itself\n;
}

- next if grep $_-isa($base), ($inheritor, @bases);
+ my @classlist = ($inheritor, @bases);
+ foreach ($inheritor, @bases) {
+ my @parents = @$_::ISA;
+ do {
+ my $class = shift @parents;
+ foreach my $parent (@$class::ISA) {
+ unless (grep { $_ eq $parent } @classlist) {
+ push @classlist, $parent;
+ push @parents, @$parent::ISA;
+ }
+ }
+ } while (scalar @parents);
+ }
+ next if grep {$_ eq $base} @classlist;

if (has_version($base)) {
${$base.'::VERSION'} = '-1, set by base.pm'

I know thats kind of ugly, and verbose, and maybe not very performant.
But it works for the web server. Its not in any of the ISAs at
re-require time so it does not skip loading the module even if the C HAS
seen it before, and the application continues happily.

So at any rate, its a patch that works for my case (much as I hate
patching base.pm) - and to my somewhat weak understanding of the C code
implimentation, does the same thing in perl that the isa-iteration did
in c. What is the proper path here?

David Ihnen
Perl Programmer
Norchem Laboratories, Inc



--
Philippe M. Chiasson GPG: F9BFE0C2480E7680 1AE53631CB32A107 88C3A5A5
http://gozer.ectoplasm.org/   m/gozer\@(apache|cpan|ectoplasm)\.org/


Re: Apache::Reload - ModPerl::Util::unload_package under perl 5.10 use base directive malfunction

2009-01-07 Thread Philippe M. Chiasson



On 26/12/08 20:39, David Ihnen wrote:

1. Problem Description:

While developing with CGI::Application and utilizing Apache::Reload, we
encountered an issue where our modules were not being succesfully
reinitialized on reload.  It was traced down to @ISA not containing the
proper values after a 'use base' directive, but only on automatic
reload, and freshly on perl 5.10, not our previous version of perl 5.8.8!

I determined that when ModPerl::Util::unload_package is used to unload a
package, when it is then re-required in perl 5.10, 'use base' directives
don't function as expected.

I recreated the problem with this simple use case.  It happens when a
sub-module (required by something else) is unloaded then re-required.  I
included the workaround using the push @ISA method to contrast working
with not working.

This is the output when the program below is run.

$ perl t.pl
X
X
V
Not a CODE reference at t.pl line 14.

Where did the inheritance go after the require of v?  Is this a bug in
the do-file functionality utilized by require?  Did
ModPerl::Util::unload_package not do something it was supposed to?  Is
there a subtle interaction between 5.10 and ModPerl::Util?

I was initially going to submit this to the perl bug database, but
realized that the unload_package function was a ModPerl functionality,
so this is my first place to go.   Five files to test with itemized
below.  As you can see, I can recreate it without utilizing the mod_perl
environment specifically.

--- begin t.pl ---
#!/usr/bin/perl
use ModPerl::Util;
# Using push @ISA
require w;
w-x();
ModPerl::Util::unload_package('w');
require w;
w-x();
# Using use base
require u;
u-v();
ModPerl::Util::unload_package('v');
require u;


This is strange, as you are unloading 'v' and reloading 'u', probably not
what was intended.

--
Philippe M. Chiasson GPG: F9BFE0C2480E7680 1AE53631CB32A107 88C3A5A5
http://gozer.ectoplasm.org/   m/gozer\@(apache|cpan|ectoplasm)\.org/


Re: [mp2] Segfault on using $r-content_type()

2008-06-30 Thread Philippe M. Chiasson



Stephen Howard wrote:

1. Problem Description:

I have an intermittent segfault with one particular ResponseHandler.  
The segfault, when it occurs, is triggered by calling $r-content_type 
in a lightly modified CGI::Simple (I made changes to it as it wasn't 
playing well with mod_perl2).  What might be going awry? The relevant 
changes to CGI::Simple are in the header sub:


 for ( @other ) {

# Don't use \s because of perl bug 21951
next
  unless my ( $header, $value ) = /([^ \r\n\t=]+)=\?(.+?)\?$/;
$header  =~ s/^(\w)(.*)/\u$1\L$2/;
$_ = [ $header, $self-unescapeHTML($value) ];
}
$type ||= 'text/html' unless defined $type;
$type .= ; charset=$charset
  if $type
  and $type =~ m!^text/!
  and $type !~ /\bcharset\b/;
my $protocol = $ENV{SERVER_PROTOCOL} || 'HTTP/1.0';
push @header, $protocol . ' ' . ( $status || '200 OK' ) if $nph;
push @header, [Server, server_software() ] if $nph;
push @header, [Status, $status ]   if $status;
push @header, [Window-Target, $target ]if $target;

if ( $p3p ) {
$p3p = join ' ', @$p3p if ref( $p3p ) eq 'ARRAY';
push( @header, [P3P, qq(policyref=/w3c/p3p.xml, CP=$p3p)] );
}

# push all the cookies -- there may be several
if ( $cookie ) {
my @cookie = ref $cookie eq 'ARRAY' ? @{$cookie} : $cookie;
for my $cookie ( @cookie ) {
my $cs =
  ref $cookie eq 'CGI::Simple::Cookie'
  ? $cookie-as_string
  : $cookie;
push @header, [Set-Cookie, $cs] if $cs;
}
}

# if the user indicates an expiration time, then we need both an Expires
# and a Date header (so that the browser is using OUR clock)
$expires = 'now'
  if $self-no_cache;# encourage no caching via expires now
push @header, [Expires, CGI::Simple::Util::expires( $expires, 
'http' ) ]

  if $expires;
push @header, [Date,  CGI::Simple::Util::expires( 0, 'http' ) ]
  if defined $expires || $cookie || $nph;
push @header, [Pragma, no-cache] if $self-cache or $self-no_cache;
push @header, [Content-Disposition, attachment; 
filename=\$attachment\ ]

  if $attachment;
push @header, @other;
push @header, [Content-Type, $type] if $type;

if ( $self-{'.mod_perl'} and not $nph ) {
my $r = $self-_mod_perl_request();
$r-content_type( $type ) if $type; --- segfault here 
---


Any change of dumping out what was in $type at that point, just before it 
segfaults?

Data::Dumper + Devel::Peek::Dump() would be usefull.


$r-status($status) if $status;
$r-err_headers_out-add( @$_ ) foreach @header;
return '';
}
my $CRLF = $self-crlf;
my $header = join $CRLF, map { join ': ', @$_ } @header;
$header .= $CRLF . $CRLF;# add the statutory two CRLFs
return $header;

[...]
3. This is the core dump trace: (if you get a core dump):


Thanks for the yummy backtrace !


#0  0x00db86e8 in apr_palloc () from /usr/lib/libapr-0.so.0
#1  0x00da66bd in apr_pmemdup () from /usr/lib/libapr-0.so.0
#2  0x00577fb9 in XS_Apache2__RequestRec_content_type 
(my_perl=0x8776388, cv=0x89fd810) at 
/root/.cpan/build/mod_perl-2.0.4/xs/Apache2/RequestRec/Apache2__RequestRec.h:27


  const char *val = SvPV(type, len);
  ap_set_content_type(r, apr_pmemdup(r-pool, val, len+1));

The only way I could see this trace hapenning is if:
 val != NULL, so it's something
 len is VERY large.

So my guess is that SV *type might be somewhat corrupt and causing
APR to just try and allocate way too much memory (or too litle, -123)

Any chance you could build a debugging mod_perl-2 and catch this in
gdb ?

If so, it's just a matter of

gdb display locals

in frame #2

to figure out what the value of val and len is.

--
Philippe M. Chiasson GPG: F9BFE0C2480E7680 1AE53631CB32A107 88C3A5A5
http://gozer.ectoplasm.org/   m/gozer\@(apache|cpan|ectoplasm)\.org/



signature.asc
Description: OpenPGP digital signature


Re: bug report: wrong line number if using built-in functions

2008-06-19 Thread Philippe M. Chiasson



Christian Mehring wrote:

-8-- Start Bug Report 8--
1. Problem Description:

Line numbers will be wrong if a bulit-in function's first parameter is not
in the same line.

Minimized example:

01: #!/usr/local/bin/perl
02: use strict;
03: use warnings;
04:
05: abs
06:
07:5;
08:
09: die __LINE__;
10:
11: __END__

Expected line is 9. Result is 11.

- Warnings and dies give wrong line numbers. Finding errors is difficult 
so.


I've been able to reproduce this problem, and it smells like it might be caused 
by the
optmizer rolling that statement into a single line...

I don't have time to look much into this, but I've attached a patch to the test
case that illustrates the problem, in case anybody else want to have a shot at 
this.

--
Philippe M. Chiasson GPG: F9BFE0C2480E7680 1AE53631CB32A107 88C3A5A5
http://gozer.ectoplasm.org/   m/gozer\@(apache|cpan|ectoplasm)\.org/
Index: t/line.t
===
--- t/line.t(revision 0)
+++ t/line.t(revision 0)
@@ -0,0 +1,35 @@
+use strict;
+use warnings FATAL = 'all';
+
+use Apache::Test;
+use Apache::TestUtil qw(t_cmp t_catfile_apache t_client_log_error_is_expected);
+use Apache::TestRequest;
+use Apache::TestConfig ();
+
+my %modules = (
+registry= 'ModPerl::Registry',
+registry_bb = 'ModPerl::RegistryBB',
+perlrun = 'ModPerl::PerlRun',
+);
+
+my @aliases = sort keys %modules;
+
+my $vars = Apache::Test::config()-{vars};
+my $script_file = t_catfile_apache $vars-{serverroot}, 'cgi-bin', 'line.pl';
+
+plan tests = @aliases * 1;
+
+# In some cases, looks like the optimizer throws off our line numbers
+# line nn filename doesn't seem to work all the time
+for my $alias (@aliases) {
+my $url = /$alias/line.pl;
+
+( my $cmdline = `$^X $script_file` )  =~ /(LINE:\d+)/;
+my $line = $1;
+
+ok t_cmp(
+GET_BODY($url),
+$line,
+$modules{$alias} basic cgi test,
+);
+}
Index: t/cgi-bin/line.pl
===
--- t/cgi-bin/line.pl   (revision 0)
+++ t/cgi-bin/line.pl   (revision 0)
@@ -0,0 +1,7 @@
+#!/usr/local/bin/perl
+print Content-type: text/plain\n\n;
+my $abs = abs
+
+0; # Something funny happens to reported line numbers
+   # (optimizer playing with us here ?) 
+print LINE: . __LINE__ ; # Should print '9'


signature.asc
Description: OpenPGP digital signature


Re: [MP2][QUESTION]Adding handlers when defining a new directive

2008-04-29 Thread Philippe M. Chiasson

titetluc titetluc wrote:

Hello,

I am writing a new mod_perl Apache (mod_perl2) to manage session 
tracking and SSO
This module defines a new Apache directive (MyNewDirective), which is 
usable in a location, filesdirectory block.


For example
Location /a_test
Set-Handler perl-script
MyNewDirective a_test arg1 arg2
PerlResponseHandler ResponseHandlerToTestTheNewDirective
/Location
Location /another_test
Set-Handler perl-script
PerlResponseHandler ResponseHandlerToTestTheNewDirective
/Location


When this directive is used, my module should a PerlLogHandler 
automatically to obtain the following configuration

Location /a_test
Set-Handler perl-script
MyNewDirective a_test arg1 arg2
PerlResponseHandler ResponseHandlerToTestTheNewDirective
PerlLogHandler TestPerlLogHandler
/Location
Location /another_test
Set-Handler perl-script
PerlResponseHandler ResponseHandlerToTestTheNewDirective
/Location

I tried to use the push_handler method when the 'MyNewDirective' is defined.

my @directives = ({name = 'MyNewDirective ', func = 
__PACKAGE__.'::MyNewDirective'});


Apache2::Module::add(__PACKAGE__, [EMAIL PROTECTED]);

sub MyNewDirective {
my ($self, $parms, $arg) = @_;

# blablabla

$parms-server-push_handlers(PerlLogHandler = sub {my ($r) _ @_; 
$r-server-error_log('hello world'); return Apache2::Const::OK;});



Right here, you are adding your handler to the current *server* configuration
object, effectively enabling this handler for eery requests to that server/vhost


# blablabla
return;
}

This code works ... but for any blocks.
For example, if I access the URI '/a_test', the PerlLogHandler will be 
called BUT if I access the URI '/another_test', the PerlLogHandler will 
also be called.


See above.


Do I use the mod_perl API correctly ?


Correctly, yes. Unfortunately, it's not what you are trying to do.


What is wrong in my code ?


If you want to push your loghandler only for requests for your configured
module, I would just delay the loghandler registration until runtime and
do it in your content handler with

$r-push_handlerrs(...)

Or you can do it in your command handler, but like so

sub MyLogHandler {
[...]
}

sub MyNewDirective {
  my ($self, $param, $arg) = @_;

  $parms-add_config([PerlLogHandler MyLogHandler]);
  [...]

--
Philippe M. Chiasson GPG: F9BFE0C2480E7680 1AE53631CB32A107 88C3A5A5
http://gozer.ectoplasm.org/   m/gozer\@(apache|cpan|ectoplasm)\.org/



signature.asc
Description: OpenPGP digital signature


Re: [RELEASE CANDIDATE] mod_perl-1.31 RC4

2008-04-21 Thread Philippe M. Chiasson

Steve Hay wrote:

Philippe M. Chiasson wrote:

The mod_perl 1.31 release candidate 4 Works with Perl 5.10 is
ready. It can be downloaded here: 


http://www.apache.org/~gozer/mp1/mod_perl-1.31-rc4.tar.gz


All tests OK using VC6 on WinXP with apache 1.3.39 and perl 5.10.0 built
without USE_MULTI, USE_ITHREADS or USE_IMP_SYS.



Crashes on startup with apache 1.3.41 and perl 5.10.0 built with default
options (i.e. with USE_MULTI, USE_ITHREADS or USE_IMP_SYS).


Any chance to try and narrow it down a little bit more between these 3?

I've finally managed to reproduce this crash myself. I've had to bite the
bullet and get myself a Win32 VM I can actually build all this stuff under.

Haven't managed to get a usefull debugging session running yet. Can't
seem to get VC6 to pick up/display debugging symbols. Any hits from folks
here with stronger win-foo than me ?

--
Philippe M. Chiasson GPG: F9BFE0C2480E7680 1AE53631CB32A107 88C3A5A5
http://gozer.ectoplasm.org/   m/gozer\@(apache|cpan|ectoplasm)\.org/



signature.asc
Description: OpenPGP digital signature


Re: What happened with Apache2::Reload in mod_perl-2.0.4?

2008-04-21 Thread Philippe M. Chiasson

Fred Moyer wrote:

Geoffrey Young wrote:


Fred Moyer wrote:

Niels van Dijke wrote:

Hi mod_perl maintainers,

Thank you for releasing mod_perl 2.0.4.

I was wondering what happened to Apache2::Reload? Was it missed in
packaging for the upload to CPAN? If so then there may be other files
missing too.

See the Changelog:

Apache2::Reload has been moved to an externally maintained
CPAN distribution

http://search.cpan.org/dist/Apache-Reload-0.10/

hmm...

I can't remember if I knew this or not, but we probably ought to treat 
this like Apache-Test: keep bundling it with releases _and_ maintain 
something separate on CPAN.


That's on the radar for 2.0.5, along with Apache::SizeLimit, to bundle 
using svn:external.  Phillip Gollucci brought this up about a month ago 
or so, and I started to move on it but Gozer brought up a number of 
things that had to be done to make this happen and the works with 5.10 
release was pressing at that point.


Don't worry, I won't forget about it :)

so I guess this means a mp2 release should (going forward) include _and_ 
imply a new release of


  o mp2
  o Apache-Test
  o Apache-Reload

 o Apache-SizeLimit

And as the latest Release Manager, I must say that having to release 3
extra CPAN modules along with each mp2 releases is going to be a PITA.

http://svn.apache.org/[...]/Apache-Test/tags/1.31

THat way, 2 things happen. First, we can always release mod_perl, without
having to worry about these external packages. We know what we are bundling
is exactly the same stuff that is _already_ on CPAN, great. Second, mod_perl
itself is protected from spurious failures caused by changes in any of these
modules before they are released.

The only negative is that if a change is made to say Apache-Test to fix a
problem mod_perl needs/wants, it complicates things a little. I make the
fix in A-T, making sure it fixes mod_perl's problem. If sure of that,
I proceed to release A-T. Once released, I can now test mod_perl against
this new A-T by locally changing the tag the svn:external is pointing to,
and if it solves to problem and doesn't create new ones, checkin the new
external definition.

I've dealt with 3rd packages in this way plenty, and it works.

Anyhting terribly obvious I am missing here ?

--
Philippe M. Chiasson GPG: F9BFE0C2480E7680 1AE53631CB32A107 88C3A5A5
http://gozer.ectoplasm.org/   m/gozer\@(apache|cpan|ectoplasm)\.org/



signature.asc
Description: OpenPGP digital signature


Re: [ANNOUNCE] mod_perl-2.0.4

2008-04-18 Thread Philippe M. Chiasson

Foo JH wrote:
I don't know if it's known, but 2.2.4 is a relatively stable version in 
conjunction with AP5.8 + mp2.


I guess this means I can't move into 5.10 yet.

Issac Goldstand wrote:
I think we knew that (or am I getting mixed up with the mp1 RC?) and 
it was supposed to be a known issue...


Mixed up with the mp1 RC I believe. This problems seems like news to me ;-(

--
Philippe M. Chiasson GPG: F9BFE0C2480E7680 1AE53631CB32A107 88C3A5A5
http://gozer.ectoplasm.org/   m/gozer\@(apache|cpan|ectoplasm)\.org/



signature.asc
Description: OpenPGP digital signature


Re: reinitializing Perl's notion of $$ in mod_perl

2008-04-18 Thread Philippe M. Chiasson

Mark Blackman wrote:

On 17 Apr 2008, at 07:46, Philippe M. Chiasson wrote:

Mark Blackman wrote:

On 16 Apr 2008, at 10:24, Mark Blackman wrote:

On 16 Apr 2008, at 08:42, Philippe M. Chiasson wrote:
Can you try this simple patch and see if it makes your troubles  
go  away.

It does indeed have the desired effect of getting $$ reset to the
child pid by the time the PerlChildInitHandler handler is called.

Good, so it is clearly a bug then.


Right, so that's appropriate as a long term fix. I'll note that
on a very similar version of mod_perl/perl/apache on a linux
box, this problem doesn't crop up as though the hook calling
order works out differently there.

I couldn't for the life of me follow any details of the ap_hook_*
stuff.


I'm not quite sure what the positive result here suggests. Is that
patch appropriate as a long term fix? Should it be part of 2.0.4?

It'll be part of 2.0.5, since 2.0.4 has just been released.


durn. what timing.


Committed revision 649412.

It's going to be in 2.0.5

--
Philippe M. Chiasson GPG: F9BFE0C2480E7680 1AE53631CB32A107 88C3A5A5
http://gozer.ectoplasm.org/   m/gozer\@(apache|cpan|ectoplasm)\.org/



signature.asc
Description: OpenPGP digital signature


Re: reinitializing Perl's notion of $$ in mod_perl

2008-04-17 Thread Philippe M. Chiasson

Mark Blackman wrote:

On 16 Apr 2008, at 10:24, Mark Blackman wrote:

On 16 Apr 2008, at 08:42, Philippe M. Chiasson wrote:
Can you try this simple patch and see if it makes your troubles go  
away.

It does indeed have the desired effect of getting $$ reset to the
child pid by the time the PerlChildInitHandler handler is called.


Good, so it is clearly a bug then.


I'm not quite sure what the positive result here suggests. Is that
patch appropriate as a long term fix? Should it be part of 2.0.4?


It'll be part of 2.0.5, since 2.0.4 has just been released.

Any chance you could turn this bug into a patch to the test suite ?

--
Philippe M. Chiasson GPG: F9BFE0C2480E7680 1AE53631CB32A107 88C3A5A5
http://gozer.ectoplasm.org/   m/gozer\@(apache|cpan|ectoplasm)\.org/



signature.asc
Description: OpenPGP digital signature


[ANNOUNCE] mod_perl-2.0.4

2008-04-17 Thread Philippe M. Chiasson

Finally, it's here and it works with Perl 5.10!

http://apache.org/dist/perl/mod_perl-2.0.4.tar.gz
http://apache.org/dist/perl/mod_perl-2.0.4.tar.gz.asc (pgp sig)

The package is also available on CPAN:

  file: $CPAN/authors/id/G/GO/GOZER/mod_perl-2.0.4.tar.gz
  size: 3727717 bytes
   md5: 1a05625ae6843085f985f5da8214502a
  sha1: 65299a16ec414a690a48a2bbe63acaa3c6bb897b

Changes since 2.0.3:

Fix $r-location corruption under certain conditions
[Gozer]

Fix a crash when spawning Perl threads under Perl 5.10
[Gozer]

Fix erratic behaviour when filters were used with Perl 5.10
[Gozer]

Fix problems with redefinitions of perl_free as free and perl_malloc
as malloc on Win32, as described at
 http://marc.info/?l=apache-modperlm=119896407510526w=2
[Tom Donovan]

Fix a crash when running a sub-request from within a filter where
mod_perl was not the content handler. [Gozer]

Refactor tests to use keepalives instead of same_interp [Gozer, Phred]

Apache2::Reload has been moved to an externally maintained
CPAN distribution [Fred Moyer [EMAIL PROTECTED]]

PerlCleanupHandler are now registered with a subpool of $r-pool,
instead of $r-pool itself, ensuring they run _before_ any other
$r-pool cleanups [Torsten Foertsch]

Fix a bug that would prevent pnotes from being cleaned up properly
at the end of the request [Torsten Foertsch]

On Win32, embed the manifest file, if present, in mod_perl.so,
so as to work with VC 8 [Steve Hay, Randy Kobes]

Expose apr_thread_rwlock_t with the APR::ThreadRWLock module
[Torsten Foertsch]

Don't waste an extra interpreter anymore under threaded MPMs when using a
modperl handler [Torsten Foertsch]

Fix a bug that could cause a crash when using $r-push_handlers() multiple
times for a phase that has no configured handlers [Torsten Foertsch]

Catch up with some httpd API changes
  2.2.4:
   The full server version information is now included in the error log at
startup as well as server status reports, irrespective of the setting
of the ServerTokens directive. ap_get_server_version() is now
deprecated, and is replaced by ap_get_server_banner() and
ap_get_server_description(). [Jeff Trawick]

  2.3.0:
ap_get_server_version() has been removed. Third-party modules must
now use ap_get_server_banner() or ap_get_server_description().
[Gozer]

fixed Apache2::compat Apache2::ServerUtil::server_root() resolution
issues [Joshua Hoblitt]

*) SECURITY: CVE-2007-1349 (cve.mitre.org)
fix unescaped variable interprolation in regular expression
[Randal L. Schwartz [EMAIL PROTECTED], Fred Moyer [EMAIL PROTECTED]]

Make $r-the_request() writeable
[Fred Moyer [EMAIL PROTECTED]]

fix ModPerl::RegistryCooker::read_script to handle all possible
errors, previously there was a case where Apache2::Const::OK was
returned on an error.  [Eivind Eklund [EMAIL PROTECTED]]

a minor compilation warning resolved in modperl_handler_new_from_sv
[Stas]

a minor compilation warning resolved in modperl_gtop_size_string
[Stas]

Prevent direct use of _deprecated_ Apache2::ReadConfig in
Perl sections with httpd Alias directives from
incorrectly generating
'The Alias directive in x at line y will probably never match'
messages.
[Philip M. Gollucci [EMAIL PROTECTED]]

Prevent Apache2::PerSections::symdump() from returning invalid
httpd.conf snippets like 'Alias undef'
[Philip M. Gollucci [EMAIL PROTECTED]]

Require B-Size 0.9 for Apache2::Status which fixes
Can't call method script_name on an undefined value
[Philip M. Gollucci [EMAIL PROTECTED]]

-march=pentium4 or anything with an = in it in CCFLAGS or @ARGV
that gets passed to xs/APR/APR/Makefile.PL broke the @ARGV
parsing.  I.E. FreeBSD port builds when users had CPUTYPE
set in /etc/make.conf.
[Philip M. Gollucci [EMAIL PROTECTED]]

Fixes to get bleed-ithread (5.9.5+) to comile again.
[Philip M. Gollucci [EMAIL PROTECTED]]

--
Philippe M. Chiasson GPG: F9BFE0C2480E7680 1AE53631CB32A107 88C3A5A5
http://gozer.ectoplasm.org/   m/gozer\@(apache|cpan|ectoplasm)\.org/



signature.asc
Description: OpenPGP digital signature


Re: reinitializing Perl's notion of $$ in mod_perl

2008-04-16 Thread Philippe M. Chiasson

Mark Blackman wrote:

On 15 Apr 2008, at 13:51, Mark Blackman wrote:

While I did find Torsten Förtsch's very useful Perl::AfterFork  
module, surely the

mod_perl code must be doing something like this itself, no?

I'd be grateful to understand mod_perl's response to Perl's
pid caching is, given that forking *will* happen in the mod_perl
environment.


Ok, more investigation suggests we're seeing an ordering problem.

mod_perl (2.0.3) does reinitialize $$ in

modperl_hook_child_init  in mod_perl.c by calling

void modperl_perl_init_ids_server(server_rec *s) in modperl_perl.c

However, judicious sprinkling of printf statements suggests
very strongly that the above code gets called *AFTER* the
handler specified in PerlChildInitHandler.


That's most likely correct. From src/modules/perl/mod_perl.c:

ap_hook_child_init(modperl_hook_child_init, [...]); /* Handler for $$ */
modperl_register_handler_hooks();   /* Handler for 
PerlChildInit */

So I assume the hook ordering for the same level is LIFO.


Would anyone are to comment why the code above
would be done AFTER?


It shouldn't be, IMO.


The routine names suggest that modperl_hook_child_init()
would get called before a PerlChildInitHandler to me, but
my logging suggests otherwise.


Can you try this simple patch and see if it makes your troubles go away.

Untested
Index: src/modules/perl/mod_perl.c
===
--- src/modules/perl/mod_perl.c (revision 643757)
+++ src/modules/perl/mod_perl.c (working copy)
@@ -896,7 +896,7 @@
   NULL, NULL, MODPERL_HOOK_REALLY_REALLY_FIRST);

 ap_hook_child_init(modperl_hook_child_init,
-   NULL, NULL, APR_HOOK_FIRST);
+   NULL, NULL, MODPERL_HOOK_REALLY_REALLY_FIRST);

 modperl_register_handler_hooks();
 }
/Untested

--
Philippe M. Chiasson GPG: F9BFE0C2480E7680 1AE53631CB32A107 88C3A5A5
http://gozer.ectoplasm.org/   m/gozer\@(apache|cpan|ectoplasm)\.org/



signature.asc
Description: OpenPGP digital signature


Re: Access to Server and Request objects under Registry

2008-04-16 Thread Philippe M. Chiasson

Artem Kuchin wrote:

Hello!

Is there any way to access server and request objects
when script is running under Registry?


# From the top-level
my $r = shift;

OR
# PerlOptions +GlobalRequest
# Apache2::RequestUtil 
(http://perl.apache.org/docs/2.0/api/Apache2/RequestUtil.html#C_request_)
use Apache2::RequestUtil;
my $r = Apache2::RequestUtil-request

--
Philippe M. Chiasson GPG: F9BFE0C2480E7680 1AE53631CB32A107 88C3A5A5
http://gozer.ectoplasm.org/   m/gozer\@(apache|cpan|ectoplasm)\.org/



signature.asc
Description: OpenPGP digital signature


Re: broken link in online mod_perl documentation

2008-04-10 Thread Philippe M. Chiasson

Martin Armbrecht wrote:

Hi,

The file
http://perl.apache.org/docs/2.0/user/porting/compat.html
contains in section
---8---
Server Startuphttp://perl.apache.org/docs/2.0/user/porting/compat.html

mod_perl 1.0 was always running its startup code as soon as it was 
encountered. In mod_perl 2.0, it is not always the case. Refer to the 
mod_perl 2.0 startup process section section for details.

---8---

a link to
http://perl.apache.org/docs/2.0/user/config/config.html#Startup_Process
but the target Startup_Process is not defined there.

Besides, one 'section' in 'Refer to the mod_perl 2.0 startup process section 
section for details' should be enough, should'nt it?


Yes, and Yes! Thanks a lot, corrected.

Committed revision 646691.

Ended up linking to 
http://perl.apache.org/docs/2.0/user/handlers/server.html#mod_perl_Startup
instead.

--
Philippe M. Chiasson GPG: F9BFE0C2480E7680 1AE53631CB32A107 88C3A5A5
http://gozer.ectoplasm.org/   m/gozer\@(apache|cpan|ectoplasm)\.org/



signature.asc
Description: OpenPGP digital signature


Re: what handler phase as we in?

2008-04-07 Thread Philippe M. Chiasson

Anthony R Fletcher wrote:

I have a module that does authentication and authorisation. In my Apache
configs I have:

PerlAuthenHandler Apache2::AuthX::authenticate
PerlAuthzHandler  Apache2::AuthX::authorise

I'd rather just use:

PerlAuthenHandler Apache2::AuthX
PerlAuthzHandler  Apache2::AuthX

and let the handler function Apache2::AuthX::handler() deduce what has
to be done (i.e. authenticate or authorise).


You do end up paying a small overhead in forcing that determination at
run time in your code, but I agree it's somewhat neater.


How can handlers tell which phase they are currently in?


ModPerl::Util::current_callback()

http://perl.apache.org/docs/2.0/api/ModPerl/Util.html#C_current_callback_

--
Philippe M. Chiasson GPG: F9BFE0C2480E7680 1AE53631CB32A107 88C3A5A5
http://gozer.ectoplasm.org/   m/gozer\@(apache|cpan|ectoplasm)\.org/



signature.asc
Description: OpenPGP digital signature


Re: [RELEASE CANDIDATE] mod_perl-2.0.4 RC1

2008-04-07 Thread Philippe M. Chiasson

Jie Gao wrote:

uname -a

SunOS XXX 5.10 Generic_127111-10 sun4u sparc SUNW,Sun-Fire-V240

[...]


gmaek test


All tests successful, 8 tests and 13 subtests skipped.
Files=238, Tests=2559, 238 wallclock secs (180.48 cusr + 31.92 csys = 212.40 
CPU)
[warning] root mode: restoring the original files ownership
[warning] server localhost:8529 shutdown
cd ModPerl-Registry  make test
/usr/local/bin/perl -I../blib/arch -I../blib/lib \
t/TEST  -clean
APACHE_TEST_GROUP= APACHE_TEST_HTTPD= APACHE_TEST_PORT= APACHE_TEST_USER= 
APACHE_TEST_APXS= \
/usr/local/bin/perl -I../blib/arch -I../blib/lib \
t/TEST  -bugreport -verbose=0 
[warning] root mode: changing the files ownership to 'nobody' (60001:60001)

[warning] testing whether 'nobody' is able to -rwx 
/opt/local/src/mod_perl-2.0.4-rc1/ModPerl-Registry/t
/usr/local/bin/perl 
-Mlib=/opt/local/src/mod_perl-2.0.4-rc1/ModPerl-Registry/t/../../Apache-Test/lib 
-MApache::TestRun -e 'eval { Apache::TestRun::run_root_fs_test(60001, 60001, 
q[/opt/local/src/mod_perl-2.0.4-rc1/ModPerl-Registry/t]) }';


[warning] result: OK
[warning] the client side drops 'root' permissions and becomes 'nobody'
/usr/local/httpd-2.2.8+mod_perl-2.0.4-rc1/bin/httpd  -d /opt/local/src/mod_perl-2.0.4-rc1/ModPerl-Registry/t -f /opt/local/src/mod_perl-2.0.4-rc1/ModPerl-Registry/t/conf/httpd.conf -D APACHE2 
using Apache/2.2.8 (prefork MPM)


waiting 90 seconds for server to start: 
waiting 90 seconds for server to start: ok (waited 3 secs)
server localhost:8529 started
t/206ok  
t/304ok  
t/404ok  
t/500ok  
t/bad_scriptsok  
t/basic..ok  
t/bin_resp...ok  
t/cgiok  
t/closureok  
t/dirindex...ok  
t/fatalstobrowserskipped

all skipped: fatalsToBrowser known not to work, CGI version 99.99 or 
higher is required
t/flush..ok  
t/ithreads...skipped

all skipped: perl 5.8.1 or higher w/ithreads enabled is required
t/nphok  
t/perlrun_extload# Failed test 1 in t/perlrun_extload.t at line 17
t/perlrun_extloadFAILED test 1   
Failed 1/2 tests, 50.00% okay


Any chance you can run

cd ModPerl-Registry  t/TEST -run -v t/perlrun_extload

And post the verbose output. Also, is there anything in 
ModPerl-Registry/t/log/error_log that's
possibly relevant ?

--
Philippe M. Chiasson GPG: F9BFE0C2480E7680 1AE53631CB32A107 88C3A5A5
http://gozer.ectoplasm.org/   m/gozer\@(apache|cpan|ectoplasm)\.org/



signature.asc
Description: OpenPGP digital signature


Re: APR::Socket SSL

2008-04-04 Thread Philippe M. Chiasson



Mike Cardwell wrote:

Hi,

I'm writing a PerlProcessConnectionHandler. It starts:

sub handler {
my $c = shift;
my $sock = $c-client_socket;

$sock is an instance of APR::Socket. The problem is that the connection 
is using SSL and I need to be able to read/write the unencrypted socket 
stream. If $sock was an instance of IO::Socket I could just do a 
IO::Socket::SSL-start_SSL( $sock ) to handle SSL negotiation and to get 
access to the unencrypted stream, but how do I do it with APR::Socket?


You can't, not that way. If there was a way to get at the underlying
native socket, you could break all filtering. What you need to do here instead,
is to leave the SSL processing to mod_ssl, and stack yourself on top of it 
somehow.

I don't see any other way around this.

Also, and I'm guessing this is a big no. Is it possible to have a 
PerlProcessConnectionHandler that reads the first few bytes from the 
socket then decides that it doesn't want to continue so puts them back 
on the stack and then hands off to the next phase for normal processing?


That, you can do with ease. You'd write an input filter, pop enough data
out of the input brigade until you can figure out what you want to do, and if
you want to pass it all thru, you reinsert what you read back in the brigade,
remove yourself completely from the filter chain, and pass it up.

That's should be fairly easy.

--
Philippe M. Chiasson GPG: F9BFE0C2480E7680 1AE53631CB32A107 88C3A5A5
http://gozer.ectoplasm.org/   m/gozer\@(apache|cpan|ectoplasm)\.org/



signature.asc
Description: OpenPGP digital signature


[RELEASE CANDIDATE] mod_perl-1.31 RC4

2008-04-02 Thread Philippe M. Chiasson

The mod_perl 1.31 release candidate 4 Works with Perl 5.10 is ready. It can 
be downloaded here:

http://www.apache.org/~gozer/mp1/mod_perl-1.31-rc4.tar.gz

MD5:  ba12ce36c4c738bccfa93ab646a6824c
SHA1: 2de6ce29f44505cfdca34b7aa6499d961c72953b

Please give it a spin in your favorite configuration and report
any problems. Especially needed against Perl-5.10.

The summary of what has changed since 1.30 are (from Changes):

Fix potential segfault when the environment contains
NULL values [Mike Schilli]

Fix static APACI build against newer apache-1.3.38+
[Gozer]

Fixed modules/regex.t test 4 on Win32
[Steve Hay]

Avoid possible segfault when PerlFreshRestart is On.
[Michael Rendell [EMAIL PROTECTED]]

Prevent segfault when running with perl = 5.9.3
[Steve Hay]

Fix shared libary extensions on Win32 to be .dll not .so
[Nikolay Ananiev [EMAIL PROTECTED]]

Patch to mod_perl.dsp to remove /D _WINSOCK2API_ on Win32
for perl = 5.8.6 [Steve Hay]

--
Philippe M. Chiasson GPG: F9BFE0C2480E7680 1AE53631CB32A107 88C3A5A5
http://gozer.ectoplasm.org/   m/gozer\@(apache|cpan|ectoplasm)\.org/





signature.asc
Description: OpenPGP digital signature


[RELEASE CANDIDATE] mod_perl-2.0.4 RC1

2008-04-02 Thread Philippe M. Chiasson

The mod_perl 2.0.4 release candidate 1 Works with Perl 5.10 is ready. It can 
be downloaded here:

http://www.apache.org/~gozer/mp2/mod_perl-2.0.4-rc1.tar.gz

MD5:  1f0a941e8b5f26b6102126ae67ddbb43
SHA1: 8b2ceede3c783b9b2cc9e0fe63a095b0e4a1f000

Please give it a spin in your favorite configuration and report
any problems. Especially needed against Perl-5.10 on Windows.

The summary of what has changed since 2.0.3 are (from Changes):

Fix $r-location corruption under certain conditions
[Gozer]

Fix a crash when spawning Perl threads under Perl 5.10
[Gozer]

Fix erratic behaviour when filters were used with Perl 5.10
[Gozer]

Fix problems with redefinitions of perl_free as free and perl_malloc
as malloc on Win32, as described at
 http://marc.info/?l=apache-modperlm=119896407510526w=2
[Tom Donovan]

Fix a crash when running a sub-request from within a filter where
mod_perl was not the content handler. [Gozer]

Refactor tests to use keepalives instead of same_interp [Gozer, Phred]

Apache2::Reload has been moved to an externally maintained
CPAN distribution [Fred Moyer [EMAIL PROTECTED]]

PerlCleanupHandler are now registered with a subpool of $r-pool,
instead of $r-pool itself, ensuring they run _before_ any other
$r-pool cleanups [Torsten Foertsch]

Fix a bug that would prevent pnotes from being cleaned up properly
at the end of the request [Torsten Foertsch]

On Win32, embed the manifest file, if present, in mod_perl.so,
so as to work with VC 8 [Steve Hay, Randy Kobes]

Expose apr_thread_rwlock_t with the APR::ThreadRWLock module
[Torsten Foertsch]

Don't waste an extra interpreter anymore under threaded MPMs when using a
modperl handler [Torsten Foertsch]

Fix a bug that could cause a crash when using $r-push_handlers() multiple
times for a phase that has no configured handlers [Torsten Foertsch]

Catch up with some httpd API changes
  2.2.4:
   The full server version information is now included in the error log at
startup as well as server status reports, irrespective of the setting
of the ServerTokens directive. ap_get_server_version() is now
deprecated, and is replaced by ap_get_server_banner() and
ap_get_server_description(). [Jeff Trawick]

  2.3.0:
ap_get_server_version() has been removed. Third-party modules must
now use ap_get_server_banner() or ap_get_server_description().
[Gozer]

fixed Apache2::compat Apache2::ServerUtil::server_root() resolution
issues [Joshua Hoblitt]

*) SECURITY: CVE-2007-1349 (cve.mitre.org)
fix unescaped variable interprolation in regular expression
[Randal L. Schwartz [EMAIL PROTECTED], Fred Moyer [EMAIL PROTECTED]]

Make $r-the_request() writeable
[Fred Moyer [EMAIL PROTECTED]]

fix ModPerl::RegistryCooker::read_script to handle all possible
errors, previously there was a case where Apache2::Const::OK was
returned on an error.  [Eivind Eklund [EMAIL PROTECTED]]

a minor compilation warning resolved in modperl_handler_new_from_sv
[Stas]

a minor compilation warning resolved in modperl_gtop_size_string
[Stas]

Prevent direct use of _deprecated_ Apache2::ReadConfig in
Perl sections with httpd Alias directives from
incorrectly generating
'The Alias directive in x at line y will probably never match'
messages.
[Philip M. Gollucci [EMAIL PROTECTED]]

Prevent Apache2::PerSections::symdump() from returning invalid
httpd.conf snippets like 'Alias undef'
[Philip M. Gollucci [EMAIL PROTECTED]]

Require B-Size 0.9 for Apache2::Status which fixes
Can't call method script_name on an undefined value
[Philip M. Gollucci [EMAIL PROTECTED]]

-march=pentium4 or anything with an = in it in CCFLAGS or @ARGV
that gets passed to xs/APR/APR/Makefile.PL broke the @ARGV
parsing.  I.E. FreeBSD port builds when users had CPUTYPE
set in /etc/make.conf.
[Philip M. Gollucci [EMAIL PROTECTED]]

Fixes to get bleed-ithread (5.9.5+) to comile again.
[Philip M. Gollucci [EMAIL PROTECTED]]

--
Philippe M. Chiasson GPG: F9BFE0C2480E7680 1AE53631CB32A107 88C3A5A5
http://gozer.ectoplasm.org/   m/gozer\@(apache|cpan|ectoplasm)\.org/





signature.asc
Description: OpenPGP digital signature


Re: [mp2] $s-protocol returns INCLUDED

2008-04-02 Thread Philippe M. Chiasson

Ryan Gies wrote:

What causes $s-protocol() to return the string INCLUDED?


SSI includes / mod_include

--
Philippe M. Chiasson GPG: F9BFE0C2480E7680 1AE53631CB32A107 88C3A5A5
http://gozer.ectoplasm.org/   m/gozer\@(apache|cpan|ectoplasm)\.org/



signature.asc
Description: OpenPGP digital signature


Re: [mp2] $s-protocol returns INCLUDED

2008-04-02 Thread Philippe M. Chiasson

Philippe M. Chiasson wrote:

Ryan Gies wrote:

What causes $s-protocol() to return the string INCLUDED?


SSI includes / mod_include


Take that back, I am wrong. It's set by the subrequest mechanism, so it
will be set for internal sub-requests.

An SSI virtual include:

!--#include virtual=/foo/bar --

Is just one case, anything that triggers a subrequest will do it too.

--
Philippe M. Chiasson GPG: F9BFE0C2480E7680 1AE53631CB32A107 88C3A5A5
http://gozer.ectoplasm.org/   m/gozer\@(apache|cpan|ectoplasm)\.org/



signature.asc
Description: OpenPGP digital signature


Re: error installing mod_perl 2 - perl_require_module

2008-03-20 Thread Philippe M. Chiasson

Jo bu wrote:
Hi, I am trying to run apache 2.2.8 on solaris 10. I've gone through a 
number of issues, and now I have it running with mod_perl 2.


However,  I get an error from the runtime that has to do with 
perl_require_module. This is the error...


ld.so.1: httpd: fatal: relocation error: file 
/data/users/username/perl/lib/site_perl/5.8.5/sun4-solaris/auto/Apache/Constants/Constants.so: 
symbol perl_require_module: referenced symbol not found


I tried perlmonks, but they refered me back to this list. The only 
machine I have to test this on is a development server that also has a 
apache1 running with mod_perl 1, so I need this to work concurrently.


Any ideas? Thank you for your help.


Sounds to me like you've got an issue with having tried to install
mod_perl 1 and mod_perl 2 in the same perl tree, that's not supported.

--
Philippe M. Chiasson GPG: F9BFE0C2480E7680 1AE53631CB32A107 88C3A5A5
http://gozer.ectoplasm.org/   m/gozer\@(apache|cpan|ectoplasm)\.org/



signature.asc
Description: OpenPGP digital signature


Re: [mp2] Perl 5.10 fixes from SVN cause SIGBUS on sparc

2008-03-12 Thread Philippe M. Chiasson

Niko Tyni wrote:

On Mon, Mar 10, 2008 at 10:53:54PM -0700, Philippe M. Chiasson wrote:


Niko Tyni wrote:

We're switching to Perl 5.10 in Debian soon, and I'm trying to update the
mod_perl2 package to keep it working. Unfortunately the ModPerl-Registry
test suite is failing on the Sparc architecture because apache2 is killed
by a bus error (SIGBUS).



How about this s/U16/U32/ diff, basically keeping the flag type at U32,
since it was not an essential part of the fix itself.


No, that doesn't help either.

It turns out the U16/U32 thing was a bad guess on my part. After
some code staring and debugging, I found the real bug. It's not
architecture-specific really, it just happens to bite worst on Sparc.


Thanks a lot for the debugging work!

Committed revision 636631.

--
Philippe M. Chiasson GPG: F9BFE0C2480E7680 1AE53631CB32A107 88C3A5A5
http://gozer.ectoplasm.org/   m/gozer\@(apache|cpan|ectoplasm)\.org/



signature.asc
Description: OpenPGP digital signature


Re: strange permission errors

2008-03-11 Thread Philippe M. Chiasson



Mag Gam wrote:

I get, The account is not currently available.


That account has a disabled shell

$ su apache -s `which sh` -c '/bin/ls /tmp/.s.PGSQL.5432'

Look at the permissions on both /tmp and /tmp/.s.PGSQL.5432

$ ls -ld /tmp
$ ls -l /tmp/.s.PGSQL.5432

--
Philippe M. Chiasson GPG: F9BFE0C2480E7680 1AE53631CB32A107 88C3A5A5
http://gozer.ectoplasm.org/   m/gozer\@(apache|cpan|ectoplasm)\.org/



signature.asc
Description: OpenPGP digital signature


Re: [mp2] Perl 5.10 fixes from SVN cause SIGBUS on sparc

2008-03-10 Thread Philippe M. Chiasson

Niko Tyni wrote:

[Resending, as my first try on March 1st apparently got lost somewhere.
 Apologies if this ends up as a duplicate.]

1. Problem Description:

We're switching to Perl 5.10 in Debian soon, and I'm trying to update the
mod_perl2 package to keep it working. Unfortunately the ModPerl-Registry
test suite is failing on the Sparc architecture because apache2 is killed
by a bus error (SIGBUS).

I can reproduce this with a clean current SVN trunk (r631932)
without any Debian-specific changes, and bisecting shows it broke with
r620440. This is still with Perl 5.8.8 (from Debian unstable, package
version 5.8.8-12).

The kernel messages show the SIGBUS is an unaligned access (as usual on
Sparc). I assume the U32-U16 changes in r615751 are related.


Good old Sparc!

Does this patch make the problem go away? (untested)

Index: src/modules/perl/modperl_mgv.c
===
--- src/modules/perl/modperl_mgv.c  (revision 635455)
+++ src/modules/perl/modperl_mgv.c  (working copy)
@@ -271,7 +271,7 @@
 }
 else {
 if ((cv = get_cv(name, FALSE))) {
-handler-attrs = *modperl_code_attrs(aTHX_ cv);
+memcpy((handler-attrs),modperl_code_attrs(aTHX_ cv), 
sizeof(handler-attrs));
 handler-mgv_cv =
 modperl_mgv_compile(aTHX_ p, HvNAME(GvSTASH(CvGV(cv;
 modperl_mgv_append(aTHX_ p, handler-mgv_cv, GvNAME(CvGV(cv)));
@@ -334,7 +334,7 @@
 modperl_mgv_new_name(handler-mgv_obj, p, name);
 }

-handler-attrs = *modperl_code_attrs(aTHX_ cv);
+memcpy((handler-attrs),modperl_code_attrs(aTHX_ cv), 
sizeof(handler-attrs));
 /* note: this is the real function after @ISA lookup */
 handler-mgv_cv = modperl_mgv_compile(aTHX_ p, HvNAME(GvSTASH(gv)));
 modperl_mgv_append(aTHX_ p, handler-mgv_cv, handler_name);

--
Philippe M. Chiasson GPG: F9BFE0C2480E7680 1AE53631CB32A107 88C3A5A5
http://gozer.ectoplasm.org/   m/gozer\@(apache|cpan|ectoplasm)\.org/



signature.asc
Description: OpenPGP digital signature


Re: strange permission errors

2008-03-10 Thread Philippe M. Chiasson

Mag Gam wrote:

Hi Gurus:

Moving my application from development to production server. For some 
reason, I can't seem to execute my application when using mod_perl in 
production. I keep getting this permission error:
[Mon Mar 10 13:47:33 2008] [error] Can't call method prepare on an 
undefined value at /var/www/:app/index.pl line 26.\n
DBI connect('testdb','dbusr',...) failed: Couldn't connect to 
/tmp/.s.PGSQL.5432: connect: Permission denied at 
/usr/lib/perl5/site_perl/5.8.5/DBD/PgPP.pm line 124

 at /var/www/app/index.pl line 24
[Mon Mar 10 18:49:19 2008] [error] Can't call method prepare on an 
undefined value at /var/www/app/index.pl line 26.\n
DBI connect('testdb','dbusr',...) failed: Couldn't connect to 
/tmp/.s.PGSQL.5432: connect: Permission denied at 
/usr/lib/perl5/site_perl/5.8.5/DBD/PgPP.pm line 124

 at /var/www/app/index.pl line 24
[Mon Mar 10 20:05:36 2008] [error] Can't call method prepare on an 
undefined value at /var/www/app/index.pl line 26.\n


httpd runs as a non-root user, usually 'httpd' or 'apache'.

Can that user access the PosgreSQL named pipe: /tmp/.s.PGSQL.5432

$ su apache -c '/bin/ls /tmp/.s.PGSQL.5432'

Should give you an idea what's up.

--
Philippe M. Chiasson GPG: F9BFE0C2480E7680 1AE53631CB32A107 88C3A5A5
http://gozer.ectoplasm.org/   m/gozer\@(apache|cpan|ectoplasm)\.org/



signature.asc
Description: OpenPGP digital signature


Re: return DECLINED or OK?

2008-02-28 Thread Philippe M. Chiasson

J. Peng wrote:

At what cases should we return a DECLINED or a OK from a handler?


Depends on the request phase you are running under, and ultimately, it's
dictated by apache [1]


I saw the handler of PerlTransHandler returns a
Apache2::Const::DECLINED but dont know why.


In a nutshell, there are 3 main type or return status:

OK

Means you kicked in to do what you were supposed to, and you succeded.

For instance, an PerlAuthHandler that checks username/password against
a database and finds a match, that's OK

DECLINED

Your handler kicked in, tried to do what it's interested in doing and
decided _not_ to do it, or had nothing to do, and usually, it means the
next handler down the handler stack will have a go at it.

For instance, a PerlOutputFilter might be registered, but only care to
filter text/html stuff. So it kicks in, looks at the content-type of the
current request, sees image/gif, so it returns DECLINED to indicate it's
passing its turn and somebody else should have a go at it.

ERRORS

There are many error codes one can return, mostly HTTP error codes, 404, 501,
etc.

Usually, when a handler doesn't return OK/DECLINED, whatever it returns will
be treated as an error, and the request will abort and report that particular
error.

[1] http://perl.apache.org/docs/2.0/user/handlers/intro.html#Stacked_Handlers

--
Philippe M. Chiasson GPG: F9BFE0C2480E7680 1AE53631CB32A107 88C3A5A5
http://gozer.ectoplasm.org/   m/gozer\@(apache|cpan|ectoplasm)\.org/



signature.asc
Description: OpenPGP digital signature


[RELEASE CANDIDATE] mod_perl-1.31 RC3

2008-02-26 Thread Philippe M. Chiasson

The mod_perl 1.31 release candidate 3 Works with Perl 5.10 is ready. It can 
be downloaded here:

http://www.apache.org/~gozer/mp1/mod_perl-1.31-rc3.tar.gz

MD5:  979059e20febef686e7c2a4d55fe3683
SHA1: c747ef7d605694ca935795ea7793ea7c77dfa920

The summary of what has changed since 1.30 are (from Changes):

Fix static APACI build against newer apache-1.3.38+
[Gozer]

Fixed modules/regex.t test 4 on Win32
[Steve Hay]

Avoid possible segfault when PerlFreshRestart is On.
[Michael Rendell [EMAIL PROTECTED]]

Prevent segfault when running with perl = 5.9.3
[Steve Hay]

Fix shared libary extensions on Win32 to be .dll not .so
[Nikolay Ananiev [EMAIL PROTECTED]]

Patch to mod_perl.dsp to remove /D _WINSOCK2API_ on Win32
for perl = 5.8.6 [Steve Hay]

--
Philippe M. Chiasson GPG: F9BFE0C2480E7680 1AE53631CB32A107 88C3A5A5
http://gozer.ectoplasm.org/   m/gozer\@(apache|cpan|ectoplasm)\.org/



signature.asc
Description: OpenPGP digital signature


Re: svn commit: r628359 - /perl/modperl/trunk/lib/ModPerl/WrapXS.pm

2008-02-17 Thread Philippe M. Chiasson

[EMAIL PROTECTED] wrote:

Author: randyk
Date: Sat Feb 16 08:59:58 2008
New Revision: 628359

URL: http://svn.apache.org/viewvc?rev=628359view=rev
Log:
replace amp; by 


print dhu! x 1_000_000;

--
Philippe M. Chiasson GPG: F9BFE0C2480E7680 1AE53631CB32A107 88C3A5A5
http://gozer.ectoplasm.org/   m/gozer\@(apache|cpan|ectoplasm)\.org/



signature.asc
Description: OpenPGP digital signature


Re: svn commit: r617965 - /perl/modperl/trunk/ModPerl-Registry/t/conf/extra.conf.in

2008-02-03 Thread Philippe M. Chiasson

Philip M. Gollucci wrote:

On Sun, 3 Feb 2008, [EMAIL PROTECTED] wrote:


Author: gozer
Date: Sun Feb  3 01:10:04 2008
New Revision: 617965

URL: http://svn.apache.org/viewvc?rev=617965view=rev
Log:
Apache::Reload isn't part of the core anymore, so don't expect
it to be available.
I thought this took a similiar root to Apache-SizeLimit and is pulled in 
via and SVN external.


Not sure if that's really planned for yet. It hasn't been done in
any case, and it was unnecessary in the test suite.

--
Philippe M. Chiasson GPG: F9BFE0C2480E7680 1AE53631CB32A107 88C3A5A5
http://gozer.ectoplasm.org/   m/gozer\@(apache|cpan|ectoplasm)\.org/



signature.asc
Description: OpenPGP digital signature


Re: mod_perl's make test fails.

2008-02-02 Thread Philippe M. Chiasson

Colin Wetherbee wrote:

Zakk wrote:
For the last few days, I've been trying to install mod_perl for my 
server. It's running Slackware 12.0 with Apache 2.2.8 (with APR 1.2.12) 
and Perl 5.10.0.


I'm under the impression we're still under the don't use Perl 5.10 with 
mod_perl yet directive.


That's pretty much correct, for the threaded case.

trunk/ should be working just fine on prefork now, more testing of this
fact would certainly be welcome.

--
Philippe M. Chiasson GPG: F9BFE0C2480E7680 1AE53631CB32A107 88C3A5A5
http://gozer.ectoplasm.org/   m/gozer\@(apache|cpan|ectoplasm)\.org/



signature.asc
Description: OpenPGP digital signature


Re: mod_perl, Perl 5.10, Apache 2.2.6 = Tests fail

2008-01-26 Thread Philippe M. Chiasson
75bc76f8 cond_wait (102778c10, 102778bd0, 100059ea8,
76a1ca08, 62c01390, 77f2f6d8) + 10
75bc7734 pthread_cond_wait (102778c10, 102778bd0, 0, 100059ea8,
0, 0) + 8
76a1ca08 apr_thread_cond_wait (102778c08, 102778bc8, 1,
75cf14c0, 1, 1001848e0) + 18
000100059ea8 ap_queue_pop (102778ba0, 622fbe50,
622fbe38, 0, 0, 6e704228) + 50
000100055a1c worker_thread (0, 103ba94c0, 0, 1, 1, 1) + 1ec
76a2e558 dummy_worker (102778d80, 1fc000, 0, 0,
76a2e540, 1) + 18
75bcd880 _lwp_start (0, 0, 0, 0, 0, 0)
-  lwp# 5 / thread# 5  
75bcdda8 _portfs (64, 102784a70, 27, 620fbd1c, 0, 0) + 8
76a286e0 apr_pollset_poll (1027849f8, ,
620fbe1c, 620fbe10, 0, 0) + 1a0
000100055290 listener_thread (102778db0, 1, 1, 1, 100189438, 0) +
3b0
76a2e558 dummy_worker (102778db0, 1fc000, 0, 0,
76a2e540, 1) + 18
75bcd880 _lwp_start (0, 0, 0, 0, 0, 0)



[EMAIL PROTECTED]/src/modperl-2.0 perl -V
Summary of my perl5 (revision 5 version 10 subversion 0) configuration:
 Platform:
   osname=solaris, osvers=2.10, archname=sun4-solaris-thread-multi-64-ld
   uname='sunos semele 5.10 generic_118833-36 sun4u sparc
sunw,sun-fire-v440 solaris '
   config_args=''
   hint=recommended, useposix=true, d_sigaction=define
   useithreads=define, usemultiplicity=define
   useperlio=define, d_sfio=undef, uselargefiles=define, usesocks=undef
   use64bitint=define, use64bitall=define, uselongdouble=define
   usemymalloc=n, bincompat5005=undef
 Compiler:
   cc='/opt/SUNWspro/bin/cc', ccflags ='-D_REENTRANT -mt
-I/digibib/tools/include -I/usr/local/include -xarch=v9b -xcode=abs64
-D_LARGEFILE_SOURCE -D_FILE_OFFSET_BITS=64 -DPERL_USE_SAFE_PUTENV
-xarch=generic64 -D_LARGEFILE_SOURCE -D_FILE_OFFSET_BITS=64',
   optimize='-xO5',
   cppflags='-D_REENTRANT -mt -I/digibib/tools/include
-I/usr/local/include -xarch=v9b -xcode=abs64 -D_LARGEFILE_SOURCE
-D_FILE_OFFSET_BITS=64 -DPERL_USE_SAFE_PUTENV'
   ccversion='Sun C 5.8 2005/10/13', gccversion='', gccosandvers=''
   intsize=4, longsize=8, ptrsize=8, doublesize=8, byteorder=87654321
   d_longlong=define, longlongsize=8, d_longdbl=define, longdblsize=16
   ivtype='long', ivsize=8, nvtype='long double', nvsize=16,
Off_t='off_t', lseeksize=8
   alignbytes=16, prototype=define
 Linker and Libraries:
   ld='/opt/SUNWspro/bin/cc', ldflags ='-L/opt/SUNWspro/prod/lib
-L/digibib/tools/lib -L/usr/lib/64 -L/usr/lib -L/lib/64 -L/lib
-L/usr/local/lib -xarch=v9b -xarch=generic64 '
   libpth=/opt/SUNWspro/prod/lib /digibib/tools/lib /usr/lib/64 /usr/lib
/lib/64 /lib /usr/local/lib
   libs=-lsocket -lnsl -ldb -ldl -lm -lpthread -lc -lsunmath
   perllibs=-lsocket -lnsl -ldl -lm -lpthread -lc -lsunmath
   libc=/usr/lib/sparcv9/libc.so, so=so, useshrplib=true,
libperl=libperl.so
   gnulibc_version=''
 Dynamic Linking:
   dlsrc=dl_dlopen.xs, dlext=so, d_dlsymun=undef, ccdlflags='  -R
/digibib/tools/lib/perl5/5.10.0/sun4-solaris-thread-multi-64-ld/CORE'
   cccdlflags='-KPIC', lddlflags='-G -xarch=v9b -L/opt/SUNWspro/prod/lib
-L/digibib/tools/lib -L/usr/lib/64 -L/usr/lib -L/lib/64 -L/lib
-L/usr/local/lib'


Characteristics of this binary (from libperl):
 Compile-time options: MULTIPLICITY PERL_DONT_CREATE_GVSV
   PERL_IMPLICIT_CONTEXT PERL_MALLOC_WRAP
   PERL_USE_SAFE_PUTENV USE_64_BIT_ALL
USE_64_BIT_INT
   USE_ITHREADS USE_LARGE_FILES USE_LONG_DOUBLE
   USE_PERLIO USE_REENTRANT_API
 Built under solaris
 Compiled at Dec 19 2007 21:46:18
 @INC:
   /digibib/tools/lib/perl5/5.10.0/sun4-solaris-thread-multi-64-ld
   /digibib/tools/lib/perl5/5.10.0

/digibib/tools/lib/perl5/site_perl/5.10.0/sun4-solaris-thread-multi-64-ld
   /digibib/tools/lib/perl5/site_perl/5.10.0
   /digibib/tools/lib/perl5/site_perl/5.8.8
   /digibib/tools/lib/perl5/site_perl
   .





--
Philippe M. Chiasson GPG: F9BFE0C2480E7680 1AE53631CB32A107 88C3A5A5
http://gozer.ectoplasm.org/   m/gozer\@(apache|cpan|ectoplasm)\.org/



signature.asc
Description: OpenPGP digital signature


Re: Perl directive not allowed in a Location block

2008-01-24 Thread Philippe M. Chiasson

kgerbasi wrote:

I am currently upgrading our Apache server from 1.3 to 2.2 and I'm
encountering the following error when I try to start Apache. The config
works ok in 1.3, however in 2.2 I get the following error 'Perl directive
not allowed in a Location block'.  


Can I no longer put a perl directive in a location block?


Not anymore, no.

Can you post a more detailled example of what you are trying to do?

--
Philippe M. Chiasson GPG: F9BFE0C2480E7680 1AE53631CB32A107 88C3A5A5
http://gozer.ectoplasm.org/   m/gozer\@(apache|cpan|ectoplasm)\.org/



signature.asc
Description: OpenPGP digital signature


Re: PerlProcessConnectionHandler doesn't respond directly

2008-01-22 Thread Philippe M. Chiasson

Dirk van der Zee wrote:

Hi All,

I have written a POP3 protocol-handler which uses the 
PerlProcessConnectionHandler. The solution worked fine under 
Apache 2.0 and ModPerl 2.0, but after an upgrade to 
Apache 2.2 and Mod_Perl 2.0.2 it doesn't work correctly. 
(We upgraded from Ubuntu-Dapper to Ubuntu-Gutsy).


That's could be because since Apache 2.0.49, you have need to
set the socket to blocking mode explicitely.

From the test suite:

# starting from Apache 2.0.49 several platforms require you to set
# the socket to a blocking IO mode
my $nonblocking = $socket-opt_get(APR::Const::SO_NONBLOCK);
if ($nonblocking) {
$socket-opt_set(APR::Const::SO_NONBLOCK, 0);

# test that we really *are* in the blocking mode
!$socket-opt_get(APR::Const::SO_NONBLOCK)
or die failed to set blocking mode;
}

Specifically the problem is that the sub handler gets called 
only after the client sends a linefeed. In the old situation 
the handler started directly. The POP3 protocol needs a +OK response

 after the connection has been established.


Are you sure of that, I would think your handler gets called, just that
the $sock-send() gets buffered incorrectly, and not sent to the client
yet.

--
Philippe M. Chiasson GPG: F9BFE0C2480E7680 1AE53631CB32A107 88C3A5A5
http://gozer.ectoplasm.org/   m/gozer\@(apache|cpan|ectoplasm)\.org/



signature.asc
Description: OpenPGP digital signature


Re: compiling problems with mod_perl 2.0.3 and Apache 2.2.6

2008-01-21 Thread Philippe M. Chiasson



James Breat wrote:

I am having problems a static mod_perl with Apache 2.2.6 and
Perl 5.10.0.

I followed the instructions for a static build, but when I type make I 
get the following errors (only a few

same error lines are included):

httpd-2.2.6/srclib/apr/include/apr.h:273: error: expected '=', ',', ';', 
'asm' or '__attribute__' before 'apr_off_t'
httpd-2.2.6/srclib/apr-util/include/apr_buckets.h:242: error: expected 
specifier-qualifier-list before 'apr_off_t'
httpd-2.2.6/srclib/apr/include/apr_strings.h:315: error: expected ')' 
before '*' token


Sounds like your compiler realy doesn't like something in APR.

Have you tried just trying to build apr by itself.

$ cd httpd-2.2.6/srclib/apr
$ ./configure
$ make

If that still spits out the above errors, it's not a mod_perl problem,
but something about your system and APR doesn't agree.

Could you post the few lines around the offending section of apr.h (around line 
273)?


mod_perl.c:1058: error: 'request_rec' has no member named 'handler'
make[1]: *** [mod_perl.o] Error 1

Any idea on what's going on?


Again, sounds like there is something in your httpd tree that isn't getting
digested quite right by your compiler.

--
Philippe M. Chiasson GPG: F9BFE0C2480E7680 1AE53631CB32A107 88C3A5A5
http://gozer.ectoplasm.org/   m/gozer\@(apache|cpan|ectoplasm)\.org/



signature.asc
Description: OpenPGP digital signature


Re: compiling problems with mod_perl 2.0.3 and Apache 2.2.6

2008-01-21 Thread Philippe M. Chiasson

Heiko Jansen wrote:

Am Freitag, den 18.01.2008, 15:47 +1030 schrieb James Breat:

I am having problems a static mod_perl with Apache 2.2.6 and
Perl 5.10.0.


Essentially, the answer you need is: Don't use mod_perl2 and Perl 5.10.0
together yet.


Not yet, nope.


As far as I know, the mod_perl developers are working on resolving the
issues (caused by internal changes in Perl 5.10) right now.
So we both have to wait for mod_perl 2.0.4...


Yes, but mod_perl 2.0.3 and Perl 5.10 should at least _build_, just
possibly exhibit unnatural behaviour at runtime...

--
Philippe M. Chiasson GPG: F9BFE0C2480E7680 1AE53631CB32A107 88C3A5A5
http://gozer.ectoplasm.org/   m/gozer\@(apache|cpan|ectoplasm)\.org/



signature.asc
Description: OpenPGP digital signature


Re: [RELEASE CANDIDATE] Apache-Reload 0.10 RC3

2008-01-16 Thread Philippe M. Chiasson

Fred Moyer wrote:

Greetings,

Third time is the charm :)  RC1 and RC2 were missing 
t/conf/extra.conf.in from the MANIFEST.


I've updated the release procedure to run make disttest to identify 
these errors, and fixed the problem.


All tests pass for me on:

1) Leopard mp2, 5.8.8


Same here on Leopard.

All tests successful.
Files=1, Tests=3,  1 wallclock secs ( 0.01 usr  0.00 sys +  0.36 cusr  0.07 
csys =  0.44 CPU)
Result: PASS

--
Philippe M. Chiasson GPG: F9BFE0C2480E7680 1AE53631CB32A107 88C3A5A5
http://gozer.ectoplasm.org/   m/gozer\@(apache|cpan|ectoplasm)\.org/



signature.asc
Description: OpenPGP digital signature


Re: APR::SockAddr

2008-01-06 Thread Philippe M. Chiasson

Axel Huizinga wrote:

Hi,

Suddenly on of my mod_perl handlers is broken with the following error:

Can't locate object method ip_get via package APR::SockAddr

at line:
my $ip = $self-{r}-connection-remote_addr-ip_get;

(temporary replaced by  $ENV{'REMOTE_ADDR'} - now the handler works again)

I didn't change the code before the error appeared - can the 
configuration cause this behavior?


Missing:

use APR::SockAddr ();

somewhere ?

--
Philippe M. Chiasson GPG: F9BFE0C2480E7680 1AE53631CB32A107 88C3A5A5
http://gozer.ectoplasm.org/   m/gozer\@(apache|cpan|ectoplasm)\.org/



signature.asc
Description: OpenPGP digital signature


Re: Process exists - Segmentation fault

2008-01-02 Thread Philippe M. Chiasson
Gerald Richter - ECOS GmbH wrote:
 Hi,
 
 Apache with mod_perl will always have this size or even more. This is 
 ok.
 
  ulimit -a shows the process limits, but should normaly not a problem
 
 The behaviour you describe occurs when you do _not_ have a LoadModule 
 _and_ a PerlModule statement for Embperl in your httpd.conf

Really? Any ides what about that triggers a segmentation fault ?

-- 
Philippe M. Chiasson GPG: F9BFE0C2480E7680 1AE53631CB32A107 88C3A5A5
http://gozer.ectoplasm.org/   m/gozer\@(apache|cpan|ectoplasm)\.org/



signature.asc
Description: OpenPGP digital signature


Re: BUG: MP_CODE_ATTRS() is broken under perl 5.10.0

2007-12-31 Thread Philippe M. Chiasson


Michael Schout wrote:
 Michael Schout wrote:
 
 MP_CODE_ATTRS() doesn't work under perl 5.10.0.
 
 Does anyone have any ideas on how to fix this?

Short answer, not yet.

Slightly longer answer follows.

The problem is that the different flavors of filter handlers need to
be identified, and at that point, all that we got it a CV *.

Using the hack you pointed out, we were able to piggyback to some
unused portion of the CV*. Unfortunately, in 5.10, that field is now
a union between 2 fields, so that no longer holds true.

The solution will be to either find a new way to attach this information
to a CV (I looked around, and nothing jumped at me), or we'll have to switch
to storing this information separate of the CV itself (a cleaner, but 
potentially
annoying solution).

So for now, there is not much of a solution, but there will be one!

-- 
Philippe M. Chiasson GPG: F9BFE0C2480E7680 1AE53631CB32A107 88C3A5A5
http://gozer.ectoplasm.org/   m/gozer\@(apache|cpan|ectoplasm)\.org/



signature.asc
Description: OpenPGP digital signature


Re: RELEASE CANDIDATE] mod_perl-1.31 RC1

2007-12-26 Thread Philippe M. Chiasson
Andreas J. Koenig wrote:
 On Tue, 25 Dec 2007 10:47:48 -0800, Philippe M. Chiasson [EMAIL 
 PROTECTED] said:
 [...]
 
 From what I can see in the code it can only be so but I wonder why I
 do not see it expanded in any file. In my apache directory I grep
 recursively:
 
 # grep -r MP_LIBEXT .
 ./src/modules/perl/Makefile.tmpl:libperl.$(MP_LIBEXT): $(MP_OBJS_PIC)
 ./src/modules/perl/Makefile.tmpl:   $(APXS) -i -a -n perl 
 libperl.$(MP_LIBEXT)
 ./src/modules/perl/configure:echo MP_LIBEXT=$my_soext $my_makefileconf
 ./src/modules/perl/Makefile:libperl.$(MP_LIBEXT): $(MP_OBJS_PIC)
 ./src/modules/perl/Makefile:$(APXS) -i -a -n perl libperl.$(MP_LIBEXT)

grep -R MP_LIBEXT [httpd-src]/src/modules/perl

 I get the impression that src/modules/perl/configure is not being run
 for whatever reason.
 
 Let me know if I can try further things out.

Look in the httpd source, these files end up copied over into the httpd
tree and stuff is being run from there.

-- 
Philippe M. Chiasson GPG: F9BFE0C2480E7680 1AE53631CB32A107 88C3A5A5
http://gozer.ectoplasm.org/   m/gozer\@(apache|cpan|ectoplasm)\.org/



signature.asc
Description: OpenPGP digital signature


Re: RELEASE CANDIDATE] mod_perl-1.31 RC1

2007-12-25 Thread Philippe M. Chiasson
Andreas J. Koenig wrote:
 On Mon, 24 Dec 2007 15:07:20 -0800, Philippe M. Chiasson [EMAIL 
 PROTECTED] said:
 
   I then changed directory to apache.../src/modules/perl/ and did a
   'make libperl.a', which did compile one for me. Then I switched back
   to mod_perl directory and retried a 'make' and indeed this finished
   without error.
 
Most likely caused by not having done
 
$ make clean
 
before trying again. When not doing that, src/modules/perl under 
 apache/src
will not be correctly re-generated.
 
 Nope, it's really some fight between Linux and Cygwin for the right of
 way. 

Are you building this on Windows/Cygwin then ?

 I can make it work with this one line change but I don't know how
 much of your expectations are undermined by it:
 
 --- apaci/Makefile.tmpl~2007-12-25 05:28:23.448665692 +0100
 +++ apaci/Makefile.tmpl 2007-12-25 05:28:36.567058818 +0100
 @@ -37,7 +37,7 @@
  ##
  
  #   the library to build
 -MP_LIB=libperl.$(MP_LIBEXT)
 +MP_LIB=libperl.$(LIBEXT)
  
  #   the objects to use
  MP_OBJS=\
 
 
 Makes any sense?

Not much sense, no...

In your case, what does MP_LIBEXT end up being ?

-- 
Philippe M. Chiasson GPG: F9BFE0C2480E7680 1AE53631CB32A107 88C3A5A5
http://gozer.ectoplasm.org/   m/gozer\@(apache|cpan|ectoplasm)\.org/



signature.asc
Description: OpenPGP digital signature


Re: RELEASE CANDIDATE] mod_perl-1.31 RC1

2007-12-24 Thread Philippe M. Chiasson


Andreas J. Koenig wrote:
 On Sat, 22 Dec 2007 13:52:26 +0100, [EMAIL PROTECTED] (Andreas J. 
 Koenig) said:
 
 On Fri, 21 Dec 2007 23:36:53 -0800, Philippe M. Chiasson [EMAIL 
 PROTECTED] said:
   http://www.apache.org/~gozer/mp1/mod_perl-1.31-rc1.tar.gz
 
The apache Configure on my box sets my LIBEXT to a which is indeed
what I always wanted to have. So the rules for so were correct as
they were written and I do not know if they ever were invoked. The
result of the 1.31 build is that the httpsd in the end is only 0.5 MB
instead of 1.7 MB and it doesn't start either.
 
 Sorry, I forgot this interesting make error message:
 
 Makefile:141: warning: overriding commands for target `libperl.a'
 Makefile:136: warning: ignoring old commands for target `libperl.a'
 
 This is the content of the Makefile (maybe something is off by one,
 but the point is that LIBEXT=a leads to a duplicate rule and the wrong
 rule wins.
 
 135 libperl.a: $(MP_OBJS)
 136 $(MP_RM) $@
 137 $(MP_AR) crv $@ $(MP_OBJS)
 138 $(MP_RANLIB) $@
 139 
 140 libperl.$(LIBEXT): $(MP_OBJS_PIC)
 141 $(MP_RM) $@
 142 $(MP_LD) $(MP_LDFLAGS_SHLIB) -o $@ $(MP_OBJS_PIC) $(MP_LIBS)
 143

Looks like it was caused by httpd's own stuff defining LIBEXT and clobbering
our own. Can you try the attached patch ?

-- 
Philippe M. Chiasson GPG: F9BFE0C2480E7680 1AE53631CB32A107 88C3A5A5
http://gozer.ectoplasm.org/   m/gozer\@(apache|cpan|ectoplasm)\.org/
Index: apaci/configure
===
--- apaci/configure (revision 606263)
+++ apaci/configure (working copy)
@@ -106,7 +106,7 @@
 echo AP_CFLAGS=-DMOD_PERL $my_apxs_cflags $my_makefileconf
 echo INCLUDES=$my_apxs_includes $my_makefileconf
 echo RANLIB=ranlib $my_makefileconf
-echo LIBEXT=$my_soext $my_makefileconf
+echo MP_LIBEXT=$my_soext $my_makefileconf
 echo APACHEEXT=$my_apxs_sourcedir/src $my_makefileconf
 echo APACHELIBEXEC=$my_apxs_libexec $my_makefileconf
 echo BASEEXT=mod_perl $my_makefileconf
Index: apaci/Makefile.tmpl
===
--- apaci/Makefile.tmpl (revision 606263)
+++ apaci/Makefile.tmpl (working copy)
@@ -37,7 +37,7 @@
 ##
 
 #   the library to build
-MP_LIB=libperl.$(LIBEXT)
+MP_LIB=libperl.$(MP_LIBEXT)
 
 #   the objects to use
 MP_OBJS=\
@@ -56,7 +56,7 @@
$(MP_AR) crv $@ $(MP_OBJS)
$(MP_RANLIB) $@
 
-libperl.$(LIBEXT): $(MP_OBJS_PIC)
+libperl.$(MP_LIBEXT): $(MP_OBJS_PIC)
$(MP_RM) $@
$(MP_LD) $(MP_LDFLAGS_SHLIB) -o $@ $(MP_OBJS_PIC) $(MP_LIBS)
 
@@ -94,7 +94,7 @@
 
 #   FOR STAND-ALONE BUILDING ONLY
 install:
-   $(APXS) -i -a -n perl libperl.$(LIBEXT)
+   $(APXS) -i -a -n perl libperl.$(MP_LIBEXT)
 
 depend:
cp Makefile.tmpl Makefile.tmpl.bak \


signature.asc
Description: OpenPGP digital signature


Re: RELEASE CANDIDATE] mod_perl-1.31 RC1

2007-12-24 Thread Philippe M. Chiasson
Andreas J. Koenig wrote:
 On Mon, 24 Dec 2007 13:12:05 -0800, Philippe M. Chiasson [EMAIL 
 PROTECTED] said:
 
Looks like it was caused by httpd's own stuff defining LIBEXT and 
 clobbering
our own. Can you try the attached patch ?
 
 Maybe I'm too tired right now, but on the first try it did again not work, 
 saying
 
   cc: modules/perl/libperl.a: No such file or directory
   make[3]: *** [target_static] Error 1
   make[3]: Leaving directory `/home/src/apache_1.3.39/src'
   make[2]: *** [build-std] Error 2
   make[2]: Leaving directory `/home/src/apache_1.3.39'
   make[1]: *** [build] Error 2
   make[1]: Leaving directory `/home/src/apache_1.3.39'
   make: *** [apaci_httpd] Error 2
 
 I then changed directory to apache.../src/modules/perl/ and did a
 'make libperl.a', which did compile one for me. Then I switched back
 to mod_perl directory and retried a 'make' and indeed this finished
 without error.

Most likely caused by not having done

$ make clean

before trying again. When not doing that, src/modules/perl under apache/src
will not be correctly re-generated.

 I'll retry tomorrow if I did something stupid. Let me know if this
 rings a bell for you.

Cool.

-- 
Philippe M. Chiasson GPG: F9BFE0C2480E7680 1AE53631CB32A107 88C3A5A5
http://gozer.ectoplasm.org/   m/gozer\@(apache|cpan|ectoplasm)\.org/



signature.asc
Description: OpenPGP digital signature


Re: RELEASE CANDIDATE] mod_perl-1.31 RC1

2007-12-23 Thread Philippe M. Chiasson


Andreas J. Koenig wrote:
 On Fri, 21 Dec 2007 23:36:53 -0800, Philippe M. Chiasson [EMAIL 
 PROTECTED] said:
 
http://www.apache.org/~gozer/mp1/mod_perl-1.31-rc1.tar.gz
 
 Wow, what a fast release, thanks!
 
 But sorry, nope, it doesn't work on my linux box.

Sorry to hear that.

 The apache Configure on my box sets my LIBEXT to a which is indeed
 what I always wanted to have. So the rules for so were correct as
 they were written and I do not know if they ever were invoked. The
 result of the 1.31 build is that the httpsd in the end is only 0.5 MB
 instead of 1.7 MB and it doesn't start either.
 
 I'm unable to tell what exactly needs fixing. Does my description help?


Yes, but I'd like to try reproducing this myself.

Can you tell me:

$ perl -V:config_args

As well as the version of httpd you are trying against, as well as how
it was built/configured.

Same thing for mod_perl.

Getting the exact argument you used to build/configure these might allow
me to reproduce, and hopefully, to fix as well.

Thanks.

-- 
Philippe M. Chiasson GPG: F9BFE0C2480E7680 1AE53631CB32A107 88C3A5A5
http://gozer.ectoplasm.org/   m/gozer\@(apache|cpan|ectoplasm)\.org/



signature.asc
Description: OpenPGP digital signature


Re: RELEASE CANDIDATE] mod_perl-1.31 RC1

2007-12-23 Thread Philippe M. Chiasson


Andreas J. Koenig wrote:
 On Sat, 22 Dec 2007 13:52:26 +0100, [EMAIL PROTECTED] (Andreas J. 
 Koenig) said:
 
 On Fri, 21 Dec 2007 23:36:53 -0800, Philippe M. Chiasson [EMAIL 
 PROTECTED] said:
   http://www.apache.org/~gozer/mp1/mod_perl-1.31-rc1.tar.gz
 
The apache Configure on my box sets my LIBEXT to a which is indeed
what I always wanted to have. So the rules for so were correct as
they were written and I do not know if they ever were invoked. The
result of the 1.31 build is that the httpsd in the end is only 0.5 MB
instead of 1.7 MB and it doesn't start either.
 
 Sorry, I forgot this interesting make error message:
 
 Makefile:141: warning: overriding commands for target `libperl.a'
 Makefile:136: warning: ignoring old commands for target `libperl.a'
 
 This is the content of the Makefile (maybe something is off by one,
 but the point is that LIBEXT=a leads to a duplicate rule and the wrong
 rule wins.
 
 135 libperl.a: $(MP_OBJS)
 136 $(MP_RM) $@
 137 $(MP_AR) crv $@ $(MP_OBJS)
 138 $(MP_RANLIB) $@
 139 
 140 libperl.$(LIBEXT): $(MP_OBJS_PIC)
 141 $(MP_RM) $@
 142 $(MP_LD) $(MP_LDFLAGS_SHLIB) -o $@ $(MP_OBJS_PIC) $(MP_LIBS)
 143

And that means trouble indeed. Could be caused by a different version of
ExtUtils::MakeMaker...

The funny thing is that it builds just fine for me.

Oh, are you trying to build mod_perl statically ?

-- 
Philippe M. Chiasson GPG: F9BFE0C2480E7680 1AE53631CB32A107 88C3A5A5
http://gozer.ectoplasm.org/   m/gozer\@(apache|cpan|ectoplasm)\.org/



signature.asc
Description: OpenPGP digital signature


Re: RELEASE CANDIDATE] mod_perl-1.31 RC1

2007-12-23 Thread Philippe M. Chiasson


Andreas J. Koenig wrote:
 On Sat, 22 Dec 2007 13:52:26 +0100, [EMAIL PROTECTED] (Andreas J. 
 Koenig) said:
 
 On Fri, 21 Dec 2007 23:36:53 -0800, Philippe M. Chiasson [EMAIL 
 PROTECTED] said:
   http://www.apache.org/~gozer/mp1/mod_perl-1.31-rc1.tar.gz
 
The apache Configure on my box sets my LIBEXT to a which is indeed
what I always wanted to have. So the rules for so were correct as
they were written and I do not know if they ever were invoked. The
result of the 1.31 build is that the httpsd in the end is only 0.5 MB
instead of 1.7 MB and it doesn't start either.
 
 Sorry, I forgot this interesting make error message:
 
 Makefile:141: warning: overriding commands for target `libperl.a'
 Makefile:136: warning: ignoring old commands for target `libperl.a'
 
 This is the content of the Makefile (maybe something is off by one,
 but the point is that LIBEXT=a leads to a duplicate rule and the wrong
 rule wins.
 
 135 libperl.a: $(MP_OBJS)
 136 $(MP_RM) $@
 137 $(MP_AR) crv $@ $(MP_OBJS)
 138 $(MP_RANLIB) $@
 139 
 140 libperl.$(LIBEXT): $(MP_OBJS_PIC)
 141 $(MP_RM) $@
 142 $(MP_LD) $(MP_LDFLAGS_SHLIB) -o $@ $(MP_OBJS_PIC) $(MP_LIBS)
 143

And that means trouble indeed. Could be caused by a different version of
ExtUtils::MakeMaker...

The funny thing is that it builds just fine for me.

Oh, are you trying to build mod_perl statically ?

-- 
Philippe M. Chiasson GPG: F9BFE0C2480E7680 1AE53631CB32A107 88C3A5A5
http://gozer.ectoplasm.org/   m/gozer\@(apache|cpan|ectoplasm)\.org/



signature.asc
Description: OpenPGP digital signature


RELEASE CANDIDATE] mod_perl-1.31 RC1

2007-12-21 Thread Philippe M. Chiasson
The mod_perl 1.31 release candidate Works with Perl 5.10 is ready. It can be 
downloaded here:

http://www.apache.org/~gozer/mp1/mod_perl-1.31-rc1.tar.gz

MD5:  7cda8676120ff6654bcbe923a2ff5747
SHA1: d8d2d4ad36d134a098601083ed4826664bb8a6cf

The summary of what has changed since 1.30 are (from Changes):

Avoid possible segfault when PerlFreshRestart is On.
[Michael Rendell [EMAIL PROTECTED]]

Fix shared libary extensions on Win32 to be .dll not .so
[Nikolay Ananiev [EMAIL PROTECTED]]

Patch to mod_perl.dsp to remove /D _WINSOCK2API_ on Win32
for perl = 5.8.6 [Steve Hay]

-- 
Philippe M. Chiasson GPG: F9BFE0C2480E7680 1AE53631CB32A107 88C3A5A5
http://gozer.ectoplasm.org/   m/gozer\@(apache|cpan|ectoplasm)\.org/



signature.asc
Description: OpenPGP digital signature


Re: [mp2] mod_perl closes apache's stdin and/or stdout

2007-12-17 Thread Philippe M. Chiasson
Fred Moyer wrote:
 Peter Valdemar Mørch wrote:
 Hi,

 Dmitry Karasik dmitry-at-karasik.eu.org wrote:
 mod_perl during the initialization process closes file descriptor 0,
 and frees it for further reuse in other processes.  Therefore, any cgi 
 script
 executing after mod_perl is initialized, and in the same process tree, 
 will
 have file descriptor 0 closed. The concrete example where this 
 behavior leads
 to impossibility of processing POST requests is reported earlier and 
 is located
 at

   http://marc.info/?l=apache-modperlm=119062450730646w=2
 Dmitry's patch from  Sep 25, 2007 
 http://www.gossamer-threads.com/lists/modperl/modperl/94912 has still 
 not been applied to SVN. May I humbly ask that this patch is applied?
 
 I remember that Toersten and I put together a unit test for this but I 
 don't think there was any change in behavior with this patch, so I'm not 
 sure if anyone was able to demonstrate that it changed the behavior.

It certainly breaks t/modperl/io_nested_with_closed_stds
[error] [client 127.0.0.1] Filehandle STDOUT reopened as STDIN only for input 
at t/response/TestModperl/io_nested_with_closed_stds.pm line 49.\n

 If you have the tuits and could track down that unit test, show that it 
 exercises the problem in question, we probably wouldn't need much else 
 to apply this patch.  I'd try to do this but am overextended on my tuits 
 right now.

Yup, without a test case that correctly demonstrates the bug, and a patch
that doesn't break existing tests, not very likely to get applied.

-- 
Philippe M. Chiasson GPG: F9BFE0C2480E7680 1AE53631CB32A107 88C3A5A5
http://gozer.ectoplasm.org/   m/gozer\@(apache|cpan|ectoplasm)\.org/



signature.asc
Description: OpenPGP digital signature


Re: headers_out

2007-12-02 Thread Philippe M. Chiasson
Woff3 wrote:
 Hi.
 
 I had Apache 2.0 and mod_perl.

You possibly meant Apache 1.3.xx and mod_perl-1.xx ?

 Now I upgraded to Apache 2.2.6 and mod_perl2.
 
 I have html-pages where I use mason code.
 
 [code]
 $r-header_out(Refresh = 5; url=$url);
 This code worked fine in my previous system.
 Now when run my application, I get this error:
 Can't locate object method header_out via packageApache::RequestRec
 [/code]

Have you tried preloading Apache2::RequestRec ?

PerlModule Apache2::RequestRec

(http://perl.apache.org/docs/2.0/api/Apache2/RequestRec.html#C_headers_out_)

And to improve the odds of folks being able to assist, try
and copy error messages verbatim, instead of paraphrasing them.

When migrating from mod_perl-1.x to 2.x you'll run into various little
annoyances like the one you are reporting. The whole process if fairly
well documented, and your exact issue is discussed, for instance, here:

http://perl.apache.org/docs/2.0/user/porting/compat.html#C__r_E_gt_header_out_



 This is strange error, because in my httpd.conf file
 I haven't load module Apache::RequestRec
 
 I have load just these modules:
 [code]
 PerlModule Apache2::AuthCookieDBI
 PerlModule Apache2::DBI
 PerlModule HTML::Mason::ApacheHandler
 PerlModule Apache2::Request
 PerlModule Config2::IniFiles
 [/code]
 
 Does someone information, how I could fix this problem?

-- 
Philippe M. Chiasson GPG: F9BFE0C2480E7680 1AE53631CB32A107 88C3A5A5
http://gozer.ectoplasm.org/   m/gozer\@(apache|cpan|ectoplasm)\.org/



signature.asc
Description: OpenPGP digital signature


Re: [mp1] PerlFreshRestart, perl_reload_inc, segmentation fault (patch)

2007-12-02 Thread Philippe M. Chiasson
Michael Rendell wrote:
 Subject: [mp1] PerlFreshRestart, perl_reload_inc, segmentation fault (patch)
 
 When using mod_perl-1.30 (with perl 5.8.5, apache 1.3.37)
 with PerlFreshRestart On (yes, dangerous), httpd gets a segmentation
 fault. 

Yup, verified this one.

 Using valgrind, discovered that part of the problem is related
 to the way memory is used in perl_reload_inc() (src/modules/perl/perl_util.c):
 
 [...]
 
 Changing the ap_table_setn() to ap_table_set() fixes this particular
 problem.
 
 Hope this is useful,

Very much so! Thanks a lot.

Committed revision 600439.

-- 
Philippe M. Chiasson GPG: F9BFE0C2480E7680 1AE53631CB32A107 88C3A5A5
http://gozer.ectoplasm.org/   m/gozer\@(apache|cpan|ectoplasm)\.org/



signature.asc
Description: OpenPGP digital signature


Re: OffTopic (slightly) - Module Feedback Wanted - Authen::Ticketless

2007-11-13 Thread Philippe M. Chiasson


Jonathan Vanasco wrote:
 But there is a big security whole there if you skip the trip to the  
 server
 (whether or not you use mod_auth_tkt). In order for the Flash code  
 or JS code to
 create a ticket using a shared secret that secret needs to be  
 downloaded to the
 client. Now you might be relying on Flash's binary format to  
 protect said
 secret, but I wouldn't. Sending a user/pw combo on an insecure  
 connection is not
 as bad as sending your shared secret out into the open on the same  
 insecure
 connection. The first compromises that user's account. The second  
 compromises
 every users account.
 
 Right , but this module doesn't do that.  This module uses the CRAM- 
 MD5 style of authentication - like SMTP servers use
 
 client: Hey I want to log in!
 server: Here's a Challenge: $time. $seed . digest ($time . $seed .  
 $site_secret )
 client: Here is my username and a hash that is Digest( password ,  
 server_challenge )
 server: I looked up your username in the db , and the password is  
 'abc' .  if i hash the stored password with the server_challenge I  
 sent you, i get the hash you send me.  i will log you in now.
 
 things to note though:
   i. if you store plaintext passwords on the server (BAD!) the client  
 sends
   digest( password . server_challenge)
   ii. if you store hashed passwords on the server (GOOD!) the client  
 sends
   digest( digest(password) . server_challenge)

The conceptual problem with this approach is that the digest(password)
effectively becomes the user's password.

If you steal digest(password), you can impersonnate the user, without
ever knowing password. So, somebody stealing a dump of your user database
can still impersonnate all your users.

   iii. this module creates a self-validating challenge, so that you  
 don't have to store the challenge on the server - so you send the  
 challenge back to the server

Then a malicious attacker that stole a bunch of digest(password) can
pre-calculate a single 'challenge' and pre-generate a single 
challenge/digest(digest(password) . challenge))
pair per account he/she stole. Then can use them to login straight at the 3 step
of the authentication process with very little work on his/her side.

For a good example of how to avoid some of these pitfalls, check digest
authentication.

http://en.wikipedia.org/wiki/Digest_access_authentication

-- 
Philippe M. Chiasson GPG: F9BFE0C2480E7680 1AE53631CB32A107 88C3A5A5
http://gozer.ectoplasm.org/   m/gozer\@(apache|cpan|ectoplasm)\.org/



signature.asc
Description: OpenPGP digital signature


Re: A question about the post_config phase mod_perl handler

2007-11-12 Thread Philippe M. Chiasson
Boysenberry Payne wrote:
 In the example at:
 http://perl.apache.org/docs/2.0/user/handlers/ 
 server.html#C_PerlPostConfigHandler_
 
 the PerlPostConfigHandler subroutine returns Apache2::Const::OK.
 
 I was wondering if it mattered what it returned, and if so, what are  
 the alternatives?

It matters, only OK is a valid return value from that stage. Otherwise,
you'll get this helpfull error message:

[error] Callback 'MyCallback' returned 404, whereas Apache2::Const::OK (0) is 
the only valid return value for PerlPostConfigHandler handlers

-- 
Philippe M. Chiasson GPG: F9BFE0C2480E7680 1AE53631CB32A107 88C3A5A5
http://gozer.ectoplasm.org/   m/gozer\@(apache|cpan|ectoplasm)\.org/



signature.asc
Description: OpenPGP digital signature


Re: A question about the post_config phase mod_perl handler

2007-11-12 Thread Philippe M. Chiasson
Boysenberry Payne wrote:
 Interesting, I tried just returning and several other non-OK returns  
 and got no error.

Interesting, I supect the only thing that bails it out are error status in
the 400-500 range then.

Turns out it's a MP_HOOK_RUN_ALL 
(http://perl.apache.org/docs/2.0/user/handlers/intro.html#C_RUN_ALL_)

And from the docs:

Handlers of the type RUN_ALL will be executed in the order they have been 
registered
until the first handler that returns something other than Apache2::Const::OK or 
Apache2::Const::DECLINED.

Reason this is hapenning is the only valid return code is Apache2::Const::OK,
but that also happens to be '0', so returning undef gets converted to 0 when
looked at in numeric context, and it OK.

Anything elss will trigger the error I mentionned.

-- 
Philippe M. Chiasson GPG: F9BFE0C2480E7680 1AE53631CB32A107 88C3A5A5
http://gozer.ectoplasm.org/   m/gozer\@(apache|cpan|ectoplasm)\.org/



signature.asc
Description: OpenPGP digital signature


Anybody going to be @ ApacheCon US 2007 Atlanta?

2007-11-11 Thread Philippe M. Chiasson
It's starting tomorrow, and I am going to be there.

Anybody else will be around and want to connect, just lemme know by email.

There is also a mod_perl BOF scheduled on Thursday ( see
http://wiki.apache.org/apachecon/BirdsOfaFeatherUs07 for more details)

In any case, see you all there!

-- 
Philippe M. Chiasson GPG: F9BFE0C2480E7680 1AE53631CB32A107 88C3A5A5
http://gozer.ectoplasm.org/   m/gozer\@(apache|cpan|ectoplasm)\.org/



signature.asc
Description: OpenPGP digital signature


Re: building mod_perl-2.0.3 with Perl 5.10.0 (DEVEL32096)

2007-10-27 Thread Philippe M. Chiasson
Dave Mitchell wrote:
 On Fri, Oct 26, 2007 at 02:57:01PM +0200, Dintelmann, Peter wrote:
 mod_perl.c: In function `modperl_sys_term':
 mod_perl.c:599: error: `my_perl' undeclared (first use in this function)
 ...
 The referenced line 599 in mod_perl.c reads

 $ perl -nle 'print if $.==599' src/modules/perl/mod_perl.c
 PERL_SYS_TERM();
 
 That's odd.

I've just built successfully against 32195:

*** /perl5.10.0 -V
Summary of my perl5 (revision 5 version 10 subversion 0 patch 32195) 
configuration:
  Platform:
osname=darwin, osvers=9.0.0, archname=darwin-thread-multi-2level
uname='darwin shenlong 9.0.0 darwin kernel version 9.0.0: tue oct 9 
21:35:55 pdt 2007; root:xnu-1228~1release_i386 i386 i386 '
config_args='-des -Dusedevel -Dusethreads'
hint=recommended, useposix=true, d_sigaction=define
useithreads=define, usemultiplicity=define
useperlio=define, d_sfio=undef, uselargefiles=define, usesocks=undef
use64bitint=undef, use64bitall=undef, uselongdouble=undef
usemymalloc=n, bincompat5005=undef


Philippe M. Chiasson GPG: F9BFE0C2480E7680 1AE53631CB32A107 88C3A5A5
http://gozer.ectoplasm.org/   m/gozer\@(apache|cpan|ectoplasm)\.org/


Re: FYI

2007-10-24 Thread Philippe M. Chiasson
Fred Moyer wrote:
 There was a recent sytems upgrade which probably caused this.  Looking
 into it.

Yup, caused by a switch to a 64 bit OS.

A couple of CPAN packages need rebuilding, I am taking care of it.


Philippe M. Chiasson GPG: F9BFE0C2480E7680 1AE53631CB32A107 88C3A5A5
http://gozer.ectoplasm.org/   m/gozer\@(apache|cpan|ectoplasm)\.org/



signature.asc
Description: OpenPGP digital signature


  1   2   3   4   >