Just updated to dovecot 2.4.1 (2.4.1-4+ubuntu24.04 (7d8c0e5759)) and the bug is still present:
dovecot[3055779]: imap(XXX)<3171980><VvLFU182LtK8wJo6>: Panic: file index-search-result.c: line 132 (index_search_result_update_flags): assertion failed: (result->search_args->args == &search_arg)
dovecot[3055779]: imap(xxx)<3171980><VvLFU182LtK8wJo6>: Error: Raw backtrace: #0 test_subprocess_fork[0x7ea83bb37a00] -> #1 backtrace_append[0x7ea83bb37cb0] -> #2 backtrace_get[0x7ea83bb37e50] -> #3 event_filter_register_cmp[0x7ea83bb42130] -> #4 i_syslog_fatal_handler[0x7ea83bb42270] -> #5 i_panic[0x7ea83ba6ed76] -> #6 [unw_get_proc_name() failed: -10] -> #7 virtual_storage_sync_init[0x7ea83bc3f240] -> #8 mailbox_sync_init[0x7ea83be78490] -> #9 mailbox_sync[0x7ea83be78560] -> #10 cmd_select_full[0x57702c1f01b0] -> #11 command_exec[0x57702c1f5660] -> #12 client_command_cancel[0x57702c1fbf20] -> #13 client_command_cancel[0x57702c1fbf20] -> #14 client_handle_input[0x57702c1fc290] -> #15 client_input[0x57702c1fc800] -> #16 io_loop_call_io[0x7ea83bb5dd60] -> #17 io_loop_handler_run_internal[0x7ea83bb5f080] -> #18 io_loop_handler_run[0x7ea83bb5f220] -> #19 io_loop_run[0x7ea83bb5f420] -> #20 master_service_run[0x7ea83bab06b0] -> #21 main[0x57702c1e6b00] -> #22 __libc_init_first[0x7ea83b62a150] -> #23 __libc_start_main[0x7ea83b62a200] -> #24 _start[0x57702c1e71f0]
dovecot[3055779]: imap(XXX)<3171980><VvLFU182LtK8wJo6>: Fatal: master: service(imap): child 3171980 killed with signal 6 (core dumped)
I also generated a core dump of the process (by systemd-coredump). Though I'm not sure if there's anything privacy related in it (ldap password maybe?) so I'm hesitant to attach it here for the mailing list.
Is there anything I can do to help debugging and fixing it? Thanks!