hi all-
with some pointers from charles cazabon, i've stared to trace the
occurance of qmail-qfilter segfaults on freebsd.
here's what i've done:
i set QMAILQUEUE to /var/qmail/bin/qmail-runfilters via tcpserver for all
incoming mail:
/etc/tcp.smtp:
:allow,QMAILQUEUE="/var/qmail/bin/qmail-runfilters"
i'm tracing the execution of every instance of qmail-qfilter via the
/var/qmail/bin/qmail-runfilters script:
#!/bin/sh
exec ktrace -i -f /tmp/ktrace.output`date "+%H%M%S` \
/var/qmail/bin/qmail-qfilter /var/qmail/qfilter/filters/deny-filetypes
/var/qmail/qfilter/filters/deny-filetypes is taken directly from the
samples director that comes with qmail-qfilter-1.4.
here's a sample kdump of a trace file generated by a mail that causes
qmail-qfilter to segfault:
58293 qmail-qfilter RET write 1024/0x400
58293 qmail-qfilter CALL read(0,0xbfbfec68,0x1000)
58293 qmail-qfilter GIO fd 0 read 0 bytes
""
58293 qmail-qfilter RET read 0
58293 qmail-qfilter CALL lseek(0x5,0,0,0,0)
58293 qmail-qfilter RET lseek 0
58293 qmail-qfilter CALL read(0x1,0xbfbfec68,0x1000)
58293 qmail-qfilter GIO fd 1 read 0 bytes
""
58293 qmail-qfilter RET read 0
58293 qmail-qfilter PSIG SIGSEGV SIG_DFL
58293 qmail-qfilter NAMI "qmail-qfilter.core"
i't looks like the segfault occurs after qmail-qfilter has created the
temp file to hold the message, when it's trying to read the message back.
in an attempt to isolate anything in particular emails that would cause
the problem, i uncommented the unlink() call in qmail-qfilter.c that makes
the temp files vanish.
i'm attaching two text files to this email:
1. the complete temp file created bu qmail-qfilter
2. the complete trace file generated by kdumping the ktrace file generated
when qmail-qfilter segfaults.
if anyone has any comments on any of this, or any ideas on why the
read() syscall might cause the segfault, it'd be much appreciated.
thanks-
dan