From: Maksim Rodin Subject: Re: doveadm index segfaults after upgrade to 7.5 To: Stuart Henderson Cc: ports@openbsd.org Date: Thu, 4 Jul 2024 12:30:50 +0300 Hello, Sorry for long delay, I hope I did everything correctly. Two files are attached with requested info. On Mon Jun 3 15:48:05 2024, Stuart Henderson wrote: > On 2024/06/03 08:08, Maksim Rodin wrote: > > I applied a patch and installed from ports: > > # pkg_info | grep xapian > > dovecot-fts-xapian-1.7.13 full text search plugin for Dovecot\ > > using Xapian > > xapian-core-1.4.24 search engine library > > > > It seems to have no effect. > > Jun 03 08:01:39 doveadm(mailbox@somedomain.org): Debug:\ > > Mailbox INBOX: UID 1048: Opened mail because: fts indexing > > Segmentation fault > > You could try getting a backtrace from a core dump. Something like this > should work: > > pkg_add gdb debug-dovecot > (if you were on snapshots rather than 7.5 I would say pkg_delete dovecot > then pkg_add dovecot debug-dovecot to make sure that you have matching > versions) > > add DEBUG_PACKAGES=${BUILD_PACKAGES} to the port and rebuild > make install INSTALL_DEBUG_PACKAGES=Yes > > egdb doveadm > set args -Dvv index -u somemailbox@somedom.com '*' > run > > bt > > To catch crashes in non-interactive indexer-worker runs, you should > be able to: > > mkdir /var/crash/indexer-worker > sysctl kern.nosuidcoredump=3 > > then when you get some .core files, > > egdb /usr/local/libexec/dovecot/indexer-worker /var/crash/indexer-worker/$pid.core > bt > > Show the backtrace here and we might be able to figure something out, > but if not then it'll probably need to go upstream > > > > > On Fri May 31 15:28:41 2024, Stuart Henderson wrote: > > > On 2024/05/31 15:44, Maksim Rodin wrote: > > > > Hello > > > > After upgrading the machine to 7.5 amd64 doveadm command used for > > > > indexing mailboxes does not work anymore: > > > > > > Does 1.7.13 work any better? Here's a ports diff. > > > > > > Index: Makefile > > > =================================================================== > > > RCS file: /cvs/ports/mail/dovecot-fts-xapian/Makefile,v > > > diff -u -p -r1.19 Makefile > > > --- Makefile 25 Feb 2024 11:36:11 -0000 1.19 > > > +++ Makefile 31 May 2024 14:28:15 -0000 > > > @@ -1,8 +1,9 @@ > > > COMMENT= full text search plugin for Dovecot using Xapian > > > > > > -DIST_TUPLE= github grosjo fts-xapian 1.7.0 . > > > - > > > -PKGNAME= dovecot-${DISTNAME} > > > +V= 1.7.13 > > > +DISTNAME= dovecot-fts-xapian-$V > > > +SITES= https://github.com/grosjo/fts-xapian/releases/download/$V/ > > > +WRKDIST= ${WRKDIR}/fts-xapian-$V > > > > > > CATEGORIES= mail > > > > > > Index: distinfo > > > =================================================================== > > > RCS file: /cvs/ports/mail/dovecot-fts-xapian/distinfo,v > > > diff -u -p -r1.10 distinfo > > > --- distinfo 25 Feb 2024 11:36:11 -0000 1.10 > > > +++ distinfo 31 May 2024 14:28:15 -0000 > > > @@ -1,2 +1,2 @@ > > > -SHA256 (grosjo-fts-xapian-1.7.0.tar.gz) = ygkBoEvgrNRIxGfCa/MWaFMbrzwlkJXjD99dc/NeS/o= > > > -SIZE (grosjo-fts-xapian-1.7.0.tar.gz) = 35121 > > > +SHA256 (dovecot-fts-xapian-1.7.13.tar.gz) = MF60UgNoctNs3MQN0aI5qKBvE7zRh9RkWeMOm5aL6S4= > > > +SIZE (dovecot-fts-xapian-1.7.13.tar.gz) = 37569 > > > > -- > > Best regards > > Maksim Rodin > > > > С уважением, > > Родин Максим > > -- Best regards Maksim Rodin С уважением, Родин Максим Reading symbols from /usr/local/libexec/dovecot/indexer-worker... Reading symbols from /usr/local/libexec/dovecot/.debug/indexer-worker.dbg... [New process 151153] Core was generated by `indexer-worker'. Program terminated with signal SIGSEGV, Segmentation fault. #0 _libc_feof (fp=0x0) at /usr/src/lib/libc/stdio/feof.c:48 48 /usr/src/lib/libc/stdio/feof.c: No such file or directory. (gdb) bt #0 _libc_feof (fp=0x0) at /usr/src/lib/libc/stdio/feof.c:48 #1 0x0000019c8052c88f in fts_backend_xapian_get_free_memory () at /usr/ports/pobj/dovecot-fts-xapian-1.7.13/fts-xapian-1.7.13/src/fts-backend-xapian-functions.cpp:939 #2 0x0000019c8052a80a in fts_backend_xapian_test_memory () at /usr/ports/pobj/dovecot-fts-xapian-1.7.13/fts-xapian-1.7.13/src/fts-backend-xapian-functions.cpp:961 #3 fts_backend_xapian_update_set_build_key (_ctx=0x19c7683c140, key=0x77d172182e10) at /usr/ports/pobj/dovecot-fts-xapian-1.7.13/fts-xapian-1.7.13/src/fts-backend-xapian.cpp:362 #4 0x0000019c1ee41453 in fts_backend_update_set_build_key (ctx=0x19c7683c140, key=0x77d172182e10) at fts-api.c:198 #5 0x0000019c1ee42875 in fts_build_mail_header (ctx=, block=) at fts-build-mail.c:160 #6 fts_build_mail_real (update_ctx=0x19c7683c140, mail=0x19c97478848, retriable_err_msg_r=, may_need_retry_r=) at fts-build-mail.c:654 #7 fts_build_mail (update_ctx=0x19c7683c140, mail=0x19c97478848) at fts-build-mail.c:703 #8 0x0000019c1ee4969e in fts_mail_index (_mail=0x19c97478848) at fts-storage.c:547 #9 fts_mail_precache (_mail=0x19c97478848) at fts-storage.c:570 #10 0x0000019c5c27c5d4 in mail_precache (mail=0x19c97478848) at mail.c:538 #11 0x00000199e3222152 in index_mailbox_precache (conn=0x19c76801300, box=0x19ccaa56448) at master-connection.c:119 #12 index_mailbox (conn=0x19c76801300, user=, mailbox=, max_recent_msgs=, what=) at master-connection.c:238 #13 master_connection_input_args (_conn=0x19c76801300, args=) at master-connection.c:284 #14 0x0000019c25224ad9 in connection_input_default (conn=0x19c76801300) at connection.c:95 #15 0x0000019c2524d8df in io_loop_call_io (io=0x19c76820360) at ioloop.c:737 #16 0x0000019c25250a44 in io_loop_handler_run_internal (ioloop=0x19c76818aa0) at ioloop-kqueue.c:164 #17 0x0000019c2524e040 in io_loop_handler_run (ioloop=0x19c76818aa0) at ioloop.c:789 #18 0x0000019c2524de48 in io_loop_run (ioloop=0x19c76818aa0) at ioloop.c:762 #19 0x0000019c251a33f9 in master_service_run (service=0x19c76833c80, callback=0x0) at master-service.c:878 #20 0x00000199e32218f2 in main (argc=1, argv=0x77d1721834a8) at indexer-worker.c:76 Program received signal SIGSEGV, Segmentation fault. _libc_feof (fp=0x0) at /usr/src/lib/libc/stdio/feof.c:48 48 /usr/src/lib/libc/stdio/feof.c: No such file or directory. (gdb) bt #0 _libc_feof (fp=0x0) at /usr/src/lib/libc/stdio/feof.c:48 #1 0x00000954365cd88f in fts_backend_xapian_get_free_memory () at /usr/ports/pobj/dovecot-fts-xapian-1.7.13/fts-xapian-1.7.13/src/fts-backend-xapian-functions.cpp:939 #2 0x00000954365cb80a in fts_backend_xapian_test_memory () at /usr/ports/pobj/dovecot-fts-xapian-1.7.13/fts-xapian-1.7.13/src/fts-backend-xapian-functions.cpp:961 #3 fts_backend_xapian_update_set_build_key (_ctx=0x9542dc74f00, key=0x6f911024f960) at /usr/ports/pobj/dovecot-fts-xapian-1.7.13/fts-xapian-1.7.13/src/fts-backend-xapian.cpp:362 #4 0x00000954324bd453 in fts_backend_update_set_build_key (ctx=0x9542dc74f00, key=0x6f911024f960) at fts-api.c:198 #5 0x00000954324be875 in fts_build_mail_header (ctx=, block=) at fts-build-mail.c:160 #6 fts_build_mail_real (update_ctx=0x9542dc74f00, mail=0x953d0fc2048, retriable_err_msg_r=, may_need_retry_r=) at fts-build-mail.c:654 #7 fts_build_mail (update_ctx=0x9542dc74f00, mail=0x953d0fc2048) at fts-build-mail.c:703 #8 0x00000954324c569e in fts_mail_index (_mail=0x953d0fc2048) at fts-storage.c:547 #9 fts_mail_precache (_mail=0x953d0fc2048) at fts-storage.c:570 #10 0x000009546d04a5d4 in mail_precache (mail=0x953d0fc2048) at mail.c:538 #11 0x00000951835ecead in cmd_index_box_precache (dctx=0x953c6a99448, box=0x95427d1b448) at doveadm-mail-index.c:79 #12 cmd_index_box (ctx=0x953c6a99448, info=) at doveadm-mail-index.c:142 #13 cmd_index_run (_ctx=0x953c6a99448, user=0x953f7501048) at doveadm-mail-index.c:214 #14 0x00000951835e7393 in doveadm_mail_next_user (ctx=0x953c6a99448, error_r=) at doveadm-mail.c:472 #15 0x00000951835e83d0 in doveadm_mail_cmd_exec (ctx=0x953c6a99448, wildcard_user=0x0) at doveadm-mail.c:667 #16 doveadm_cmd_ver2_to_mail_cmd_wrapper (cctx=0x6f911024fef0) at doveadm-mail.c:996 #17 0x00000951835fab28 in doveadm_cmd_run_ver2 (argc=4, argv=0x6f911024fff8, cctx=0x6f911024fef0) at doveadm-cmd.c:465 #18 0x00000951835fa4be in doveadm_cmd_try_run_ver2 (cmd_name=, argc=0, argv=0x0, cctx=0x6f911024fef0) at doveadm-cmd.c:363 #19 0x00000951835fe252 in main (argc=0, argv=0x0) at doveadm.c:361