Re: [Dovecot] Dovecot 2.0beta3: Crash with mail_log plugin enabled

2010-03-16 Thread Timo Sirainen
On Sun, 2010-03-14 at 08:26 +0100, Thomas Leuxner wrote:
 Latest from Mercurial. Dovecot crashes with 'mail_log' and 'notify' plugins 
 enabled when deleting a message:

Actually it happens when copying a message (which is what your client
does when deleting). Can you easily reproduce this? I can't.. What
mailbox format are you using? Also the backtrace has some wrong values
because of gcc optimizations, it might help more if you compiled without
-O2 (CFLAGS=-g ./configure).



signature.asc
Description: This is a digitally signed message part


Re: [Dovecot] Dovecot 2.0beta3: Crash with mail_log plugin enabled

2010-03-16 Thread Thomas Leuxner
Am 16.03.2010 um 13:48 schrieb Timo Sirainen:
 Actually it happens when copying a message (which is what your client
 does when deleting). Can you easily reproduce this? I can't.. What
 mailbox format are you using? Also the backtrace has some wrong values
 because of gcc optimizations, it might help more if you compiled without
 -O2 (CFLAGS=-g ./configure).
 

mail_location = mdbox:~/mdbox

I can reproduce at will, but have trouble overriding the O2 optimization with 
'dpkg-buildpackage'.

Thomas



Re: [Dovecot] Dovecot 2.0beta3: Crash with mail_log plugin enabled

2010-03-16 Thread Pascal Volk
On 03/16/2010 08:27 PM Thomas Leuxner wrote:
 
 I can reproduce at will, but have trouble overriding the O2 optimization with 
 'dpkg-buildpackage'.
 

try:
DEB_BUILD_OPTIONS=nostrip debug dpkg-buildpackage

The CFLAGS env variable is also honored. e.g.:
CFLAGS=-g3 -O0 DEB_BUILD_OPTIONS=nostrip debug dpkg-buildpackage


Regards,
Pascal
-- 
The trapper recommends today: face1e55.1007...@localdomain.org


Re: [Dovecot] Dovecot 2.0beta3: Crash with mail_log plugin enabled

2010-03-16 Thread Thomas Leuxner
Am 16.03.2010 um 20:35 schrieb Pascal Volk:

 The CFLAGS env variable is also honored. e.g.:
 CFLAGS=-g3 -O0 DEB_BUILD_OPTIONS=nostrip debug dpkg-buildpackage

Thanks Pascal, that did the trick. Core dump attached:

[20:52] root spectre:/tmp# gdb /usr/lib/dovecot/imap /tmp/core
GNU gdb 6.8-debian
Copyright (C) 2008 Free Software Foundation, Inc.
License GPLv3+: GNU GPL version 3 or later http://gnu.org/licenses/gpl.html
This is free software: you are free to change and redistribute it.
There is NO WARRANTY, to the extent permitted by law.  Type show copying
and show warranty for details.
This GDB was configured as x86_64-linux-gnu...

