Re: v2.2.27 released --- libressl

2016-12-06 Thread Michael A. Peters

On 12/06/2016 11:35 AM, Ruga wrote:

Results from the application of the following patch from Aki.

perl -i -ple 's|^(\s*#include \s*)$|$1\n\t#if 
OPENSSL_VERSION_NUMBER == 0x2000L\n\t#define OPENSSL_VERSION_NUMBER 
0x10001000L\n\t#endif|' configure.ac;



I use a different method of patching but similar in end result concept, 
but I too have an error - I haven't looked at why yet, that's on my todo 
list, just saw the build fails.


I might see if I can get it to build tonight. My personal use of dovecot 
is rather limited, three low volume servers, so I can't be of much use 
in finding problems that are not compile related, but I'll try to figure 
out the LibreSSL needed build tweaking tonight.


Setting up replication - First steps...

2016-12-06 Thread SH Development
Just had my first (non-Dovecot) server failure due to dried out caps on the 
motherboard.  Got me to thinking about my single-point-of-failure mail server.  
Currently running Dovecot and Postfix with no issues, but want to start taking 
steps just to be safe.

I currently run a filesystem backup every 24 hours to a tar file over NFS to 
another server in our rack.  I am backing up:

/home/vmail
/etc/dovecot
/etc/postfix

Unfortunately, the vmail directory has grown to 27GB and takes around 7 hours 
now to backup as described above.  Which leads me to start thinking about how 
quickly I could restore the server from a backup if need be, and that time is 
at least 7 hours just to copy and untar the files onto another hard drive. I’m 
sure I could hook up a HD up directly to the backup server, then I could 
considerably reduce the time, but I’m making the assumption that I won’t always 
have quick physical access to the location.

So I believe my first step is to set up another server, on another IP, 
different hostname, with Dovecot and Postfix, and simply use the files from the 
/etc directories of the existing server to configure it (changing the IP and 
hostname of course).

Am I on the right track so far?

Next steps involve setting up replication with dsync?

If I have successfully setup replication between the two servers, does this 
mean users can then actually log into either server and have their “stuff” 
intact?  So I could set up DNS failover in case the primary server fails?  
Would this make the setup acceptable for secondary MX as everything should sync 
to the primary server when it comes back online?

Sorry for thinking out loud, but I want to make sure I’m understanding the 
bigger picture here.

Jeff


Segmentation fault in imap_bodystructure_is_plain_7bit

2016-12-06 Thread Mihai Craiu
Hi,

I have a lot of errors like this in my log:
Fatal: master: service(imap): child 26049 killed with signal 11 (core
dumped)

Dovecot 2.2.18 build from sources ./configure --prefix=/opt/dovecot2
--with-mysql --with-sqlite --with-solr --with-ssl --disable-rpath
--disable-static.
Debian Wheezy 3.2.63-2 x86_64.
Filesystem is ZFS.

All the core files are similar:
$ gdb /opt/dovecot2/libexec/dovecot/imap core
GNU gdb (GDB) 7.4.1-debian
Copyright (C) 2012 Free Software Foundation, Inc.
License GPLv3+: GNU GPL version 3 or later 
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".
For bug reporting instructions, please see:
...
Reading symbols from /opt/dovecot2/libexec/dovecot/imap...done.
[New LWP 11635]

