[In the future please don't reply to some thread when starting a new topic, but post a new email. thank you!]

Bobber Cheng wrote:
Hi,

Apache(2.0.48) with perl_mod(1.99_10) got a Segmentation fault when i access a perl script from apache. I use perl-5.8.2 built from source without thread-support. perl_mod is complied by perl "Makefile.PL MP_INST_APACHE2=1 MP_DEBUG=1 MP_AP_PREFIX=/usr/local/apache2".
[...]
0x4027b14a in memcpy () from /lib/libc.so.6
(gdb) backtrace
#0 0x4027b14a in memcpy () from /lib/libc.so.6
#1 0x40174728 in apr_file_read (thefile=0x8433e58, buf=0x0, nbytes=0x81b33ec)
at readwrite.c:122
#2 0x403ab52e in modperl_slurp_filename (r=0x8433e58, tainted=0)
at modperl_util.c:710
#3 0x406c677b in XS_Apache__RequestRec_slurp_filename (cv=0x81b33ec)

Please try this patch:


Index: src/modules/perl/modperl_util.c
===================================================================
RCS file: /home/cvs/modperl-2.0/src/modules/perl/modperl_util.c,v
retrieving revision 1.56
diff -u -r1.56 modperl_util.c
--- src/modules/perl/modperl_util.c     3 Nov 2003 09:29:49 -0000       1.56
+++ src/modules/perl/modperl_util.c     12 Nov 2003 09:09:10 -0000
@@ -706,6 +706,12 @@

     size = r->finfo.size;
     sv = newSV(size);
+
+    if (!size) {
+        sv_setpvn(sv, "", 0);
+        return newRV_noinc(sv);
+    }
+
     file = r->finfo.filehand;
     if (!file) {
         rc = apr_file_open(&file, r->filename, APR_READ|APR_BINARY,

You may need to use the latest cvs (or mod_perl 1.99_11) if the patch doesn't apply cleanly, but I think it should be fine. You want to use 1.99_11 in any case.

__________________________________________________________________
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


--------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]



Reply via email to