[Dovecot] SIGSEGV (Segmentation fault) with antispam plugin
Hi all.
I am trying to get dovecot (1.0.rc17) running with antispam plugin.
I have created another backend, which executes "sa-learn" from spamassassin's arsenal. The backend is modeled after sendmail backend.
But I can't seem to get the plugin working wit either my backend or signature-log.
This is my ".config": DOVECOT=/usr/src/dovecot-1.0.7 DOVECOT_VERSION=1.0 BACKEND=spamassassin-exec INSTALLDIR=/usr/lib/dovecot/modules/imap/ PLUGINNAME=antispam
This is how I make the plugin: make && make install && chmod 644 /usr/lib/dovecot/modules/imap/lib90_antispam_plugin.so
Since Ubuntu server does not come with dovecot sources, I have downloaded dovecot-1.0.7 and put it in /usr/src. As far as I understand, only the headers are needed, so this should not be the cause of the crash (if the headers hadn't changed).
When invoked from dovecot process, the "imap" dies with signal 11.
When running: strace /usr/sbin/dovecot --exec-mail imap
This is how it ends: etdents64(8, /* 14 entries */, 4096) = 592 getdents64(8, /* 0 entries */, 4096) = 0 open("/usr/lib/dovecot/modules/imap/lib90_antispam_plugin.so", O_RDONLY) = 9 read(9, "\177ELF\1\1\1\0\0\0\0\0\0\0\0\0\3\0\3\0\1\0\0\0\340\21"..., 512) = 512 fstat64(9, {st_mode=S_IFREG|0644, st_size=19252, ...}) = 0 mmap2(NULL, 16148, PROT_READ|PROT_EXEC, MAP_PRIVATE|MAP_DENYWRITE, 9, 0) = 0xb7f29000 mmap2(0xb7f2c000, 4096, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_FIXED|MAP_DENYWRITE, 9, 0x2) = 0xb7f2c000 close(9) = 0 close(8) = 0 stat64("/var/mail/mailboxes/boky/Maildir/subscriptions", 0xbfc17d2c) = -1 EACCES (Permission denied) lstat64("/var/mail/mailboxes/boky/Maildir/cur", 0xbfc17c3c) = -1 EACCES (Permission denied) write(2, "imap(boky): ", 12imap(boky): ) = 12 write(2, "Error: ", 7Error: ) = 7 write(2, "lstat(/var/mail/mailboxes/boky/M"..., 69lstat(/var/mail/mailboxes/boky/Maildir/cur) failed: Permission denied) = 69 write(2, "\n", 1 ) = 1 open("/etc/localtime", O_RDONLY) = 8 fstat64(8, {st_mode=S_IFREG|0644, st_size=696, ...}) = 0 fstat64(8, {st_mode=S_IFREG|0644, st_size=696, ...}) = 0 mmap2(NULL, 4096, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_ANONYMOUS, -1, 0) = 0xb7de2000 read(8, "TZif\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\6\0\0\0\6\0"..., 4096) = 696 close(8) = 0 munmap(0xb7de2000, 4096) = 0 stat64("/etc/localtime", {st_mode=S_IFREG|0644, st_size=696, ...}) = 0 --- SIGSEGV (Segmentation fault) @ 0 (0) --- +++ killed by SIGSEGV +++ Process 4707 detached
antispam plugin was downloaded from: http://git.sipsolutions.net/?p=dovecot-antispam.git;a=snapshot;h=HEAD;sf=tgz
Please advise me n next steps; I'm just a beginner with debugging C/C++.
Thank you all. Boky
On 11/17/2007, Boky (verynotbad@gmail.com) wrote:
I am trying to get dovecot (1.0.rc17) running with antispam plugin.
<snip>
DOVECOT=/usr/src/dovecot-1.0.7
Is it 1.0rc17, or 1.0.7?
Please always provide dovecot -n output instead of select snippets...
--
Best regards,
Charles
Hi,
I have created another backend, which executes "sa-learn" from spamassassin's arsenal. The backend is modeled after sendmail backend.
Neat. Send me the file or a patch and I'll integrate it.
But I can't seem to get the plugin working wit either my backend or signature-log.
This is my ".config": DOVECOT=/usr/src/dovecot-1.0.7 DOVECOT_VERSION=1.0 BACKEND=spamassassin-exec INSTALLDIR=/usr/lib/dovecot/modules/imap/ PLUGINNAME=antispam
That looks right.
Since Ubuntu server does not come with dovecot sources, I have downloaded dovecot-1.0.7 and put it in /usr/src. As far as I understand, only the headers are needed, so this should not be the cause of the crash (if the headers hadn't changed).
When invoked from dovecot process, the "imap" dies with signal 11.
When running: strace /usr/sbin/dovecot --exec-mail imap
stat64("/etc/localtime", {st_mode=S_IFREG|0644, st_size=696, ...}) = 0 --- SIGSEGV (Segmentation fault) @ 0 (0) --- +++ killed by SIGSEGV +++ Process 4707 detached
strace is pretty useless for a segfault. Can you compile everything or at least the plugin with -g and run it in gdb? I've never had the plugin segfault on me, maybe your plugin's init code is bad? There are also a bunch of permission errors that may be causing it.
antispam plugin was downloaded from:http://git.sipsolutions.net/?p=dovecot-antispam.git;a=snapshot;h=HEAD;sf=tgz
That should be good :)
johannes
participants (3)
-
Boky
-
Charles Marcus
-
Johannes Berg