warning: Can't read pathname for load map: Input/output error.
Reading symbols from /usr/lib/dovecot/libdovecot-storage.so.0...done.
Loaded symbols for /usr/lib/dovecot/libdovecot-storage.so.0
Reading symbols from /usr/lib/dovecot/libdovecot.so.0...done.
Loaded symbols for /usr/lib/dovecot/libdovecot.so.0
Reading symbols from /lib/libdl.so.2...done.
Loaded symbols for /lib/libdl.so.2
Reading symbols from /lib/librt.so.1...done.
Loaded symbols for /lib/librt.so.1
Reading symbols from /lib/libc.so.6...done.
Loaded symbols for /lib/libc.so.6
Reading symbols from /lib/ld-linux-x86-64.so.2...done.
Loaded symbols for /lib64/ld-linux-x86-64.so.2
Reading symbols from /lib/libpthread.so.0...done.
Loaded symbols for /lib/libpthread.so.0
Reading symbols from /usr/lib/dovecot/modules/lib01_acl_plugin.so...done.
Loaded symbols for /usr/lib/dovecot/modules/lib01_acl_plugin.so
Reading symbols from /usr/lib/dovecot/modules/lib02_imap_acl_plugin.so...done.
Loaded symbols for /usr/lib/dovecot/modules/lib02_imap_acl_plugin.so
Reading symbols from /usr/lib/dovecot/modules/lib10_quota_plugin.so...done.
Loaded symbols for /usr/lib/dovecot/modules/lib10_quota_plugin.so
Reading symbols from /usr/lib/dovecot/modules/lib11_imap_quota_plugin.so...done.
Loaded symbols for /usr/lib/dovecot/modules/lib11_imap_quota_plugin.so
Reading symbols from /usr/lib/dovecot/modules/lib15_notify_plugin.so...done.
Loaded symbols for /usr/lib/dovecot/modules/lib15_notify_plugin.so
Reading symbols from /usr/lib/dovecot/modules/lib20_mail_log_plugin.so...done.
Loaded symbols for /usr/lib/dovecot/modules/lib20_mail_log_plugin.so
Reading symbols from /lib/libgcc_s.so.1...done.
Loaded symbols for /lib/libgcc_s.so.1
Core was generated by `dovecot/imap'.
Program terminated with signal 6, Aborted.
[New process 31462]

#0  0x7feb99a2fed5 in raise () from /lib/libc.so.6#0  0x7feb99a2fed5 in 
raise () from /lib/libc.so.6
No symbol table info available.
#1  0x7feb99a313f3 in abort () from /lib/libc.so.6
No symbol table info available.
#2  0x7feb9a19efca in default_fatal_finish (type=LOG_TYPE_PANIC, status=0) 
at failures.c:164
backtrace = 0x628660 /usr/lib/dovecot/libdovecot.so.0 [0x7feb9a19efa6] 
- /usr/lib/dovecot/libdovecot.so.0 [0x7feb9a1a02eb] - 
/usr/lib/dovecot/libdovecot.so.0(i_fatal+0) [0x7feb9a19f31a] - 
/usr/lib/dovecot/libdovecot-st...
#3  0x7feb9a1a02eb in i_internal_fatal_handler (type=LOG_TYPE_PANIC, 
status=0, fmt=0x7feb9a4b9f18 file %s: line %d (%s): assertion failed: (%s), 
args=0x7fffba90) at failures.c:592
No locals.
#4  0x7feb9a19f31a in i_panic (format=0x7feb9a4b9f18 file %s: line %d 
(%s): assertion failed: (%s)) at failures.c:230
args = {{gp_offset = 40, fp_offset = 48, overflow_arg_area = 
0x7fffbb70, reg_save_area = 0x7fffbab0}}
#5  0x7feb9a44c531 in view_lookup_uid (view=0x66a950, seq=0, 
uid_r=0x7fffbc2c) at mail-index-view.c:210
__PRETTY_FUNCTION__ = view_lookup_uid
#6  0x7feb9a43fb82 in tview_lookup_uid (view=0x66a950, seq=0, 
uid_r=0x7fffbc2c) at mail-index-transaction-view.c:163
tview = (struct mail_index_view_transaction *) 0x66a950
#7  0x7feb9a44ce6e in mail_index_lookup_uid (view=0x66a950, seq=0, 
uid_r=0x7fffbc2c) at mail-index-view.c:474
No locals.
#8  0x7feb9a428180 in mail_cache_decision_state_update (view=0x66ac70, 
seq=0, field=12) at mail-cache-decisions.c:82
cache = (struct mail_cache *) 0x668090
hdr = (const struct mail_index_header *) 0x7feb9a901548
uid = 0
__PRETTY_FUNCTION__ = mail_cache_decision_state_update
#9  0x7feb9a42adcf in mail_cache_lookup_headers_real (view=0x66ac70, 
dest=0x685278, seq=0, field_idxs=0x7fffbdfc, fields_count=1) at 
mail-cache-lookup.c:484
cache = (struct mail_cache *) 0x668090
iter = {view = 0x7feb9a3f8760, remap_counter = 2593133896, seq = 32747, 
rec = 0x80, pos = 4294967295, rec_size = 0, offset = 4294950208, stop = 1, 
failed = 1, appends_checked = 1}
field = {field_idx = 4294950128, data = 0x80, size = 6836816}
ctx = {view = 0x669b10, lines = {arr = {buffer = 0x6692c0, element_size 
= 1011198389976563728}, v = 0x6692c0, v_modifiable = 0x6692c0}}
lines = (struct header_lookup_line *) 0x7fffc570
p = (const unsigned char *) 0x0
start = (const unsigned char *) 0x0
 

Re: [Dovecot] Dovecot 2.0beta3: Crash with mail_log plugin enabled

2010-03-16 Thread Timo Sirainen
Right, looks like it was crashing with mdbox. I thought I tested that
but I guess I didn't. Fixed now.



signature.asc
Description: This is a digitally signed message part


Re: [Dovecot] Dovecot 2.0beta3: Crash with mail_log plugin enabled

2010-03-16 Thread Thomas Leuxner
Am 16.03.2010 um 21:29 schrieb Timo Sirainen:

 Right, looks like it was crashing with mdbox. I thought I tested that
 but I guess I didn't. Fixed now.

It does not crash anymore, but it looks like the fix has a bad side effect. 
Client can not see INBOX any more, tested with Mail.app and Mutt. Rolling back 
to an previous build without these restores functionality:

- mdbox: Don't crash when accessing a copied mail that hasn't been
   committed yet.
- acl: Don't crash if opening dovecot-acl fails with EACCES.

Regards
Thomas

Re: [Dovecot] Dovecot 2.0beta3: Crash with mail_log plugin enabled

2010-03-16 Thread Pascal Volk
On 03/16/2010 10:53 PM Thomas Leuxner wrote:
 …
 It does not crash anymore, but it looks like the fix has a bad side effect. 
 Client can not see INBOX any more, tested with Mail.app and Mutt. Rolling 
 back to an previous build without these restores functionality:

What is your setup? doveconf -n?

Works here, with mdbox (hg rev b7c66370b0f7):
1 LIST  *
* LIST (\HasNoChildren) / Trash
* LIST (\HasNoChildren) / INBOX
1 OK List completed.
2 SELECT INBOX
* FLAGS (\Answered \Flagged \Deleted \Seen \Draft NonJunk)
* OK [PERMANENTFLAGS (\Answered \Flagged \Deleted \Seen \Draft NonJunk \*)] 
Flags permitted.
* 8 EXISTS
* 0 RECENT
* OK [UIDVALIDITY 1096038620] UIDs valid
* OK [UIDNEXT 9] Predicted next UID
* OK [HIGHESTMODSEQ 1] Highest
2 OK [READ-WRITE] Select completed


Regards,
Pascal
-- 
The trapper recommends today: face1e55.1007...@localdomain.org


Re: [Dovecot] Dovecot 2.0beta3: Crash with mail_log plugin enabled

2010-03-16 Thread Timo Sirainen
On 16.3.2010, at 23.53, Thomas Leuxner wrote:

 Am 16.03.2010 um 21:29 schrieb Timo Sirainen:
 
 Right, looks like it was crashing with mdbox. I thought I tested that
 but I guess I didn't. Fixed now.
 
 It does not crash anymore, but it looks like the fix has a bad side effect. 
 Client can not see INBOX any more, tested with Mail.app and Mutt. Rolling 
 back to an previous build without these restores functionality:
 
 - mdbox: Don't crash when accessing a copied mail that hasn't been
   committed yet.

That affects only saving/copying mails.

 - acl: Don't crash if opening dovecot-acl fails with EACCES.

That affects only if you have dovecot-acl files that the process can't open 
because it doesn't have permission. Do you have such files somewhere?



Re: [Dovecot] Dovecot 2.0beta3: Crash with mail_log plugin enabled

2010-03-16 Thread Thomas Leuxner
Am 16.03.2010 um 23:40 schrieb Timo Sirainen:
 That affects only if you have dovecot-acl files that the process can't open 
 because it doesn't have permission. Do you have such files somewhere?
 

Tough one. Caused by the 'doveauth' service permission changes added to my 
config before. Actually it was the global INBOX ACL owned by the wrong user, 
triggered by:

plugin {
  acl = vfile:/var/vmail/conf.d/%d/acls:cache_secs=300
 }

Thanks for pointing me in the right direction.

Regards
Thomas





[Dovecot] Dovecot 2.0beta3: Crash with mail_log plugin enabled

2010-03-13 Thread Thomas Leuxner
Latest from Mercurial. Dovecot crashes with 'mail_log' and 'notify' plugins 
enabled when deleting a message:

[08:22] root spectre:~# gdb /usr/lib/dovecot/imap /tmp/core 
GNU gdb 6.8-debian
Copyright (C) 2008 Free Software Foundation, Inc.
License GPLv3+: GNU GPL version 3 or later http://gnu.org/licenses/gpl.html
This is free software: you are free to change and redistribute it.
There is NO WARRANTY, to the extent permitted by law.  Type show copying
and show warranty for details.
This GDB was configured as x86_64-linux-gnu...

warning: Can't read pathname for load map: Input/output error.
Reading symbols from /usr/lib/dovecot/libdovecot-storage.so.0...Reading symbols 
from /usr/lib/debug/usr/lib/dovecot/libdovecot-storage.so.0.0.0...done.
done.
Loaded symbols for /usr/lib/dovecot/libdovecot-storage.so.0
Reading symbols from /usr/lib/dovecot/libdovecot.so.0...Reading symbols from 
/usr/lib/debug/usr/lib/dovecot/libdovecot.so.0.0.0...done.
done.
Loaded symbols for /usr/lib/dovecot/libdovecot.so.0
Reading symbols from /lib/libdl.so.2...done.
Loaded symbols for /lib/libdl.so.2
Reading symbols from /lib/librt.so.1...done.
Loaded symbols for /lib/librt.so.1
Reading symbols from /lib/libc.so.6...done.
Loaded symbols for /lib/libc.so.6
Reading symbols from /lib/ld-linux-x86-64.so.2...done.
Loaded symbols for /lib64/ld-linux-x86-64.so.2
Reading symbols from /lib/libpthread.so.0...done.
Loaded symbols for /lib/libpthread.so.0
Reading symbols from /usr/lib/dovecot/modules/lib01_acl_plugin.so...Reading 
symbols from /usr/lib/debug/usr/lib/dovecot/modules/lib01_acl_plugin.so...done.
done.
Loaded symbols for /usr/lib/dovecot/modules/lib01_acl_plugin.so
Reading symbols from 
/usr/lib/dovecot/modules/lib02_imap_acl_plugin.so...Reading symbols from 
/usr/lib/debug/usr/lib/dovecot/modules/lib02_imap_acl_plugin.so...done.
done.
Loaded symbols for /usr/lib/dovecot/modules/lib02_imap_acl_plugin.so
Reading symbols from /usr/lib/dovecot/modules/lib10_quota_plugin.so...Reading 
symbols from 
/usr/lib/debug/usr/lib/dovecot/modules/lib10_quota_plugin.so...done.
done.
Loaded symbols for /usr/lib/dovecot/modules/lib10_quota_plugin.so
Reading symbols from 
/usr/lib/dovecot/modules/lib11_imap_quota_plugin.so...Reading symbols from 
/usr/lib/debug/usr/lib/dovecot/modules/lib11_imap_quota_plugin.so...done.
done.
Loaded symbols for /usr/lib/dovecot/modules/lib11_imap_quota_plugin.so
Reading symbols from /usr/lib/dovecot/modules/lib15_notify_plugin.so...Reading 
symbols from 
/usr/lib/debug/usr/lib/dovecot/modules/lib15_notify_plugin.so...done.
done.
Loaded symbols for /usr/lib/dovecot/modules/lib15_notify_plugin.so
Reading symbols from 
/usr/lib/dovecot/modules/lib20_mail_log_plugin.so...Reading symbols from 
/usr/lib/debug/usr/lib/dovecot/modules/lib20_mail_log_plugin.so...done.
done.
Loaded symbols for /usr/lib/dovecot/modules/lib20_mail_log_plugin.so
Reading symbols from /lib/libgcc_s.so.1...done.
Loaded symbols for /lib/libgcc_s.so.1
Core was generated by `dovecot/imap'.
Program terminated with signal 6, Aborted.
[New process 2151]
#0  0x7f5c79480ed5 in raise () from /lib/libc.so.6
#0  0x7f5c79480ed5 in raise () from /lib/libc.so.6
No symbol table info available.
#1  0x7f5c794823f3 in abort () from /lib/libc.so.6
No symbol table info available.
#2  0x7f5c79be62c5 in default_fatal_finish (type=value optimized out, 
status=0) at failures.c:164
backtrace = 0x61f660 /usr/lib/dovecot/libdovecot.so.0 [0x7f5c79be62b2] 
- /usr/lib/dovecot/libdovecot.so.0 [0x7f5c79be631a] - 
/usr/lib/dovecot/libdovecot.so.0(i_error+0) [0x7f5c79be66c3] - 
/usr/lib/dovecot/libdovecot-st...
#3  0x7f5c79be631a in i_internal_fatal_handler (type=LOG_TYPE_PANIC, 
status=0, fmt=value optimized out, args=value optimized out) at 
failures.c:592
No locals.
#4  0x7f5c79be66c3 in i_panic (format=value optimized out) at 
failures.c:230
args = {{gp_offset = 40, fp_offset = 48, overflow_arg_area = 
0x7fffd370, reg_save_area = 0x7fffd2b0}}
#5  0x7f5c79e72748 in view_lookup_uid (view=0x6614c0, seq=0, 
uid_r=0x7fffd39c) at mail-index-view.c:210
__PRETTY_FUNCTION__ = view_lookup_uid
#6  0x7f5c79e589c6 in mail_cache_decision_state_update (view=0x661800, 
seq=2151, field=12) at mail-cache-decisions.c:82
cache = (struct mail_cache *) 0x65e790
hdr = value optimized out
uid = value optimized out
__PRETTY_FUNCTION__ = mail_cache_decision_state_update
#7  0x7f5c79e5a4b0 in mail_cache_lookup_headers (view=0x661800, 
dest=0x67be28, seq=0, field_idxs=0x7fffd56c, fields_count=1) at 
mail-cache-lookup.c:484
_data_stack_cur_id = 5
ret = value optimized out
#8  0x7f5c79e88d22 in index_mail_get_raw_headers (mail=0x67b618, 
field=0x7f5c78608dc7 Message-ID, value_r=0x7fffd5c8) at 
index-mail-headers.c:614
headers = {0x67b618 \230?e, 0x7f5c79bfda98 H\201??}
value = value optimized out
headers_ctx = value optimized out
data = value