Re: [Dovecot] Error using antispam plugin
Well
Now i think i did it. This is the debug information:
=====================================================================
pdc-server:~# ps aux | grep -i dove root 9044 0.0 0.2 1940 616 ? Ss 20:13 0:00 /usr/sbin/dovecot root 9045 0.0 1.1 9680 2948 ? S 20:13 0:00 dovecot-auth dovecot 9046 0.0 0.5 3312 1512 ? S 20:13 0:00 imap-login dovecot 9047 0.0 0.5 3312 1512 ? S 20:13 0:00 imap-login dovecot 9070 0.0 0.5 3312 1512 ? S 20:15 0:00 imap-login mailuser 9071 0.2 0.5 2572 1444 ? S 20:15 0:00 /usr/lib/dovecot/imap root 9075 0.0 0.2 2876 752 pts/0 R+ 20:15 0:00 grep -i dove pdc-server:~# gdb -p 9071 GNU gdb 6.4.90-debian Copyright (C) 2006 Free Software Foundation, Inc. GDB is free software, covered by the GNU General Public License, and you are welcome to change it and/or distribute copies of it under certain conditions. Type "show copying" to see the conditions. There is absolutely no warranty for GDB. Type "show warranty" for details. This GDB was configured as "i486-linux-gnu". Attaching to process 9071 Reading symbols from /usr/lib/dovecot/imap...done. Using host libthread_db library "/lib/tls/i686/cmov/libthread_db.so.1". Reading symbols from /lib/tls/i686/cmov/libdl.so.2...done. Loaded symbols for /lib/tls/i686/cmov/libdl.so.2 Reading symbols from /lib/tls/i686/cmov/libc.so.6...done. Loaded symbols for /lib/tls/i686/cmov/libc.so.6 Reading symbols from /lib/ld-linux.so.2...done. Loaded symbols for /lib/ld-linux.so.2 Reading symbols from /usr/lib/dovecot/modules/imap/lib10_quota_plugin.so...done. Loaded symbols for /usr/lib/dovecot/modules/imap/lib10_quota_plugin.so Reading symbols from /usr/lib/dovecot/modules/imap/lib11_imap_quota_plugin.so...done. Loaded symbols for /usr/lib/dovecot/modules/imap/lib11_imap_quota_plugin.so Reading symbols from /usr/lib/dovecot/modules/imap/lib90_antispam_plugin.so...done. Loaded symbols for /usr/lib/dovecot/modules/imap/lib90_antispam_plugin.so Reading symbols from /usr/lib/dovecot/modules/imap/autocreate_plugin.so...done. Loaded symbols for /usr/lib/dovecot/modules/imap/autocreate_plugin.so Failed to read a valid object file image from memory. 0xb7ef3410 in ?? () (gdb) cont Continuing.
Program received signal SIGSEGV, Segmentation fault. mail_get_physical_size (mail=0x8129ba8, size_r=0x0) at mail.c:100 100 return p->v.get_physical_size(mail, size_r); (gdb) bt full #0 mail_get_physical_size (mail=0x8129ba8, size_r=0x0) at mail.c:100 No locals. #1 0xb7db25c5 in quota_check (t=0x8129ba8, mail=0x0) at quota-storage.c:148 qt = (struct quota_transaction_context *) 0x0 ret = <value optimized out> too_large = 8 #2 0xb7da602d in antispam_save_finish (ctx=0x81417d8) at antispam-storage-1.1.c:178 asbox = (struct antispam_mailbox *) 0x81262e0 ast = (struct antispam_internal_context *) 0x8129be0 dest_mail = (struct mail *) 0x812c578 ret = 135093999 #3 0x0805a1c8 in cmd_append_continue_message (cmd=0x810d4e0) at cmd-append.c:405 client = (struct client *) 0x810bd48 ctx = (struct cmd_append_context *) 0x810d528 size = 135314760 ret = <value optimized out> #4 0x0805a59a in cmd_append_continue_parsing (cmd=0x810d4e0) at cmd-append.c:353 uid2 = <value optimized out> msg = <value optimized out> sync_flags = <value optimized out> imap_flags = <value optimized out> uid_validity = <value optimized out> uid1 = <value optimized out> client = (struct client *) 0x810bd48 ctx = (struct cmd_append_context *) 0x810d528 args = (const struct imap_arg *) 0x8129cb0 flags_list = (const struct imap_arg *) 0x8129d40 flags = MAIL_SEEN keywords_list = (const char * const *) 0x0 keywords = (struct mail_keywords *) 0x0 internal_date_str = 0x0 internal_date = -1 ret = 0 timezone_offset = 0 nonsync = false __PRETTY_FUNCTION__ = "cmd_append_continue_parsing" #5 0x0805a7b5 in cmd_append (cmd=0x810d4e0) at cmd-append.c:499 storage = (struct mail_storage *) 0x810b660 box = <value optimized out> client = (struct client *) 0x810bd48 ctx = (struct cmd_append_context *) 0x810d528 mailbox = 0x8110588 "Sent" #6 0x0805fa6c in client_command_input (cmd=0x810d4e0) at client.c:580 ---Type <return> to continue, or q <return> to quit--- client = (struct client *) 0x810bd48 command = <value optimized out> __PRETTY_FUNCTION__ = "client_command_input" #7 0x0805fb15 in client_command_input (cmd=0x810d4e0) at client.c:629 client = (struct client *) 0x810bd48 command = (struct command *) 0x8 __PRETTY_FUNCTION__ = "client_command_input" #8 0x08060305 in client_handle_input (client=0x810bd48) at client.c:670 _data_stack_cur_id = 3 ret = <value optimized out> remove_io = <value optimized out> handled_commands = false #9 0x0806050e in client_input (client=0x810bd48) at client.c:725 cmd = <value optimized out> output = (struct ostream *) 0x810becc bytes = 34 __PRETTY_FUNCTION__ = "client_input" #10 0x080d9100 in io_loop_handler_run (ioloop=0x8108ab8) at ioloop-epoll.c:201 ctx = <value optimized out> event = (const struct epoll_event *) 0x8108bf0 list = (struct io_list *) 0x810d118 io = (struct io_file *) 0x810bf28 tv = {tv_sec = 4, tv_usec = 999826} t_id = 2 msecs = <value optimized out> ret = 1 i = 0 j = 0 call = <value optimized out> #11 0x080d8098 in io_loop_run (ioloop=0x8108ab8) at ioloop.c:308 No locals. #12 0x080680db in main (argc=Cannot access memory at address 0x8 ) at main.c:293 home = 0x0 (gdb)
=====================================================================
I hope this could help. Attached is also my configuration file.
Regards.
2008/6/4 Johannes Berg johannes@sipsolutions.net:
# CFLAGS=-g3 dpkg-buildpackage -rfakeroot -b
try
DEB_BUILD_OPTIONS=nostrip dpkg-buildpackage ...
johannes
On Wed, 2008-06-04 at 20:20 +0200, Juan Asensio Sánchez wrote:
Program received signal SIGSEGV, Segmentation fault. mail_get_physical_size (mail=0x8129ba8, size_r=0x0) at mail.c:100 100 return p->v.get_physical_size(mail, size_r); (gdb) bt full #0 mail_get_physical_size (mail=0x8129ba8, size_r=0x0) at mail.c:100 No locals. #1 0xb7db25c5 in quota_check (t=0x8129ba8, mail=0x0) at quota-storage.c:148 qt = (struct quota_transaction_context *) 0x0 ret = <value optimized out> too_large = 8
The values are still a bit broken. Compiling without -O2 would probably show what they really are.
But looking at the antispam code I think there's one bug:
static int antispam_save_finish(struct mail_save_context *ctx) struct mail *dest_mail = ast->mail;
I think ast->mail can be NULL. It should maybe be instead:
dest_mail = ctx->dest_mail != NULL ? ctx->dest_mail : ast->mail;
But looking at the antispam code I think there's one bug:
static int antispam_save_finish(struct mail_save_context *ctx) struct mail *dest_mail = ast->mail;
I think ast->mail can be NULL. It should maybe be instead:
dest_mail = ctx->dest_mail != NULL ? ctx->dest_mail : ast->mail;
Yeah, probably lost that when copying from the quota code. Juan, can you try that?
OTOH, super (i.e. the quota plugin) will never see this value and that's where it seems to crash.
johannes
Applying the change Timo has said i get this:
==============================================================
(gdb) cont Continuing.
Program received signal SIGSEGV, Segmentation fault. mail_get_physical_size (mail=0x81203a0, size_r=0x0) at mail.c:100 100 return p->v.get_physical_size(mail, size_r); (gdb) bt full #0 mail_get_physical_size (mail=0x81203a0, size_r=0x0) at mail.c:100 No locals. #1 0xb7e405c5 in quota_check (t=0x81203a0, mail=0x0) at quota-storage.c:148 qt = (struct quota_transaction_context *) 0x0 ret = <value optimized out> too_large = 8 #2 0xb7e34048 in antispam_save_finish (ctx=0x8123178) at antispam-storage-1.1.c:181 asbox = (struct antispam_mailbox *) 0x811b298 ast = (struct antispam_internal_context *) 0x81203d8 dest_mail = (struct mail *) 0x8122d70 ret = 135093999 #3 0x0805a1c8 in cmd_append_continue_message (cmd=0x810d4e0) at cmd-append.c:405 client = (struct client *) 0x810bd48 ctx = (struct cmd_append_context *) 0x810d528 size = 135314760 ret = <value optimized out> #4 0x0805a59a in cmd_append_continue_parsing (cmd=0x810d4e0) at cmd-append.c:353 uid2 = <value optimized out> msg = <value optimized out> sync_flags = <value optimized out> imap_flags = <value optimized out> uid_validity = <value optimized out> uid1 = <value optimized out> client = (struct client *) 0x810bd48 ctx = (struct cmd_append_context *) 0x810d528 args = (const struct imap_arg *) 0x81204a8 flags_list = (const struct imap_arg *) 0x8120538 flags = MAIL_SEEN keywords_list = (const char * const *) 0x0 keywords = (struct mail_keywords *) 0x0 internal_date_str = 0x0 internal_date = -1 ret = 0 timezone_offset = 0 nonsync = false __PRETTY_FUNCTION__ = "cmd_append_continue_parsing" #5 0x0805a7b5 in cmd_append (cmd=0x810d4e0) at cmd-append.c:499 storage = (struct mail_storage *) 0x810b660 box = <value optimized out> client = (struct client *) 0x810bd48 ctx = (struct cmd_append_context *) 0x810d528 mailbox = 0x8110588 "Sent" #6 0x0805fa6c in client_command_input (cmd=0x810d4e0) at client.c:580 client = (struct client *) 0x810bd48 command = <value optimized out> ---Type <return> to continue, or q <return> to quit--- __PRETTY_FUNCTION__ = "client_command_input" #7 0x0805fb15 in client_command_input (cmd=0x810d4e0) at client.c:629 client = (struct client *) 0x810bd48 command = (struct command *) 0x8 __PRETTY_FUNCTION__ = "client_command_input" #8 0x08060305 in client_handle_input (client=0x810bd48) at client.c:670 _data_stack_cur_id = 3 ret = <value optimized out> remove_io = <value optimized out> handled_commands = false #9 0x0806050e in client_input (client=0x810bd48) at client.c:725 cmd = <value optimized out> output = (struct ostream *) 0x810becc bytes = 34 __PRETTY_FUNCTION__ = "client_input" #10 0x080d9100 in io_loop_handler_run (ioloop=0x8108ab8) at ioloop-epoll.c:201 ctx = <value optimized out> event = (const struct epoll_event *) 0x8108bf0 list = (struct io_list *) 0x810d118 io = (struct io_file *) 0x810bf28 tv = {tv_sec = 4, tv_usec = 999383} t_id = 2 msecs = <value optimized out> ret = 1 i = 0 j = 0 call = <value optimized out> #11 0x080d8098 in io_loop_run (ioloop=0x8108ab8) at ioloop.c:308 No locals. #12 0x080680db in main (argc=Cannot access memory at address 0x8 ) at main.c:293 home = 0x0 (gdb)
==============================================================
Very similar to previous post (if not identical). Timo, how can i compile with the -O2 option when building from debian source packages?
2008/6/4 Johannes Berg johannes@sipsolutions.net:
But looking at the antispam code I think there's one bug:
static int antispam_save_finish(struct mail_save_context *ctx) struct mail *dest_mail = ast->mail;
I think ast->mail can be NULL. It should maybe be instead:
dest_mail = ctx->dest_mail != NULL ? ctx->dest_mail : ast->mail;
Yeah, probably lost that when copying from the quota code. Juan, can you try that?
OTOH, super (i.e. the quota plugin) will never see this value and that's where it seems to crash.
johannes
-----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1
On Wed, Jun 04, 2008 at 08:53:10PM +0200, Juan Asensio Sánchez wrote:
Applying the change Timo has said i get this:
[...]
Very similar to previous post (if not identical). Timo, how can i compile with the -O2 option when building from debian source packages?
You are using dpkg-buildpackage? It (should) honour(s) the usual environment variables, so then it would be
export CFLAGS=-g -O0 dpkg-buildpackage...
or whatever necessary.
Regards
- -- tomás -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.6 (GNU/Linux)
iD8DBQFIR4NcBcgs9XrR2kYRAq7/AJ4sSwDyCi+F2rOnPIaZBWHEm7imigCeI0xH +4BOV/fBgnBR9FfF/zSt+Fk= =FERi -----END PGP SIGNATURE-----
participants (4)
-
Johannes Berg
-
Juan Asensio Sánchez
-
Timo Sirainen
-
tomas@tuxteam.de