Re: [Dovecot] imap Panic: file index-attachment.c: line 231 (index_attachment_save_finish): assertion failed: (attach->input->eof)

2013-04-17 Thread Timo Sirainen
On Tue, 2013-04-16 at 19:28 +0200, Pascal Volk wrote:
> On 04/15/2013 11:33 PM Pascal Volk wrote:
> > OK, applied that patch. Lets see what will happen.
> > 
> 
> Looks good. No crash in the last 20 hours.

OK. Committed the patch a little bit differently:

http://hg.dovecot.org/dovecot-2.2/rev/8a07a5f6fd54




Re: [Dovecot] imap Panic: file index-attachment.c: line 231 (index_attachment_save_finish): assertion failed: (attach->input->eof)

2013-04-16 Thread Pascal Volk
On 04/15/2013 11:33 PM Pascal Volk wrote:
> OK, applied that patch. Lets see what will happen.
> 

Looks good. No crash in the last 20 hours.


Regards,
Pascal
-- 
The trapper recommends today: cafefeed.1310...@localdomain.org


Re: [Dovecot] imap Panic: file index-attachment.c: line 231 (index_attachment_save_finish): assertion failed: (attach->input->eof)

2013-04-15 Thread Pascal Volk
On 04/15/2013 06:55 PM Timo Sirainen wrote:
> On Mon, 2013-04-15 at 19:53 +0300, Timo Sirainen wrote:
>> Uh, wrong directory. This patch. :)
> 
> Once more, with some error checks :)

OK, applied that patch. Lets see what will happen.


Regards,
Pascal
-- 
The trapper recommends today: defaced.1310...@localdomain.org


Re: [Dovecot] imap Panic: file index-attachment.c: line 231 (index_attachment_save_finish): assertion failed: (attach->input->eof)

2013-04-15 Thread Timo Sirainen
On Mon, 2013-04-15 at 19:53 +0300, Timo Sirainen wrote:
> On Mon, 2013-04-15 at 19:50 +0300, Timo Sirainen wrote:
> > On Mon, 2013-04-15 at 16:37 +0200, Pascal Volk wrote:
> > 
> > > some imap processes seems to have some problems.
> > 
> > I still can't reproduce .. but I wonder if the attached patch makes a
> > difference.
> 
> Uh, wrong directory. This patch. :)

Once more, with some error checks :)

