httpd-apreq-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Stas Bekman <s...@stason.org>
Subject Re: segfault in Apache::Upload::fh with libapreq 1.1rc2
Date Wed, 01 Jan 2003 22:28:04 GMT
Sven Geisler wrote:
> Hi,
> 
> I use libapreq 1.1rc2 with self-compiled perl 5.8.0, mod_perl 1.27,
> apache 1.3.27:
> 
> my Perl code:
> 
> if ($r->method_number == Apache::Constants::M_POST) {
> 	foreach my $upload ($r->upload) {
> 		my $name = $upload->name;
> 		if (ref($upload->fh)) {
> 			# do something with upload
> 			...
> 		}
> 	}
> 
> 	# do more
> 	...
> }
> 
> I got this message in gdb:
> 
> Program received signal SIGSEGV, Segmentation fault.
> [Switching to Thread 8192 (LWP 25219)]
> 0x420693d7 in fileno_unlocked () from /lib/i686/libc.so.6

Thank you, Sven, for the diagnosis and patch, which should be certainly 
fixed. But this shouldn't have happened in first place, $upload->fh 
shouldn't be set if there is no file to upload. Any chance you can 
supply a reproducable showcase which reproduces this segfault? Because 
the problem with this patch:

     fp = ApacheUpload_fh(upload);
     if ( !fp )
        XSRETURN_UNDEF;

is that the client code expects a file, and we return undef here.

__________________________________________________________________
Stas Bekman            JAm_pH ------> Just Another mod_perl Hacker
http://stason.org/     mod_perl Guide ---> http://perl.apache.org
mailto:stas@stason.org http://use.perl.org http://apacheweek.com
http://modperlbook.org http://apache.org   http://ticketmaster.com


Mime
View raw message