warning: Can't read pathname for load map: Input/output error.
[Thread debugging using libthread_db enabled]
Using host libthread_db library "/lib/x86_64-linux-gnu/libthread_db.so.1".
Core was generated by `/opt/dovecot2/libexec/dovecot/imap imap-postlogin'.
Program terminated with signal 11, Segmentation fault.
#0  imap_bodystructure_is_plain_7bit (part=part@entry=0x234cd50) at
imap-bodystructure.c:458

458if (data->content_subtype != NULL &&
(gdb) bt
#0  imap_bodystructure_is_plain_7bit (part=part@entry=0x234cd50) at
imap-bodystructure.c:458
#1  0x7f920a0fbfaf in index_mail_body_parsed_cache_flags
(mail=0x234be60) at index-mail.c:587
#2  index_mail_parse_body_finish (mail=mail@entry=0x234be60,
field=field@entry=MAIL_CACHE_IMAP_BODYSTRUCTURE, success=success@entry=true)
at index-mail.c:1007
#3  0x7f920a0fc369 in index_mail_parse_body (mail=mail@entry=0x234be60,
field=field@entry=MAIL_CACHE_IMAP_BODYSTRUCTURE) at index-mail.c:1081
#4  0x7f920a0fc498 in index_mail_parse_bodystructure
(mail=mail@entry=0x234be60,
field=field@entry=MAIL_CACHE_IMAP_BODYSTRUCTURE) at index-mail.c:1222
#5  0x7f920a0fcf1c in index_mail_get_special (_mail=_mail@entry=0x234be60,
field=field@entry=MAIL_FETCH_IMAP_BODYSTRUCTURE,
value_r=value_r@entry=0x7ffc1518fde8)
at index-mail.c:1379
#6  0x7f920a0b29cd in dbox_mail_get_special (_mail=_mail@entry=0x234be60,
field=field@entry=MAIL_FETCH_IMAP_BODYSTRUCTURE,
value_r=value_r@entry=0x7ffc1518fde8)
at dbox-mail.c:229
#7  0x7f920a0a83f0 in mdbox_mail_get_special (_mail=0x234be60,
field=MAIL_FETCH_IMAP_BODYSTRUCTURE, value_r=0x7ffc1518fde8) at
mdbox-mail.c:213
#8  0x7f920a08f96d in mail_get_special (mail=,
field=field@entry=MAIL_FETCH_IMAP_BODYSTRUCTURE,
value_r=value_r@entry=0x7ffc1518fde8)
at mail.c:317
#9  0x00419a6a in fetch_bodystructure (ctx=0x232bbd8,
mail=, context=) at imap-fetch.c:690
#10 0x00419f9f in imap_fetch_more_int (ctx=ctx@entry=0x232bbd8,
cancel=false) at imap-fetch.c:506
#11 0x0041af07 in imap_fetch_more (ctx=0x232bbd8,
cmd=cmd@entry=0x232ba00)
at imap-fetch.c:558
#12 0x0040f0c9 in cmd_fetch (cmd=0x232ba00) at cmd-fetch.c:286
#13 0x00418aec in command_exec (cmd=cmd@entry=0x232ba00) at
imap-commands.c:167
#14 0x00417ad0 in client_command_input (cmd=cmd@entry=0x232ba00) at
imap-client.c:814
#15 0x00417b64 in client_command_input (cmd=0x232ba00) at
imap-client.c:874
#16 0x00417e45 in client_handle_next_command
(remove_io_r=, client=0x232ade0) at imap-client.c:912
#17 client_handle_input (client=client@entry=0x232ade0) at imap-client.c:924
#18 0x00418212 in client_input (client=0x232ade0) at
imap-client.c:966
#19 0x7f9209df134b in io_loop_call_io (io=0x232b8f0) at ioloop.c:501
#20 0x7f9209df1e5b in io_loop_handler_run_internal
(ioloop=ioloop@entry=0x22ec790)
at ioloop-epoll.c:220
#21 0x7f9209df13d9 in io_loop_handler_run (ioloop=ioloop@entry=0x22ec790)
at ioloop.c:548
#22 0x7f9209df1458 in io_loop_run (ioloop=0x22ec790) at ioloop.c:525
#23 0x7f9209d92993 in master_service_run (service=0x22ec620,
callback=callback@entry=0x421140 ) at master-service.c:581
#24 0x0040c60b in main (argc=2, argv=0x22ec390) at main.c:431
(gdb) q

Thanks.


Re: v2.2.27 released --- libressl

2016-12-06 Thread Ruga
Results from the application of the following patch from Aki.

perl -i -ple 's|^(\s*#include \s*)$|$1\n\t#if 
OPENSSL_VERSION_NUMBER == 0x2000L\n\t#define OPENSSL_VERSION_NUMBER 
0x10001000L\n\t#endif|' configure.ac;

compiler-stderr.log
Description: Binary data


Re: Dovecot: Mails flagged as read get flagged as unread

2016-12-06 Thread Alexey Asemov (Alex/AT)
Does this correspond with some index damage in logs? We did have some of 
these in 2.2.6.0 ("Missing middle file seq=.." followed by reindexing 
and "lost Recent state" message), with 2.2.7 these seem to have stopped 
appearing.



On 06.12.2016 13:34, Peter Chiochetti wrote:
Hi, There is a plugin "mail_log" that you can use to audit what 
users/user agents are doing, probably mail_log_events flag_change is 
helpful?




Panic: file dsync-mailbox-tree-sync.c: line 576 (node_mailbox_trees_cmp): assertion failed: (ret != 0)

2016-12-06 Thread Gilles Chauvin

Hi,

Here is a crash that's happening using the latest Dovecot version 
(v2.2.27 on CentOS7 x86_64):


We are using replication. Judging by the second server's logs, I believe 
this has something to do with the fact that we're using the lazy_expunge 
plugin.


Every night after midnight, we purge the lazy_expunge namespace by 
running a command similar to following one on the main server (server01 
in the logs below):

# doveadm expunge -A MAILBOX 'EXPUNGED/*' SAVEDBEFORE "$(date +'%F')"

The lazy_expunge namespace is configured as follows:

namespace expunged {
  disabled = no
  hidden = yes
  ignore_on_failure = no
  inbox = no
  list = no
  location = 
sdbox:/srv/mail/expunged/%1n/%n:SUBSCRIPTIONS=subscriptions-expunged

  order = 0
  prefix = EXPUNGED/
  separator = /
  subscriptions = no
  type = private
}

plugin {
  lazy_expunge = EXPUNGED/
}



First server's logs:

2016-12-06T13:09:31.212620+01:00 server01 dovecot: dsync-server(user01): 
Panic: file dsync-mailbox-tree-sync.c: line 576 
(node_mailbox_trees_cmp): assertion failed: (ret != 0)
2016-12-06T13:09:31.213473+01:00 server01 dovecot: dsync-server(user01): 
Error: Raw backtrace: /usr/local/lib/dovecot/libdovecot.so.0(+0x92d70) 
[0x7f57cc18ad70] -> /usr/local/lib/dovecot/libdovecot.so.0(+0x92e4e) 
[0x7f57cc18ae4e] -> /usr/local/lib/dovecot/libdovecot.so.0(i_fatal+0) 
[0x7f57cc1264e0] -> dovecot/doveadm-server [10.0.0.2 user01 
recv_mailbox_tree_deletes]() [0x447584] -> dovecot/doveadm-server 
[10.0.0.2 user01 recv_mailbox_tree_deletes]() [0x447a57] -> 
dovecot/doveadm-server [10.0.0.2 user01 recv_mailbox_tree_deletes]() 
[0x447849] -> dovecot/doveadm-server [10.0.0.2 user01 
recv_mailbox_tree_deletes]() [0x447849] -> dovecot/doveadm-server 
[10.0.0.2 user01 
recv_mailbox_tree_deletes](dsync_mailbox_trees_sync_init+0x1f9) 
[0x447cc9] -> dovecot/doveadm-server [10.0.0.2 user01 
recv_mailbox_tree_deletes](dsync_brain_recv_mailbox_tree_deletes+0x207) 
[0x43a477] -> dovecot/doveadm-server [10.0.0.2 user01 
recv_mailbox_tree_deletes](dsync_brain_run+0x5fe) [0x436e4e] -> 
dovecot/doveadm-server [10.0.0.2 user01 recv_mailbox_tree_deletes]() 
[0x437280] -> dovecot/doveadm-server [10.0.0.2 user01 
recv_mailbox_tree_deletes]() [0x44c5af] -> 
/usr/local/lib/dovecot/libdovecot.so.0(io_loop_call_io+0x52) 
[0x7f57cc19e4d2] -> 
/usr/local/lib/dovecot/libdovecot.so.0(io_loop_handler_run_internal+0xe7) 
[0x7f57cc19fa07] -> 
/usr/local/lib/dovecot/libdovecot.so.0(io_loop_handler_run+0x3c) 
[0x7f57cc19e56c] -> 
/usr/local/lib/dovecot/libdovecot.so.0(io_loop_run+0x38) 
[0x7f57cc19e728] -> dovecot/doveadm-server [10.0.0.2 user01 
recv_mailbox_tree_deletes]() [0x41faae] -> dovecot/doveadm-server 
[10.0.0.2 user01 recv_mailbox_tree_deletes]() [0x421316] -> 
dovecot/doveadm-server [10.0.0.2 user01 recv_mailbox_tree_deletes]() 
[0x433b64] -> 
/usr/local/lib/dovecot/libdovecot.so.0(io_loop_call_io+0x52) 
[0x7f57cc19e4d2] -> 
/usr/local/lib/dovecot/libdovecot.so.0(io_loop_handler_run_internal+0xe7) 
[0x7f57cc19fa07] -> 
/usr/local/lib/dovecot/libdovecot.so.0(io_loop_handler_run+0x3c) 
[0x7f57cc19e56c] -> 
/usr/local/lib/dovecot/libdovecot.so.0(io_loop_run+0x38) 
[0x7f57cc19e728] -> 
/usr/local/lib/dovecot/libdovecot.so.0(master_service_run+0x13) 
[0x7f57cc12c513] -> dovecot/doveadm-server [10.0.0.2 user01 
recv_mailbox_tree_deletes](main+0x197) [0x413b57] -> 
/lib64/libc.so.6(__libc_start_main+0xf5) [0x7f57cbd57b15] -> 
dovecot/doveadm-server [10.0.0.2 user01 recv_mailbox_tree_deletes]() 
[0x413bf5]
2016-12-06T13:09:31.214076+01:00 server01 dovecot: dsync-server(user01): 
Fatal: master: service(doveadm): child 6837 killed with signal 6 (core 
dumps disabled)
2016-12-06T13:11:42.880516+01:00 server01 dovecot: dsync-local(user01): 
Error: read(server02.localdomain) failed: EOF (last sent=mailbox_delete, 
last recv=mailbox_tree_node)



Second server's logs:

2016-12-06T12:09:36.220591+01:00 server02 dovecot: doveadm(user01): 
Error: Duplicate mailbox GUID eab35824e49b4658840001001776124f for 
mailboxes EXPUNGED/Trash/C2i - 
Coordination-temp-ac1fea3af7e1f2c29ce1c62442a06272/Demissions C2i and 
EXPUNGED/Trash/C2i - Coordination/Demissions C2i - giving a new GUID 
c4ffaf08709c465813aea26dfa6e to EXPUNGED/Trash/C2i - 
Coordination-temp-ac1fea3af7e1f2c29ce1c62442a06272/Demissions C2i
2016-12-06T12:09:36.220859+01:00 server02 dovecot: doveadm(user01): 
Error: Duplicate mailbox GUID 2ab10a2bee9b4658840001001776124f for 
mailboxes EXPUNGED/Trash/C2i - 
Coordination-temp-ac1fea3af7e1f2c29ce1c62442a06272/2014-2015 and 
EXPUNGED/Trash/C2i - Coordination/2014-2015 - giving a new GUID 
c6ffaf08709c465813aea26dfa6e to EXPUNGED/Trash/C2i - 
Coordination-temp-ac1fea3af7e1f2c29ce1c62442a06272/2014-2015
2016-12-06T12:09:36.221091+01:00 server02 dovecot: doveadm(user01): 
Error: Duplicate mailbox GUID eeb35824e49b4658840001001776124f for 
mailboxes EXPUNGED/Trash/C2i - 
Coordination-temp-ac1fea3af7e1f2c29ce1c62442a06272/2012-2013 and 
EXPUNGED/Trash/C2i - Coordination/2012-2013 - g

Re: Dovecot: Mails flagged as read get flagged as unread

2016-12-06 Thread Peter Chiochetti
Hi, There is a plugin "mail_log" that you can use to audit what 
users/user agents are doing, probably mail_log_events flag_change is 
helpful?


--
peter

Am 2016-12-06 um 10:24 schrieb plataleas:

Hi Steffen

Thanks for the reply!

- Users are accessing from multiple devices simultaneously
- Each user has his own mailbox, we do not use shared mailboxes

regards



On 12/06/2016 10:14 AM, Steffen Kaiser wrote:

On Tue, 6 Dec 2016, plataleas wrote:


We experience some unexpected behavior with dovecot. It happens that
emails marked as read get marked as unread (MUA is Thunderbird on port
143). Unfortunately this happens randomly, reproducing this issue is
difficult. We could not find any pattern, it happens rarely.


does your user(s) access these mailboxes from two or more clients
simultaneously - either from the same account or as shared mailboxes?

-- Steffen Kaiser


Re: 2.2.27 panic file mail-index-map.c: line 549 (mail_index_map_lookup_seq_range): assertion failed: (first_uid > 0)

2016-12-06 Thread Aki Tuomi



On 06.12.2016 10:47, Aki Tuomi wrote:



On 06.12.2016 10:44, Toni Mattila wrote:

Hi,

On 06-Dec-16 10:10, Aki Tuomi wrote:

Alternatively if you could try and print the args array in cmd_search?

f 14
p args[0]
p args[1]
...
until NULL


My hand got sore at first 100 and they are below. I will mail you the 
binary and core in seperate mail.


Cheers,

Toni


Thanks. I should've probably said until EOL.

$5 = {type = IMAP_ARG_EOL, parent = 0x0, str_len = 0, _data = {str = 
0x0, literal_size = 0, list = {arr = {buffer = 0x0, element_size = 0}, 
v = 0x0, v_modifiable = 0x0}}, literal8 = 0}


Aki


I was able to repeat this bug, thank you for your report.

Aki


Re: Dovecot: Mails flagged as read get flagged as unread

2016-12-06 Thread plataleas
Hi Steffen

Thanks for the reply!

- Users are accessing from multiple devices simultaneously
- Each user has his own mailbox, we do not use shared mailboxes

regards



On 12/06/2016 10:14 AM, Steffen Kaiser wrote:
> On Tue, 6 Dec 2016, plataleas wrote:
>
> > We experience some unexpected behavior with dovecot. It happens that
> > emails marked as read get marked as unread (MUA is Thunderbird on port
> > 143). Unfortunately this happens randomly, reproducing this issue is
> > difficult. We could not find any pattern, it happens rarely.
>
> does your user(s) access these mailboxes from two or more clients
> simultaneously - either from the same account or as shared mailboxes?
>
> -- Steffen Kaiser


Re: Dovecot: Mails flagged as read get flagged as unread

2016-12-06 Thread Steffen Kaiser

-BEGIN PGP SIGNED MESSAGE-
Hash: SHA1

On Tue, 6 Dec 2016, plataleas wrote:


We experience some unexpected behavior with dovecot. It happens that
emails marked as read get marked as unread (MUA is Thunderbird on port
143). Unfortunately this happens randomly, reproducing this issue is
difficult. We could not find any pattern, it happens rarely.


does your user(s) access these mailboxes from two or more clients 
simultaneously - either from the same account or as shared mailboxes?


- -- 
Steffen Kaiser

-BEGIN PGP SIGNATURE-
Version: GnuPG v1

iQEVAwUBWEaBc3z1H7kL/d9rAQI71gf/Y0U/GNaxJO2nEQFfTjXMzb68NfH4x7Nn
lMFhb+HJjqLIb8VfBFbEEMx2fTcxH0Aq4QxdapnCpT8GSJWx6Eu2/XycnothrXpV
y96UUMcCP4CGS5w6ezdJyFQxmapp6XNCZ3FU+tm5J54Vpe2dX5q60+xAY+yPog3E
obf1/VXjfLy++ubUcv0LGhgkBbmYlsAR4v5Ht2Er8ArfyIOzNhbbmneDAemL+nIE
IdzXmeLuEEY0xTrp5K6jFWe4Q+h6Zt+Q/R+5PXSj67s0e6wPeO/0/bPXdnDJHITJ
DqT1vrMZpCXD5fInNVU85mjhjrY/1iu1AbbJCjRuMkHCfJz2YwCi4Q==
=YcKj
-END PGP SIGNATURE-


Dovecot: Mails flagged as read get flagged as unread

2016-12-06 Thread plataleas
Hi all

We experience some unexpected behavior with dovecot. It happens that
emails marked as read get marked as unread (MUA is Thunderbird on port
143). Unfortunately this happens randomly, reproducing this issue is
difficult. We could not find any pattern, it happens rarely.

We are running dovecot version 2.2.24 on Debian Jessie (backports
repository).
/root@dovecot01:~# dovecot --version//
//2.2.24 (a82c823)/

Our Setup:
/ha-proxy01 -> dovecot-proxy01 (proxy=yes) -> dovecot01 (proxy=no)
* IP is used for multiple services (ports). We use the haproxy to send
traffic on different ports to different servers.
/
Below the configuration (IMAPC is active for migration purposes).

Do you have any recommendations where we could focus for
troubleshooting? I found some posts about mbox_lazy_writes causing
similar issues. However we use mdbox in our setup.

If we enable rawlog for what log patterns should we search?

Your Inputs are highly appreciated!

Thanks and Regards
plataleas


*- haproxy configuration --

*frontend frontend_mail.company.org-143
  bind 10.100.189.34:143
  mode tcp
  default_backend backend_mail.company.org-143
backend backend_mail.company.org-143
  mode tcp
  balance source
  server dovecot-proxy01.company.org  dovecot-proxy01.company.org:10143
check send-proxy-v2
  server dovecot-proxy02.company.org  dovecot-proxy02.company.org:10143
check send-proxy-v2 backup



*- config Dovecot Proxy -*

/root@dovecot-proxy01:~#  dovecot -n
# 2.2.24 (a82c823): /etc/dovecot/dovecot.conf
# Pigeonhole version 0.4.13 (7b14904)
# OS: Linux 3.16.0-4-amd64 x86_64 Debian 8.5
auth_username_chars =
abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ01234567890.-_@*
default_client_limit = 5000
default_process_limit = 500
disable_plaintext_auth = no
haproxy_trusted_networks = 10.10.189.28,10.10.189.29
imap_capability = IMAP4rev1 UIDPLUS CHILDREN NAMESPACE
THREAD=ORDEREDSUBJECT THREAD=REFERENCES SORT QUOTA IDLE ACL ACL2=UNION
STARTTLS
listen = 10.10.189.25
mail_location = mdbox:%h/mdbox
mail_max_userip_connections = 0
mail_plugins = zlib
mdbox_rotate_size = 10 M
namespace inbox {
  inbox = yes
  location =
  mailbox Drafts {
special_use = \Drafts
  }
  mailbox Junk {
special_use = \Junk
  }
  mailbox Sent {
special_use = \Sent
  }
  mailbox "Sent Messages" {
special_use = \Sent
  }
  mailbox Trash {
special_use = \Trash
  }
  prefix = INBOX.
  separator = .
}
passdb {
  args = /etc/dovecot/dovecot-ldap.conf.ext
  driver = ldap
}
plugin {
  gzip_save_level = 6
  pop3_migration_mailbox = POP3-MIGRATION-NS/INBOX
  sieve = file:~/sieve;active=~/.dovecot.sieve
  zlib_save = gz
}
protocols = imap pop3 lmtp
service imap-login {
  inet_listener imap_haproxy {
address = 10.10.189.25
haproxy = yes
port = 10143
  }
  inet_listener imaps_haproxy {
address = 10.10.189.25
haproxy = yes
port = 10993
ssl = yes
  }
}
service lmtp {
  inet_listener lmtp {
address = 10.10.189.25
port = 24
  }
}
service pop3-login {
  inet_listener pop3_haproxy {
address = 10.10.189.25
haproxy = yes
port = 10110
  }
  inet_listener pop3s_haproxy {
address = 10.10.189.25
haproxy = yes
port = 10995
ssl = yes
  }
}
ssl_ca = 

Re: 2.2.27 panic file mail-index-map.c: line 549 (mail_index_map_lookup_seq_range): assertion failed: (first_uid > 0)

2016-12-06 Thread Aki Tuomi



On 06.12.2016 10:44, Toni Mattila wrote:

Hi,

On 06-Dec-16 10:10, Aki Tuomi wrote:

Alternatively if you could try and print the args array in cmd_search?

f 14
p args[0]
p args[1]
...
until NULL


My hand got sore at first 100 and they are below. I will mail you the 
binary and core in seperate mail.


Cheers,

Toni


Thanks. I should've probably said until EOL.

$5 = {type = IMAP_ARG_EOL, parent = 0x0, str_len = 0, _data = {str = 
0x0, literal_size = 0, list = {arr = {buffer = 0x0, element_size = 0}, v 
= 0x0, v_modifiable = 0x0}}, literal8 = 0}


Aki


Re: 2.2.27 panic file mail-index-map.c: line 549 (mail_index_map_lookup_seq_range): assertion failed: (first_uid > 0)

2016-12-06 Thread Toni Mattila

Hi,

On 06-Dec-16 10:10, Aki Tuomi wrote:

Alternatively if you could try and print the args array in cmd_search?

f 14
p args[0]
p args[1]
...
until NULL


My hand got sore at first 100 and they are below. I will mail you the 
binary and core in seperate mail.


(gdb) f 14
#14 0x08058219 in cmd_search (cmd=0x85e1800) at cmd-search.c:42
42  ret = imap_search_args_build(cmd, args, charset, &sargs);
(gdb) p args[0]
$1 = {type = IMAP_ARG_ATOM, parent = 0x0, str_len = 3, _data = {str = 
0x85e40f8 "ALL", literal_size = 140394744, list = {arr = {buffer = 
0x85e40f8, element_size = 0}, v = 0x85e40f8, v_modifiable = 0x85e40f8}},

  literal8 = 0}
(gdb) p args[1]
$2 = {type = IMAP_ARG_ATOM, parent = 0x0, str_len = 3, _data = {str = 
0x85e4100 "NOT", literal_size = 140394752, list = {arr = {buffer = 
0x85e4100, element_size = 0}, v = 0x85e4100, v_modifiable = 0x85e4100}},

  literal8 = 0}
(gdb) p args[2]
$3 = {type = IMAP_ARG_ATOM, parent = 0x0, str_len = 3, _data = {str = 
0x85e4108 "UID", literal_size = 140394760, list = {arr = {buffer = 
0x85e4108, element_size = 0}, v = 0x85e4108, v_modifiable = 0x85e4108}},

  literal8 = 0}
(gdb) p args[3]
$4 = {type = IMAP_ARG_ATOM, parent = 0x0, str_len = 4, _data = {str = 
0x85e4110 "79:*", literal_size = 140394768, list = {arr = {buffer = 
0x85e4110, element_size = 0}, v = 0x85e4110,

  v_modifiable = 0x85e4110}}, literal8 = 0}
(gdb) p args[4]
$5 = {type = IMAP_ARG_EOL, parent = 0x0, str_len = 0, _data = {str = 
0x0, literal_size = 0, list = {arr = {buffer = 0x0, element_size = 0}, v 
= 0x0, v_modifiable = 0x0}}, literal8 = 0}

(gdb) p args[5]
$6 = {type = IMAP_ARG_NIL, parent = 0x0, str_len = 0, _data = {str = 
0x0, literal_size = 0, list = {arr = {buffer = 0x0, element_size = 0}, v 
= 0x0, v_modifiable = 0x0}}, literal8 = 0}

(gdb) p args[6]
$7 = {type = IMAP_ARG_NIL, parent = 0x0, str_len = 0, _data = {str = 
0x0, literal_size = 0, list = {arr = {buffer = 0x0, element_size = 0}, v 
= 0x0, v_modifiable = 0x0}}, literal8 = 0}

(gdb) p args[7]
$8 = {type = IMAP_ARG_NIL, parent = 0x0, str_len = 51, _data = {str = 
0x0, literal_size = 19220927837372416, list = {arr = {buffer = 0x0, 
element_size = 4475221}, v = 0x0, v_modifiable = 0x0}}, literal8 = 0}

(gdb) p args[8]
$9 = {type = 1380009299, parent = 0x4843, str_len = 5000257, _data = 
{str = 0x0, literal_size = 23731094469738496, list = {arr = {buffer = 
0x0, element_size = 5525326}, v = 0x0, v_modifiable = 0x0}},

  literal8 = 0}
(gdb) p args[9]
$10 = {type = 4475221, parent = 0x0, str_len = 708458807, _data = {str = 
0x0, literal_size = 0, list = {arr = {buffer = 0x0, element_size = 0}, v 
= 0x0, v_modifiable = 0x0}}, literal8 = 0}

(gdb) p args[10]
$11 = {type = IMAP_ARG_NIL, parent = 0x0, str_len = 0, _data = {str = 
0x0, literal_size = 0, list = {arr = {buffer = 0x0, element_size = 0}, v 
= 0x0, v_modifiable = 0x0}}, literal8 = 0}

(gdb) p args[11]
$12 = {type = IMAP_ARG_NIL, parent = 0x0, str_len = 0, _data = {str = 
0x0, literal_size = 0, list = {arr = {buffer = 0x0, element_size = 0}, v 
= 0x0, v_modifiable = 0x0}}, literal8 = 0}

(gdb) p args[12]
$13 = {type = IMAP_ARG_NIL, parent = 0x0, str_len = 0, _data = {str = 
0x0, literal_size = 0, list = {arr = {buffer = 0x0, element_size = 0}, v 
= 0x0, v_modifiable = 0x0}}, literal8 = 0}

(gdb) p args[13]
$14 = {type = IMAP_ARG_NIL, parent = 0x0, str_len = 0, _data = {str = 
0x0, literal_size = 0, list = {arr = {buffer = 0x0, element_size = 0}, v 
= 0x0, v_modifiable = 0x0}}, literal8 = 0}

(gdb) p args[14]
$15 = {type = IMAP_ARG_NIL, parent = 0x0, str_len = 0, _data = {str = 
0x0, literal_size = 0, list = {arr = {buffer = 0x0, element_size = 0}, v 
= 0x0, v_modifiable = 0x0}}, literal8 = 0}

(gdb) p args[15]
$16 = {type = IMAP_ARG_NIL, parent = 0x0, str_len = 0, _data = {str = 
0x0, literal_size = 0, list = {arr = {buffer = 0x0, element_size = 0}, v 
= 0x0, v_modifiable = 0x0}}, literal8 = 0}

(gdb) p args[16]
$17 = {type = IMAP_ARG_NIL, parent = 0x0, str_len = 0, _data = {str = 
0x0, literal_size = 0, list = {arr = {buffer = 0x0, element_size = 0}, v 
= 0x0, v_modifiable = 0x0}}, literal8 = 0}

(gdb) p args[17]
$18 = {type = IMAP_ARG_NIL, parent = 0x0, str_len = 0, _data = {str = 
0x0, literal_size = 0, list = {arr = {buffer = 0x0, element_size = 0}, v 
= 0x0, v_modifiable = 0x0}}, literal8 = 0}

(gdb) p args[18]
$19 = {type = IMAP_ARG_NIL, parent = 0x0, str_len = 0, _data = {str = 
0x0, literal_size = 0, list = {arr = {buffer = 0x0, element_size = 0}, v 
= 0x0, v_modifiable = 0x0}}, literal8 = 0}

(gdb) p args[19]
$20 = {type = IMAP_ARG_NIL, parent = 0x0, str_len = 0, _data = {str = 
0x0, literal_size = 0, list = {arr = {buffer = 0x0, element_size = 0}, v 
= 0x0, v_modifiable = 0x0}}, literal8 = 0}

(gdb) p args[20]
$21 = {type = IMAP_ARG_NIL, parent = 0x0, str_len = 0, _data = {str = 
0x0, literal_size = 0, list = {arr = {buffer = 0x0, element_size = 0}, v 
= 0x0, v_modifiable = 0x0}}, literal8 = 0}

(gdb) p args[21]
$22 = {type = IMAP_ARG_NIL, parent 

Re: 2.2.27 panic file mail-index-map.c: line 549 (mail_index_map_lookup_seq_range): assertion failed: (first_uid > 0)

2016-12-06 Thread Aki Tuomi



On 06.12.2016 10:00, Aki Tuomi wrote:



On 06.12.2016 09:32, Toni Mattila wrote:

Hi,

On 05-Dec-16 20:28, Toni Mattila wrote:

Panicing stopped when all index files where deleted.


It happens again in same user account, so rebuilding indexes didn't 
fix it.


#14 0x08058219 in cmd_search (cmd=0x85e1800) at cmd-search.c:42
ctx = 0x85e18e8
sargs = 
args = 0x85e4030
charset = 0x8070f89 "UTF-8"
ret = 

Cheers,
Toni Mattila


Hi!

Any chance to get the core file? Do you know what command was issued 
on wire?


Aki


Alternatively if you could try and print the args array in cmd_search?

f 14
p args[0]
p args[1]
...
until NULL

Aki


Re: 2.2.27 panic file mail-index-map.c: line 549 (mail_index_map_lookup_seq_range): assertion failed: (first_uid > 0)

2016-12-06 Thread Aki Tuomi



On 06.12.2016 09:32, Toni Mattila wrote:

Hi,

On 05-Dec-16 20:28, Toni Mattila wrote:

Panicing stopped when all index files where deleted.


It happens again in same user account, so rebuilding indexes didn't 
fix it.


Here's bt full instead of just bt:
#0  0x001d4402 in __kernel_vsyscall ()
No symbol table info available.
#1  0x00949d70 in raise () from /lib/i686/nosegneg/libc.so.6
No symbol table info available.
#2  0x0094b751 in abort () from /lib/i686/nosegneg/libc.so.6
No symbol table info available.
#3  0x003b7164 in default_fatal_finish (type=, 
status=0) at failures.c:201
backtrace = 0x85c0268 "/usr/lib/dovecot/libdovecot.so.0 
[0x3b716f] -> /usr/lib/dovecot/libdovecot.so.0 [0x3b71ed] -> 
/usr/lib/dovecot/libdovecot.so.0 [0x3b6e0b] -> 
/usr/lib/dovecot/libdovecot-storage.so.0(mail_index_map_loo"...
#4  0x003b71ed in i_internal_fatal_handler (ctx=0xbfe82a50, 
format=0x527fac "file %s: line %d (%s): assertion failed: (%s)", 
args=0xbfe82a74 "ƿS") at failures.c:670

status = 0
#5  0x003b6e0b in i_panic (format=0x527fac "file %s: line %d (%s): 
assertion failed: (%s)") at failures.c:275
ctx = {type = LOG_TYPE_PANIC, exit_status = 0, timestamp = 
0x0, timestamp_usecs = 0}

args = 0xbfe82a74 "ƿS"
#6  0x00504c61 in mail_index_map_lookup_seq_range (map=0x85ffe18, 
first_uid=0, last_uid=4294967295, first_seq_r=0xbfe82b64, 
last_seq_r=0xbfe82b60) at mail-index-map.c:550

__FUNCTION__ = "mail_index_map_lookup_seq_range"
#7  0x00519c2c in view_lookup_seq_range (view=0x85ffd50, first_uid=0, 
last_uid=4294967295, first_seq_r=0xbfe82b64, last_seq_r=0xbfe82b60) at 
mail-index-view.c:252

No locals.
#8  0x0051963c in mail_index_lookup_seq_range (view=0x85ffd50, 
first_uid=0, last_uid=4294967295, first_seq_r=0xbfe82b64, 
last_seq_r=0xbfe82b60) at mail-index-view.c:513

No locals.
#9  0x0047a39f in mailbox_get_seq_range (box=0x85e4418, uid1=0, 
uid2=4294967295, seq1_r=0xbfe82b64, seq2_r=0xbfe82b60) at 
mailbox-get.c:11

No locals.
#10 0x004697af in mailbox_uidset_change (args=0x8602500, 
arg=0x86025d0, change_uidsets=true, search_saved_uidset=0x85e0e7c) at 
mail-search.c:45

i = 1
seq1 = 1
seq2 = 78
#11 mail_search_arg_init (args=0x8602500, arg=0x86025d0, 
change_uidsets=true, search_saved_uidset=0x85e0e7c) at mail-search.c:72

_data_stack_cur_id = 4
thread_args = 
keywords = {0xbfe82b78 "�+�o\231F", 0x46b936 
"\204�u�\211�\204�u�\203�\020^_]�\213E\b\211�\213P\b\213@\f�\004$\001"}

__FUNCTION__ = "mail_search_arg_init"
#12 0x0046996f in mail_search_args_init (args=0x8602500, 
box=0x85e4418, change_uidsets=true, search_saved_uidset=0x85e0e7c) at 
mail-search.c:142

__FUNCTION__ = "mail_search_args_init"
#13 0x08066c91 in imap_search_args_build (cmd=0x85e1800, 
args=0x85e4030, charset=0x8070f89 "UTF-8", search_args_r=0xbfe82c18) 
at imap-search-args.c:71

parser = 0x0
sargs = 0x8602500
error = 
ret = 0
#14 0x08058219 in cmd_search (cmd=0x85e1800) at cmd-search.c:42
ctx = 0x85e18e8
sargs = 
args = 0x85e4030
charset = 0x8070f89 "UTF-8"
ret = 
#15 0x0805f2b3 in command_exec (cmd=0x85e1800) at imap-commands.c:181
hook = 0x85c89b0
finished = 
cmd_start_timeval = {tv_sec = 1481007511, tv_usec = 140244}
cmd_start_bytes_in = 29
cmd_start_bytes_out = 712
cmd_start_lock_waits = 0
__FUNCTION__ = "command_exec"
#16 0x0805d28f in client_command_input (cmd=0x85e1800) at 
imap-client.c:986

---Type  to continue, or q  to quit---
client = 0x85e0db8
command = 
__FUNCTION__ = "client_command_input"
#17 0x0805d30a in client_command_input (cmd=0x85e1800) at 
imap-client.c:1046

client = 0x85e0db8
command = 0x701e
__FUNCTION__ = "client_command_input"
#18 0x0805d515 in client_handle_next_command (client=0x85e0db8) at 
imap-client.c:1088

No locals.
#19 client_handle_input (client=0x85e0db8) at imap-client.c:1100
_data_stack_cur_id = 3
remove_io = 
handled_commands = false
__FUNCTION__ = "client_handle_input"
#20 0x0805dae1 in client_input (client=0x85e0db8) at imap-client.c:1147
cmd = 
output = 0x85e16f8
bytes = 31
__FUNCTION__ = "client_input"
#21 0x003cda88 in io_loop_call_io (io=0x85e1778) at ioloop.c:599
ioloop = 0x85c8498
t_id = 2
__FUNCTION__ = "io_loop_call_io"
#22 0x003cf62f in io_loop_handler_run_internal (ioloop=0x85c8498) at 
ioloop-epoll.c:222

ctx = 
event = 0x85ca230
list = 0x85cab10
io = 0x6
tv = {tv_sec = 1799, tv_usec = 999295}
msecs = 180
ret = 1
i = 0
j = 0
call = false
__FUNCTION__ = "io_loop_handler_run_internal"
#23 0x003cdc0f in io_loop_handler_run (ioloop=0x85c8498) at ioloop.c:648
No locals.
#24 0x003cdef8 in io_loop_run (ioloop=0x85c8498) at ioloop.c:623