httpd-apreq-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Sven Geisler <sgeis...@aeccom.com>
Subject Fwd: segfault in Apache::Upload::fh with libapreq 1.1rc2
Date Sun, 05 Jan 2003 17:41:08 GMT

> Von: Sven Geisler <sgeisler@aeccom.com>
> Datum: Sa, 4. Jan 2003  17:29:59 Europe/Berlin
> An: Stas Bekman <stas@stason.org>
> Betreff: Re: segfault in Apache::Upload::fh with libapreq 1.1rc2
>
> Hi Stas,
>
> Am Mittwoch, 01.01.03 um 23:28 Uhr schrieb Stas Bekman:
>> 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.
>>
>
> $upload->fh was set to zero (from init). Without my patch the perl 
> code $upload->fh produced a segfault. Regarding your comment my 
> questions is: how do I find out that there is a uploaded file?
>
> More about my circumstances:
> I use a html form (multipart form data) with two file upload fields. I 
> got a segfault with $upload->fh if the user selects no files. I use 
> $upload->fh to find out if there is a upload. My patch is for this 
> case.
> I got another segfault if the user select a file. My handler receives 
> the file. This request handled well. I got a segfault with the next 
> request on this process. This looks like the same segfault that I saw 
> with libapreq 1.0 and perl 5.8.0.
>
> I hope that I have more time next week to say more about this problem.
>
> Sven.
>


Mime
View raw message