[Dovecot] Segfault problem when using TWO dovecot servers!
Forgive me if this gets submitted twice. I had issues signing up for the listserv but I think I'm strait now.
Hi all, I just started working with Dovecot and I'd like to use it for my organization, but I've run into a little problem. So far I love it and it does what I need. One thing we need is to be able to write to multiple mailbox formats on a per user basis (mbox or Maildir), and it does just that. I want users to be able to choose their format, and I can let it autodetect for me. The way I do that is I have Maildrop filters check for the presence of a ~Maildir, and if it finds that it writes to it, otherwise it writes to ~mbox. Dovecot is the only IMAP server I've found to read either or without hard coding one or the other in the config file.
The problem: We also want failover. Mail/home directories are NFS mounted. I was planning to setup two dovecot servers, and noticed that whenever one server writes its temp files to the mail directory, if another server tries to read it you get a segfault and the child process fails and dies. So it basically looks like only one server can own the files, and it won't share. I considered trying to set the INDEX option on the mail boxes to write local indexes, but if I try to specify something like: default_mail_env = INDEX=/var/indexes/%d/%n, it doesn't work. Sure I can make it work by putting in a mailbox format before the INDEX, but then I can't use the autodetect which I need.
Here's the syslog error:
kernel: imap[13689]: segfault at 00007fffffe38000 rip 00002aaaaad3823f rsp 00007fffffe351f0 error 4
Any solutions? I really need this to work badly, or we may have to rethink our entire mail strategy. I'm also using the latest version 1.0beta3.
I considered namespaces, but correct me if I'm wrong, you can't setup two namespaces and have it pick the first mailbox format available like the autodetect feature does. I tried seting up namespaces for both mbox and Maildir, but it just creates both.
Please help someone. I need a solution to present to my boss, even if that means we have to run one server until the bug is fixed in the next version.
Thanks, Adam
On Mar 9, 2006, at 11:15 PM, Adam M. Dunn wrote:
We also want failover. Mail/home directories are NFS mounted. I was planning to setup two dovecot servers, and noticed that whenever one server writes its temp files to the mail directory, if another server tries to read it you get a segfault and the child process fails and
dies. So it basically looks like only one server can own the files, and
it won't share. I considered trying to set the INDEX option on the mail
boxes to write local indexes, but if I try to specify something like: default_mail_env = INDEX=/var/indexes/%d/%n, it doesn't work. Sure
I can make it work by putting in a mailbox format before the INDEX, but
then I can't use the autodetect which I need.
There's currently no way to setup autodetection + indexes elsewhere.
You could somewhat easily modify the sources though (lib-storage/
index/*/*-storage.c *_create()).
But if you take the latest nightly Dovecot snapshot, it should work
pretty well with indexes in NFS also, as long as you set
mmap_disable=yes and change lock_method.
As for the segfault, it shouldn't really be doing that, but you'd
need to give gdb backtrace for me to figure out why it happens, see
http://dovecot.org/bugreport.html
On Thu, 9 Mar 2006, Timo Sirainen wrote:
As for the segfault, it shouldn't really be doing that, but you'd
need to give gdb backtrace for me to figure out why it happens, see
http://dovecot.org/bugreport.html
Version: 1.0.beta3 OS: Linux, SuSE 10 2.6.13-15-smp /x86_64
I get this Seg Fault when a different Dovecot server reads a user's Maildir directory after another Dovecot server creates temp files in it. Basically, it seems like two servers don't like reading each other's temp files. If I delete the files manually each time, everything works fine.
Core was generated by `imap'. Program terminated with signal 11, Segmentation fault. Reading symbols from /lib64/libdl.so.2...done. Loaded symbols for /lib64/libdl.so.2 Reading symbols from /lib64/tls/libc.so.6...done. Loaded symbols for /lib64/tls/libc.so.6 Reading symbols from /lib64/ld-linux-x86-64.so.2...done. Loaded symbols for /lib64/ld-linux-x86-64.so.2 #0 0x00002aaaaad3823f in memcpy () from /lib64/tls/libc.so.6 (gdb) bt full #0 0x00002aaaaad3823f in memcpy () from /lib64/tls/libc.so.6 No symbol table info available. #1 0x00000000005a6090 in ?? () No symbol table info available. #2 0x0000000000445abc in mail_index_map (index=0x5a4950, force=<value optimized out>) at mail-index.c:714 map = (struct mail_index_map *) 0x5a5f40 ret = 5917008 __PRETTY_FUNCTION__ = "mail_index_map" #3 0x00000000004464ad in mail_index_try_open (index=0x5a4950, lock_id_r=0x7fffffe5023c) at mail-index.c:1204 lock_id = <value optimized out> ret = 1 #4 0x0000000000446642 in mail_index_open (index=0x5a4950, flags=5, lock_method=MAIL_INDEX_LOCK_DOTLOCK) at mail-index.c:1391 i = 0 ret = 5 #5 0x000000000043e926 in index_storage_mailbox_init (ibox=0x5a5b70, index=0x5a4950, name=<value optimized out>, flags=<value optimized out>, move_to_memory=false) at index-storage.c:360 storage = (struct mail_storage *) 0x59ddb0 index_flags = 5 lock_method = MAIL_INDEX_LOCK_DOTLOCK ret = 5922960 __PRETTY_FUNCTION__ = "index_storage_mailbox_init" #6 0x000000000041e9c1 in maildir_open (storage=0x59ddb0, name=0x59e8b0 "Sent Items", flags=0) at maildir-storage.c:444 istorage = <value optimized out> mbox = (struct maildir_mailbox *) 0x5a5b70 index = (struct mail_index *) 0x5a4950 path = 0x594288 "/users/adunn/Maildir/.Sent Items" index_dir = <value optimized out> control_dir = 0x5942d8 "/users/adunn/Maildir/.Sent Items" st = {st_dev = 432, st_ino = 0, st_nlink = 512, st_mode = 32768, st_uid = 0, st_gid = 2, pad0 = 0, st_rdev = 1141945065, st_size = 176186000, st_blksize = 1141862340, st_blocks = 603596000, st_atim = {tv_sec = 1141945065, tv_nsec = 174278000}, st_mtim = {tv_sec = 0, tv_nsec = 0}, st_ctim = {tv_sec = 0, tv_nsec = 5849696}, __unused = {5843568, 5849576, 140737486589814}} shared = 0 pool = 0x5a5b10 #7 0x000000000041ec43 in maildir_mailbox_open (_storage=0x59ddb0, name=0x59e8b0 "Sent Items", input=<value optimized out>, flags=0) at maildir-storage.c:508 storage = <value optimized out> istorage = <value optimized out> path = 0x5941e8 "/users/adunn/Maildir/.Sent Items" st = {st_dev = 21, st_ino = 2104, st_nlink = 5, st_mode = 16832, st_uid = 14538, st_gid = 432, pad0 = 0, st_rdev = 0, st_size = 512, st_blksize = 32768, st_blocks = 2, st_atim = {tv_sec = 1141945065, tv_nsec = 126409000}, st_mtim = {tv_sec = 1141862340, tv_nsec = 748524000}, st_ctim = {tv_sec = 1141945065, tv_nsec = 124664000}, __unused = {0, 0, 0}} #8 0x0000000000413dfa in _cmd_select_full (cmd=0x59e3c8, readonly=false) at cmd-select.c:32 client = (struct client *) 0x59e350 storage = (struct mail_storage *) 0x59ddb0 box = (struct mailbox *) 0x59cba0 status = {messages = 5900192, recent = 0, unseen = 5887248, uidvalidity = 0, uidnext = 5900192, first_unseen_seq = 0, keywords = 0x59e350} mailbox = 0x59e8b0 "Sent Items" #9 0x0000000000413f9b in cmd_select (cmd=<value optimized out>) at cmd-select.c:92 No locals. #10 0x000000000041589a in _client_input (context=<value optimized out>) at client.c:364 client = (struct client *) 0x59e350 cmd = (struct client_command_context *) 0x59e3c8 #11 0x0000000000468fc3 in io_loop_handler_run (ioloop=0x59cb50) at ioloop-poll.c:203 ctx = (struct ioloop_handler_context *) 0x59cba0 pollfd = <value optimized out> tv = {tv_sec = 9, tv_usec = 986755} ---Type <return> to continue, or q <return> to quit--- io = (struct io *) 0x59e650 t_id = 2 msecs = <value optimized out> ret = 0 call = <value optimized out> #12 0x00000000004684dd in io_loop_run (ioloop=0x59cb50) at ioloop.c:246 No locals. #13 0x000000000041ce34 in main (argc=<value optimized out>, argv=0x0, envp=0x592840) at main.c:238 No locals. (gdb)
participants (2)
-
Adam M. Dunn
-
Timo Sirainen