diff -r b38d5ebacf25 src/imap/cmd-append.c
--- a/src/imap/cmd-append.c	Mon Apr 15 17:22:06 2013 +0300
+++ b/src/imap/cmd-append.c	Mon Apr 15 19:54:49 2013 +0300
@@ -777,6 +777,11 @@
 	if (ctx->litinput->eof || client->input->closed) {
 		bool all_written = ctx->litinput->v_offset == ctx->literal_size;
 
+		if (all_written && ctx->save_ctx != NULL && !ctx->failed) {
+			if (mailbox_save_continue(ctx->save_ctx) < 0)
+ctx->failed = TRUE;
+		}
+
 		/* finished - do one more read, to make sure istream-chain
 		   unreferences its stream, which is needed for litinput's
 		   unreferencing to seek the client->input to correct


Re: [Dovecot] imap Panic: file index-attachment.c: line 231 (index_attachment_save_finish): assertion failed: (attach->input->eof)

2013-04-15 Thread Timo Sirainen
On Mon, 2013-04-15 at 19:50 +0300, Timo Sirainen wrote:
> On Mon, 2013-04-15 at 16:37 +0200, Pascal Volk wrote:
> 
> > some imap processes seems to have some problems.
> 
> I still can't reproduce .. but I wonder if the attached patch makes a
> difference.

Uh, wrong directory. This patch. :)

diff -r b38d5ebacf25 src/imap/cmd-append.c
--- a/src/imap/cmd-append.c	Mon Apr 15 17:22:06 2013 +0300
+++ b/src/imap/cmd-append.c	Mon Apr 15 19:48:40 2013 +0300
@@ -777,6 +777,11 @@
 	if (ctx->litinput->eof || client->input->closed) {
 		bool all_written = ctx->litinput->v_offset == ctx->literal_size;
 
+		if (all_written) {
+			if (mailbox_save_continue(ctx->save_ctx) < 0)
+ctx->failed = TRUE;
+		}
+
 		/* finished - do one more read, to make sure istream-chain
 		   unreferences its stream, which is needed for litinput's
 		   unreferencing to seek the client->input to correct


Re: [Dovecot] imap Panic: file index-attachment.c: line 231 (index_attachment_save_finish): assertion failed: (attach->input->eof)

2013-04-15 Thread Timo Sirainen
On Mon, 2013-04-15 at 16:37 +0200, Pascal Volk wrote:

> some imap processes seems to have some problems.

I still can't reproduce .. but I wonder if the attached patch makes a
difference.

Also in the gdb these would be useful to know:

p *attach.input.real_stream.parent.real_stream
p *attach.input.real_stream.parent.real_stream.parent.real_stream
p 
*attach.input.real_stream.parent.real_stream.parent.real_stream.parent.real_stream

(not sure how many parents it has)

diff -r 613258f9f541 src/lib-sieve/edit-mail.c
--- a/src/lib-sieve/edit-mail.c	Mon Oct 29 22:42:34 2012 +0100
+++ b/src/lib-sieve/edit-mail.c	Sat Jan 05 01:34:21 2013 +0200
@@ -1078,6 +1078,13 @@
 	return edmail->wrapped->v.get_modseq(&edmail->wrapped->mail);
 }
 
+static uint64_t edit_mail_get_pvt_modseq(struct mail *mail)
+{
+	struct edit_mail *edmail = (struct edit_mail *)mail;
+
+	return edmail->wrapped->v.get_pvt_modseq(&edmail->wrapped->mail);
+}
+
 static int edit_mail_get_parts
 (struct mail *mail, struct message_part **parts_r)
 {
@@ -1397,6 +1404,13 @@
 	edmail->wrapped->v.update_modseq(&edmail->wrapped->mail, min_modseq);
 }
 
+static void edit_mail_update_pvt_modseq(struct mail *mail, uint64_t min_pvt_modseq)
+{
+	struct edit_mail *edmail = (struct edit_mail *)mail;
+
+	edmail->wrapped->v.update_pvt_modseq(&edmail->wrapped->mail, min_pvt_modseq);
+}
+
 static void edit_mail_update_pop3_uidl(struct mail *mail, const char *uidl)
 {
 	struct edit_mail *edmail = (struct edit_mail *)mail;
@@ -1431,6 +1445,7 @@
 	edit_mail_get_keywords,
 	edit_mail_get_keyword_indexes,
 	edit_mail_get_modseq,
+	edit_mail_get_pvt_modseq,
 	edit_mail_get_parts,
 	edit_mail_get_date,
 	edit_mail_get_received_date,
@@ -1447,6 +1462,7 @@
 	edit_mail_update_flags,
 	edit_mail_update_keywords,
 	edit_mail_update_modseq,
+	edit_mail_update_pvt_modseq,
 	edit_mail_update_pop3_uidl,
 	edit_mail_expunge,
 	edit_mail_set_cache_corrupted,


Re: [Dovecot] imap Panic: file index-attachment.c: line 231 (index_attachment_save_finish): assertion failed: (attach->input->eof)

2013-04-15 Thread Pascal Volk
On 04/15/2013 04:51 PM, Timo Sirainen wrote:
> Can you reproduce it? What client was that with? I wonder if it was
> using CATENATE extension.

Three users where able to crash their imap service. All three users are
using Thunderbird 17.0.5@Windows.

I'm not sure what they've done exactly. Nobody complained about it - so far.


Regards,
Pascal


Re: [Dovecot] imap Panic: file index-attachment.c: line 231 (index_attachment_save_finish): assertion failed: (attach->input->eof)

2013-04-15 Thread Timo Sirainen
On Mon, 2013-04-15 at 16:37 +0200, Pascal Volk wrote:

> some imap processes seems to have some problems.

Can you reproduce it? What client was that with? I wonder if it was
using CATENATE extension.




[Dovecot] imap Panic: file index-attachment.c: line 231 (index_attachment_save_finish): assertion failed: (attach->input->eof)

2013-04-15 Thread Pascal Volk
Hi Timo,

some imap processes seems to have some problems.


Regards,
Pascal
Core was generated by `dovecot/imap'.
Program terminated with signal 6, Aborted.
#0  0x7fbf87b25475 in raise () from /lib/x86_64-linux-gnu/libc.so.6
(gdb) bt full
#0  0x7fbf87b25475 in raise () from /lib/x86_64-linux-gnu/libc.so.6
No symbol table info available.
#1  0x7fbf87b286f0 in abort () from /lib/x86_64-linux-gnu/libc.so.6
No symbol table info available.
#2  0x7fbf87ef71c9 in default_fatal_finish (type=LOG_TYPE_PANIC, status=0) 
at failures.c:191
backtrace = 0x194bf58 "/usr/local/lib/dovecot/libdovecot.so.0(+0x7a1a2) 
[0x7fbf87ef71a2] -> /usr/local/lib/dovecot/libdovecot.so.0(+0x7b4cd) 
[0x7fbf87ef84cd] -> /usr/local/lib/dovecot/libdovecot.so.0(i_fatal+0) 
[0x7fbf87ef7"...
#3  0x7fbf87ef84cd in i_internal_fatal_handler (ctx=0x7fffb895a7b0, 
format=0x7fbf8828f4c0 "file %s: line %d (%s): assertion failed: (%s)", 
args=0x7fffb895a798) at failures.c:652
status = 0
#4  0x7fbf87ef74a5 in i_panic (format=0x7fbf8828f4c0 "file %s: line %d 
(%s): assertion failed: (%s)") at failures.c:263
ctx = {type = LOG_TYPE_PANIC, exit_status = 0, timestamp = 0x0}
args = {{gp_offset = 40, fp_offset = 48, overflow_arg_area = 
0x7fffb895a880, reg_save_area = 0x7fffb895a7c0}}
#5  0x7fbf8822776e in index_attachment_save_finish (ctx=0x19ed140) at 
index-attachment.c:231
attach = 0x1a0d870
__FUNCTION__ = "index_attachment_save_finish"
#6  0x7fbf881b3ab0 in dbox_save_end (ctx=0x19ed140) at dbox-save.c:106
mdata = 0x19ed150
dbox_output = 0x1a07008
__FUNCTION__ = "dbox_save_end"
#7  0x7fbf881aadf7 in mdbox_save_finish_write (_ctx=0x19ed140) at 
mdbox-save.c:198
ctx = 0x19ed140
mail = 0x636c08
#8  0x7fbf881aaf5d in mdbox_save_finish (ctx=0x19ed140) at mdbox-save.c:228
ret = 0
#9  0x7fbf872c505b in quota_save_finish (ctx=0x19ed140) at 
quota-storage.c:281
qbox = 0x19e0a50
#10 0x7fbf882041f7 in mailbox_save_finish (_ctx=0x1971498) at 
mail-storage.c:2022
ctx = 0x19ed140
t = 0x19ebdc0
keywords = 0x0
pvt_flags = 0
copying_via_save = false
ret = 0
__FUNCTION__ = "mailbox_save_finish"
#11 0x0040d165 in cmd_append_continue_message (cmd=0x1971340) at 
cmd-append.c:802
all_written = true
client = 0x1970760
ctx = 0x1971438
ret = 0
#12 0x0041a04e in command_exec (cmd=0x1971340) at imap-commands.c:156
hook = 0x1954da0
ret = false
#13 0x0040b9be in client_input_append (cmd=0x1971340) at 
cmd-append.c:112
ctx = 0x1971438
client = 0x1970760
reason = 0x7fbf87ef5033 "H\213\005.3'"
finished = false
__FUNCTION__ = "client_input_append"
#14 0x7fbf87f0e58d in io_loop_call_io (io=0x19de2a0) at ioloop.c:387
ioloop = 0x1953720
t_id = 2
#15 0x7fbf87f101ed in io_loop_handler_run (ioloop=0x1953720) at 
ioloop-epoll.c:215
ctx = 0x1953aa0
events = 0x1953b10
event = 0x1953b10
list = 0x1971290
io = 0x19de2a0
tv = {tv_sec = 59, tv_usec = 999033}
events_count = 6
msecs = 6
ret = 1
i = 0
j = 0
call = true
__FUNCTION__ = "io_loop_handler_run"
#16 0x7fbf87f0e630 in io_loop_run (ioloop=0x1953720) at ioloop.c:406
No locals.
#17 0x7fbf87ea609e in master_service_run (service=0x19535b0, 
callback=0x426143 ) at master-service.c:560
No locals.
#18 0x0042645c in main (argc=1, argv=0x1953390) at main.c:400
set_roots = {0x42f500, 0x0}
login_set = {auth_socket_path = 0x194b050  , 
postlogin_socket_path = 0x0, postlogin_timeout_secs = 60, callback = 0x425f07 
, failure_callback = 0x4260cf , 
request_auth_token = 1}
service_flags = MASTER_SERVICE_FLAG_KEEP_CONFIG_OPEN
storage_service_flags = MAIL_STORAGE_SERVICE_FLAG_DISALLOW_ROOT
username = 0x0
c = -1
# 2.2.0: /usr/local/etc/dovecot/dovecot.conf
# OS: Linux 3.2.0-4-amd64 x86_64 Debian 7.0 
auth_mechanisms = plain login
debug_log_path = /var/log/dovecot_dbg.log
dict {
  quota = pgsql:/usr/local/etc/dovecot/dovecot-dict-sql.conf.ext
}
first_valid_gid = 7
first_valid_uid = 7
lmtp_save_to_detail_mailbox = yes
login_access_sockets = tcpwrap
mail_access_groups = dovemail
mail_attachment_dir = /srv/mail/.SiS/%X{gid}
mail_attachment_fs = sis posix:mode=0660
mail_attachment_hash = %{sha256}
mail_location = mdbox:~/mdbox
mail_plugins = quota stats zlib
managesieve_notify_capability = mailto
managesieve_sieve_capability = fileinto reject envelope encoded-character 
vacation subaddress comparator-i;ascii-numeric relational regex imap4flags copy 
include variables body enotify environment mailbox date ihave
namespace Public {
  location = 
maildir:/srv/mail/.public/%X{gid}/Maildir:LAYOUT=fs:INDEX=~/Maildir/public
  prefix = "#Public/"
  separator = /