Hello,
i am experiencing weird problems with Folder::Maildir module and mod_perl
1.21/Apache1.3.9 running on Redhat 6. Whenever i try to receive an attachment
larger than ~100K, apache process seg faults. I figured that problem is
not in Folder::Maildir since i can receive attachments of arbitrary sizes
by running a script from a command line or as a cgi script. I have pinpointed
the problem to the following line of code in Maildir.pm (line 459):
my $fh = new IO::File "$folder/tmp/$filename", O_CREAT|O_WRONLY, 0600
or croak "can't create $folder/tmp/$filename: $!";
The apache segfaults on this line of code. I have checked everything.. variables
are initialized, permissions are correct, plenty of disk space.. i mean
the script runs fine as a cgi script..
Here is the strace output:
# strace ./httpd -X
[snip]
select(8, [4], NULL, NULL, {120, 0}) = 1 (in [4], left {120, 0})
read(4, "bEg30gHR5uLVkdEg64918RL6e/b\r\nt"..., 1024) = 953 <-- done
receiving an attachment from a mail server
brk(0x876f000) = 0x876f000
brk(0x8770000) = 0x8770000
brk(0x8771000) = 0x8771000
SYS_175(0, 0, 0xbffff90c, 0x8, 0) = 0
brk(0x8777000) = 0x8777000
brk(0x8778000) = 0x8778000
brk(0x8779000) = 0x8779000
[snip] .... bunch of brk calls here....
open("/http/perl/syscall.ph", O_RDONLY) = -1 ENOENT (No such file or directory)
open("/http/perl/syscall.ph", O_RDONLY) = -1 ENOENT (No such file or directory)
open("/usr/lib/perl5/5.00503/i386-linux/syscall.ph", O_RDONLY) = 5
brk(0x87fc000) = 0x87fc000
fstat(5, {st_mode=S_ISVTX|071, st_size=0, ...}) = 0
mmap(0, 4096, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_ANONYMOUS, -1, 0) =
0x401d3000
read(5, "require \'_h2ph_pre.ph\';\n\nreq"..., 4096) = 54
read(5, "", 4096) = 0
close(5) = 0
munmap(0x401d3000, 4096) = 0
open("/http/perl/_h2ph_pre.ph", O_RDONLY) = -1 ENOENT (No such file or directory)
open("/http/perl/_h2ph_pre.ph", O_RDONLY) = -1 ENOENT (No such file or directory)
open("/usr/lib/perl5/5.00503/i386-linux/_h2ph_pre.ph", O_RDONLY) = 5
brk(0x87fd000) = 0x87fd000
fstat(5, {st_mode=S_ISVTX|0103, st_size=0, ...}) = 0
mmap(0, 4096, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_ANONYMOUS, -1, 0) =
0x401d3000
read(5, "# This file was created by h2ph "..., 4096) = 870
brk(0x87fe000) = 0x87fe000
brk(0x87ff000) = 0x87ff000
brk(0x8800000) = 0x8800000
brk(0x8801000) = 0x8801000
brk(0x8802000) = 0x8802000
read(5, "", 4096) = 0
close(5) = 0
munmap(0x401d3000, 4096) = 0
open("/http/perl/sys/syscall.ph", O_RDONLY) = -1 ENOENT (No such file or
directory)
open("/http/perl/sys/syscall.ph", O_RDONLY) = -1 ENOENT (No such file or
directory)
open("/usr/lib/perl5/5.00503/i386-linux/sys/syscall.ph", O_RDONLY) = 5
--- SIGSEGV (Segmentation fault) ---
+++ killed by SIGSEGV +++
i then retrieved the big attachment from a command line and sent myself
a smaller one. after running strace on http -X again i have figured out
that apache segfaults during the following system call:
fstat(5, {st_mode=S_ISGID|S_ISVTX|0604, st_size=0, ...}) = 0
Any ideas on what is going on?
Thanks.
Get HushMail. The world's first free, fully encrypted, web-based email system.
Speak freely with HushMail.... http://www.hushmail.com