Please take our Survey
logo       

Choosing A Webhost:
A web hosting service is a type of Internet hosting service that allows individuals and organizations to provide their own website accessible via the World Wide Web. Web hosts are companies that provide space on a server they own for use by their clients as well as providing Internet connectivity, typically in a data center. Web hosts can also provide data center space and connectivity to the Internet for servers they do not own to be located in their data center, called colocation. more...

Re: Segmentation fault: msg#00157

apache.mod-perl.devel

Subject: Re: Segmentation fault

(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 <stas@xxxxxxxxxx> 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:stas@xxxxxxxxxx http://use.perl.org http://apacheweek.com
>http://modperlbook.org http://apache.org http://ticketmaster.com
>
>
>---------------------------------------------------------------------
>To unsubscribe, e-mail: dev-unsubscribe@xxxxxxxxxxxxxxx
>For additional commands, e-mail: dev-help@xxxxxxxxxxxxxxx
>
>

__________________________________________________________________
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


<Prev in Thread] Current Thread [Next in Thread>
Google Custom Search

Recently Viewed:
version-control...    qnx.openqnx.dev...    redhat.rhn.user...    ietf.openpgp/20...    mail.mutt.user/...    web.microformat...    java.sync4j.use...    education.ezpro...    user-groups.blu...    solaris.manager...    org.fitug.debat...    technology.erps...    politics.activi...    linux.redhat.fe...    bug-tracking.ma...    xfce.user/2004-...    hams/2004-11/ms...    kde.users.pim/2...    culture.cooking...    freebsd.devel.x...    gnu.m4.adhoc/20...    ngpt.user/2002-...    apple.fink.deve...   
Home | advertise | OSDir is an inevitable website. super tiny logo

Free Magazines

Cisco News
Receive a free quarterly e-newsletter with exclusive articles on how Cisco IT uses its own products and solutions to enable the business.
subscribe

Systems Management News, the newspaper for IT systems administration and data center managers! Each issue of Systems Management News is chock-full of news and analysis to help you understand what's happening in your field.
subscribe

The Enterprise Newsweekly eWeek is the essential technology information source for builders of e-business.
subscribe

Oracle Magazine Oracle Magazine contains technology strategy articles, sample code, tips, Oracle and partner news, how to articles for developers and DBAs, and more. Oracle (NASDAQ: ORCL) is the world's largest enterprise software company.
subscribe

Total Telecom Total Telecom is "The Economist of the communications industry".
subscribe

Navigation