It turns out the imap process is crashing later with SEGV, when regenerating an acl cache:
$ gdb /usr/lib/dovecot/imap temp/core.imap.38173 GNU gdb (Debian 16.3-1) 16.3 ...
Core was generated by `/usr/lib/dovecot/imap'. Program terminated with signal SIGSEGV, Segmentation fault. #0 0x00007f4786f27c83 in array_count_i (array=<optimized out>) at ../lib/array.h:199
warning: 199 ../lib/array.h: Datei oder Verzeichnis nicht gefunden (gdb) where #0 0x00007f4786f27c83 in array_count_i (array=<optimized out>) at ../lib/array.h:199 #1 array_bsearch_i (array=0x5569b1452738, key=0x5569b146c1a0, cmp=0x7f4786f6dfd0 <search_strcmp>) at ../lib/array.c:147 #2 0x00007f478706b02c in acl_backend_user_is_in_group (backend=<optimized out>, group_name=<optimized out>) at ./src/plugins/acl/acl-backend.c:158 #3 0x00007f478706c5a0 in acl_object_rebuild_cache (aclobj=aclobj@entry=0x5569b145f3d0) at ./src/plugins/acl/acl-api.c:338 #4 0x00007f478707341a in acl_backend_vfile_object_refresh_cache (_aclobj=0x5569b145f3d0) at ./src/plugins/acl/acl-backend-vfile.c:513 #5 0x00007f478706ceba in acl_object_have_right (aclobj=0x5569b145f3d0, right_idx=0) at ./src/plugins/acl/acl-api.c:42 #6 0x00007f478706ee3a in acl_mailbox_list_have_right (list=0x5569b1458db8, name=0x5569b1343080 "INBOX", parent=parent@entry=false, acl_storage_right_idx=acl_storage_right_idx@entry=0) at ./src/plugins/acl/acl-mailbox-list.c:71 #7 0x00007f478706f544 in acl_mailbox_list_info_is_visible (_ctx=<optimized out>) at ./src/plugins/acl/acl-mailbox-list.c:364 #8 acl_mailbox_list_iter_next (_ctx=0x5569b14adec8) at ./src/plugins/acl/acl-mailbox-list.c:468 #9 0x00007f47872e8e44 in mailbox_list_iter_next_call (ctx=0x5569b14adec8) at list/mailbox-list-iter.c:1009 #10 mailbox_list_iter_next (ctx=0x5569b14adec8) at list/mailbox-list-iter.c:1098 #11 0x00007f4787074565 in acl_shared_namespace_add (ns=0x5569b138e960, storage=<optimized out>, userdomain=0x5569b13fd6f0 "someotheruser") at ./src/plugins/acl/acl-shared-storage.c:60 #12 acl_shared_namespaces_add (ns=0x5569b138e960) at ./src/plugins/acl/acl-shared-storage.c:92 #13 0x00007f47870746c6 in acl_mailbox_list_iter_init_shared (list=0x5569b13976d8, patterns=0x5569b149f3c8, flags=MAILBOX_LIST_ITER_RETURN_SPECIALUSE) at ./src/plugins/acl/acl-mailbox-list.c:152 #14 0x00007f47872e83ce in mailbox_list_iter_init_multiple (list=0x5569b13976d8, patterns=<optimized out>, flags=MAILBOX_LIST_ITER_RETURN_SPECIALUSE) at list/mailbox-list-iter.c:159 #15 0x00007f47872e9e2c in mailbox_list_ns_iter_try_next (_ctx=0x5569b149f0f8, info_r=<synthetic pointer>) at list/mailbox-list-iter.c:603 #16 mailbox_list_ns_iter_next (_ctx=0x5569b149f0f8) at list/mailbox-list-iter.c:678 #17 0x00007f47872e8e44 in mailbox_list_iter_next_call (ctx=0x5569b149f0f8) at list/mailbox-list-iter.c:1009 #18 mailbox_list_iter_next (ctx=0x5569b149f0f8) at list/mailbox-list-iter.c:1098 #19 0x000055697bc15b29 in cmd_list_continue (cmd=cmd@entry=0x5569b1389ef8) at ./src/imap/cmd-list.c:277 #20 0x000055697bc16548 in cmd_list_full (cmd=<optimized out>, lsub=<optimized out>) at ./src/imap/cmd-list.c:536 #21 0x000055697bc1d124 in command_exec (cmd=cmd@entry=0x5569b1389ef8) at ./src/imap/imap-commands.c:208 #22 0x000055697bc23650 in client_command_input (cmd=<optimized out>, cmd@entry=0x5569b1389ef8) at ./src/imap/imap-client.c:1271 #23 0x000055697bc236e6 in client_command_input (cmd=<optimized out>) at ./src/imap/imap-client.c:1341 #24 0x000055697bc23b55 in client_handle_next_command (client=0x5569b1388ac8, remove_io_r=<synthetic pointer>) at ./src/imap/imap-client.c:1383 #25 client_handle_input (client=client@entry=0x5569b1388ac8) at ./src/imap/imap-client.c:1397 #26 0x000055697bc23f47 in client_input (client=0x5569b1388ac8) at ./src/imap/imap-client.c:1441 #27 0x00007f4786f5177b in io_loop_call_io (io=0x5569b1467d20) at ../lib/ioloop.c:743 #28 0x00007f4786f535ea in io_loop_handler_run_internal (ioloop=ioloop@entry=0x5569b134b4e0) at ../lib/ioloop-epoll.c:222 #29 0x00007f4786f53694 in io_loop_handler_run (ioloop=ioloop@entry=0x5569b134b4e0) at ../lib/ioloop.c:795 #30 0x00007f4786f53868 in io_loop_run (ioloop=0x5569b134b4e0) at ../lib/ioloop.c:768 #31 0x00007f4786ea6347 in master_service_run (service=0x5569b134ac40, callback=callback@entry=0x55697bc28090 <client_connected>) at ../lib-master/master-service.c:1210 #32 0x000055697bc0ee27 in main (argc=<optimized out>, argv=<optimized out>) at ./src/imap/main.c:601 ...
(gdb) up #3 0x00007f478706c5a0 in acl_object_rebuild_cache (aclobj=aclobj@entry=0x5569b145f3d0) at ./src/plugins/acl/acl-api.c:338 (gdb) print *aclobj->backend->set $7 = {pool = 0x5569b14526c8, acl_user = 0x5569b1457f58 "", acl_groups = {arr = {buffer = 0x0, element_size = 0}, v = 0x0, v_modifiable = 0x0}, acl_rights = {arr = {buffer = 0x0, element_size = 0}, v = 0x0, v_modifiable = 0x0}, acl_driver = 0x7f4787081ffa <error: Cannot access memory at address 0x7f4787081ffa>, acl_global_path = 0x7f4787075600 "", acl_cache_ttl = 30, acl_globals_only = false, acl_defaults_from_inbox = false, acl_ignore = false} (gdb) print *aclobj->backend $8 = {pool = 0x5569b1451a50, set = 0x5569b1452728, username = 0x5569b13827e8 "someuser", event = 0x5569b1457768, list = 0x5569b1458db8, cache = 0x5569b1453570, global_file = 0x0, default_aclobj = 0x5569b1462a10, default_aclmask = 0x5569b1451b28, default_rights = 0x7f4787076310 <non_owner_mailbox_rights>, v = 0x7f478707b500 <acl_backend_vfile>, owner = false}