(gdb) p r->filename
$1 = 0x81a1818 "/usr/local/lxr/source"
(gdb) p r->finfo
$2 = {pool = 0x819fe80, valid = 7598448, protection = 1877,
  filetype = APR_REG, user = 48, group = 48, inode = 410325, device = 774,
  nlink = 1, size = 7123, csize = 1077577583, atime = 1068909622000000,
  mtime = 1027905783000000, ctime = 1068307947000000,
  fname = 0x81a1818 "/usr/local/lxr/source", name = 0x0, filehand = 0x1}

I found r->finfo.filehand always is 0 whether i refresh the page, the file must be 
open by apr_file_open()  even it is 1. So i just do

(gdb) set r->finfo.filehand=0

(gdb) p r->filename
$4 = 0x81a5828 "/usr/local/lxr/source"
(gdb) p r->finfo
$5 = {pool = 0x81a3e90, valid = 7598448, protection = 1877,
  filetype = APR_REG, user = 48, group = 48, inode = 410325, device = 774,
  nlink = 1, size = 7123, csize = 1077577583, atime = 1068914748000000,
  mtime = 1027905783000000, ctime = 1068307947000000,
  fname = 0x81a5828 "/usr/local/lxr/source", name = 0x0, filehand = 0x0}

It works.

Here is what i changed:
--- src.bak/modules/perl/modperl_util.c 2003-11-16 00:10:57.351359624 +0800
+++ src/modules/perl/modperl_util.c     2003-11-16 00:17:50.310580280 +0800
@@ -712,6 +712,7 @@
         return newRV_noinc(sv);
     }

+    r->finfo.filehand = 0;
     file = r->finfo.filehand;
     if (!file) {
         rc = apr_file_open(&file, r->filename, APR_READ|APR_BINARY,


Stas Bekman <[EMAIL PROTECTED]> wrote:

>Bobber Cheng wrote:
>> Hi, Stas:
>> 
>> thx ur quck reply. The problem remained although i applied ur patch to last cvs 
>> mod_per and run on last cvs apache2.
>> 
>> perl -v
>> This is perl, v5.8.2 built for i686-linux
>> ./httpd -v
>> Server version: Apache/2.0.49-dev
>> Server built:   Nov 16 2003 21:48:57
>> 
>> But the place change where Segmentation fault raise, here is the gdb output:
>> 
>> Program received signal SIGSEGV, Segmentation fault.
>> [Switching to Thread 16384 (LWP 8102)]
>> 0x40174670 in apr_file_read (thefile=0x1, buf=0x824f6f0, nbytes=0xbffff468)
>>     at readwrite.c:79
>> 79          if (thefile->buffered) {
>> 
>> (gdb) backtrace
>> #0  0x40174670 in apr_file_read (thefile=0x1, buf=0x824f6f0, nbytes=0xbffff468)
>>     at readwrite.c:79
>> #1  0x403ab840 in modperl_slurp_filename (r=0x819f680, tainted=0)
>>     at modperl_util.c:722
>
>OK, so filehandle thefile is not initilized or corrupt. What are you trying to 
>slurp? Can you go one frame up and do:
>
>gdb> p r->filename
>
>__________________________________________________________________
>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]
>
>

__________________________________________________________________
McAfee VirusScan Online from the Netscape Network.
Comprehensive protection for your entire computer. Get your free trial today!
http://channels.netscape.com/ns/computing/mcafee/index.jsp?promo=393397

Get AOL Instant Messenger 5.1 free of charge.  Download Now!
http://aim.aol.com/aimnew/Aim/register.adp?promo=380455

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

Reply via email to