[...]Basically the test seems to be working (ie. 500 expected and received), but handling the 500 error kills apache (seems to be a simple dereference of a null pointer; probably returned from a call of strerror(500)).
Note that on Solaris strerror(500) returns 0x0. On Linux, it returns "Unknown error 500".
[...]Program received signal SIGSEGV, Segmentation fault. apr_cpystrn (dst=0xefffef58 "ï~ôÌ", src=0x0, dst_size=4026527831) at apr_cpystrn.c:57 57 if (!(*d = *src)) { (gdb) where #0 apr_cpystrn (dst=0xefffef58 "ï~ôÌ", src=0x0, dst_size=4026527831) at apr_cpystrn.c:57 #1 0xef654ea8 in stuffbuffer (buf=0xefffef58 "ï~ôÌ", bufsize=256, s=0x0) at errorcodes.c:34 #2 0xef655360 in native_strerror (statcode=500, buf=0xefffef58 "ï~ôÌ", bufsize=256) at errorcodes.c:375 #3 0xef65539c in apr_strerror (statcode=500, buf=0xefffef58 "ï~ôÌ", bufsize=256) at errorcodes.c:384 #4 0xef347ab4 in modperl_error_strerror () from /u/hughesc/apache2/mod_perl-1.99_16/src/modules/perl/mod_perl.so
I made a very quick hack fix to srclib/arp/misc/unix/errorcodes.c:
*************** *** 372,378 **** sprintf(err, "Native Error #%d", statcode); return stuffbuffer(buf, bufsize, err); #else ! return stuffbuffer(buf, bufsize, strerror(statcode)); #endif } #endif --- 372,379 ---- sprintf(err, "Native Error #%d", statcode); return stuffbuffer(buf, bufsize, err); #else ! char *str = strerror(statcode); ! return stuffbuffer(buf, bufsize, str?str:"Unknown error"); #endif } #endif
Which seems to fix it.
So this is a problem with Apache rather than mod_perl?
In fact it's libapr problem. Joe Orton has posted a fix (I've CC'ed you). Thanks for the report and the fix Chris.
-- __________________________________________________________________ Stas Bekman JAm_pH ------> Just Another mod_perl Hacker http://stason.org/ mod_perl Guide ---> http://perl.apache.org mailto:[EMAIL PROTECTED] http://use.perl.org http://apacheweek.com http://modperlbook.org http://apache.org http://ticketmaster.com
-- Report problems: http://perl.apache.org/bugs/ Mail list info: http://perl.apache.org/maillist/modperl.html List etiquette: http://perl.apache.org/maillist/email-etiquette.html