I'm coding in a mod_perl environment and using the Apache2::Request module to get posted data. This works fine, except for when I also use the Apache2::Request object also to upload a file/get the file's filehandle. If use the methods separately, there are no issues. However, if I use them both in the same subroutine, I get this error in my Apache log file:

[notice] child pid 27383 exit signal Segmentation fault (11)

Here is my code:

my $r = shift;
use Apache2::Request;
use Apache2::Upload;
my $req = Apache2::Request->new($r, POST_MAX => 10 * 1024 * 1024,DISABLE_UPLOADS => 0);
my $img_url = $req->param('url');

my $upload = $req->upload('files[]');
my $filename = $upload->filename;
my $upload_filehandle = $upload->fh;
my $file_size = $upload->size;

Apache2::Upload is included because it is used by Apache2::Request. Like I said, if I comment out either the line that begins with "my $img_url.." or the upload section, it works fine. However, if they are both present in the code, I get a 502 Proxy Error and that error in the apache log file.

Thanks in advance!

share|improve this question

67% accept rate
Works fine for me. httpd 2.2.21/prefork, mod_perl 2.0.5, libapreq2 2.13, SetHandler modperl – daxim Jan 13 at 12:54
have you tried something like my @upl = $req->upload(); foreach my $uitem (@upl) { ... } to check for what you actually receive in your POST requests ? – collapsar Jan 31 at 13:26
feedback

Know someone who can answer? Share a link to this question via email, Google+, Twitter, or Facebook.

Your Answer

 
or
required, but never shown
discard

By posting your answer, you agree to the privacy policy and terms of service.

Browse other questions tagged or ask your own question.