I have a problem with Mutt that has been occurring since about 2019-09. Mutt crashes during authentication when I try to connect to (any, it seems) SMTP host for the first time. Unfortunately I cannot reliably trigger the erroneous behavior. It usually happens after I have rebooted this system, but after retrying a few times, mutt does not crash anymore, and from then on, the problem is gone again, until the next reboot. This is what I have done to debug it: $ env LC_ALL=C gdb --args mutt -y (gdb) run mutt: ../nptl/pthread_mutex_lock.c:433: __pthread_mutex_lock_full: Assertion `INTERNAL_SYSCALL_ERRNO (e, __err) != ESRCH || !robust' failed. Program received signal SIGABRT, Aborted. __GI_raise (sig=sig@entry=6) at ../sysdeps/unix/sysv/linux/raise.c:50 50 return ret; (gdb) t a a bt Thread 1 (Thread 0x7ffff781b740 (LWP 12881)): #0 __GI_raise (sig=sig@entry=6) at ../sysdeps/unix/sysv/linux/raise.c:50 #1 0x00007ffff7ae5535 in __GI_abort () at abort.c:79 #2 0x00007ffff7ae540f in __assert_fail_base (fmt=0x7ffff7c57640 "%s%s%s:%u: %s%sAssertion `%s' failed.\n%n", assertion=0x7ffff74cf5b0 "INTERNAL_SYSCALL_ERRNO (e, __err) != ESRCH || !robust", file=0x7ffff74cf4f5 "../nptl/pthread_mutex_lock.c", line=433, function=<optimized out>) at assert.c:92 #3 0x00007ffff7af3772 in __GI___assert_fail (assertion=assertion@entry=0x7ffff74cf5b0 "INTERNAL_SYSCALL_ERRNO (e, __err) != ESRCH || !robust", file=file@entry=0x7ffff74cf4f5 "../nptl/pthread_mutex_lock.c", line=line@entry=433, function=function@entry=0x7ffff74cf660 <__PRETTY_FUNCTION__.9715> "__pthread_mutex_lock_full") at assert.c:101 #4 0x00007ffff74c3071 in __pthread_mutex_lock_full (mutex=0x555555ce6440) at ../nptl/pthread_mutex_lock.c:433 #5 0x00007ffff7db68aa in gnutls_system_mutex_lock (priv=<optimized out>) at /usr/src/debug/net-libs/gnutls-3.6.9/gnutls-3.6.9/lib/system/threads.c:119 #6 0x00007ffff7db1a93 in _gnutls_epoch_get (session=session@entry=0x555555ce4aa0, epoch_rel=epoch_rel@entry=70001, params_out=params_out@entry=0x7fffffffa840) at /usr/src/debug/net-libs/gnutls-3.6.9/gnutls-3.6.9/lib/constate.c:906 #7 0x00007ffff7d86d44 in _gnutls_send_tlen_int (session=session@entry=0x555555ce4aa0, type=type@entry=GNUTLS_APPLICATION_DATA, htype=htype@entry=4294967295, epoch_rel=epoch_rel@entry=70001, _data=_data@entry=0x555555cf8ab0, data_size=data_size@entry=143, min_pad=0, mflags=1) at /usr/src/debug/net-libs/gnutls-3.6.9/gnutls-3.6.9/lib/record.c:443 #8 0x00007ffff7d8a070 in gnutls_record_send2 (session=0x555555ce4aa0, data=data@entry=0x555555cf8ab0, data_size=data_size@entry=143, pad=pad@entry=0, flags=flags@entry=0) at /usr/src/debug/net-libs/gnutls-3.6.9/gnutls-3.6.9/lib/record.c:2022 #9 0x00007ffff7d8a2ca in gnutls_record_send (session=<optimized out>, data=data@entry=0x555555cf8ab0, data_size=data_size@entry=143) at /usr/src/debug/net-libs/gnutls-3.6.9/gnutls-3.6.9/lib/record.c:1955 #10 0x00005555555f8689 in tls_socket_write (conn=<optimized out>, buf=0x555555cf8ab0 "a0000 AUTHENTICATE PLAIN XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX=\r\n", len=143) at mutt_ssl_gnutls.c:180 #11 0x00005555555f7b50 in mutt_socket_write_d (conn=0x5555559be500, buf=0x555555cf8ab0 "a0000 AUTHENTICATE PLAIN XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX=\r\n", len=143, len@entry=-1, dbg=dbg@entry=2) at mutt_socket.c:109 #12 0x0000555555608015 in cmd_start (cmdstr=0x555555cf86a0 "AUTHENTICATE PLAIN XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX=", flags=<optimized out>, idata=0x5555559ab180) at command.c:457 #13 cmd_start (idata=0x5555559ab180, cmdstr=0x555555cf86a0 "AUTHENTICATE PLAIN XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX=", flags=<optimized out>) at command.c:438 #14 0x0000555555612b83 in imap_auth_sasl (idata=0x5555559ab180, method=0x555555cf59b0 "IMAP4rev1 LITERAL+ SASL-IR LOGIN-REFERRALS ID ENABLE IDLE AUTH=PLAIN") at auth_sasl.c:126 #15 0x0000555555611ec0 in imap_authenticate (idata=idata@entry=0x5555559ab180) at auth.c:101 #16 0x00005555556092f1 in imap_conn_find (account=account@entry=0x7fffffffaaf0, flags=flags@entry=2) at imap.c:412 #17 0x000055555560b3af in imap_open_mailbox (ctx=0x5555559ab060) at imap.c:630 #18 0x00005555555b212e in mx_open_mailbox (path=<optimized out>, flags=0, pctx=0x0) at mx.c:716 #19 0x000055555556c081 in main (argc=<optimized out>, argv=0x7fffffffd5b8, environ=<optimized out>) at main.c:1089 (gdb) (In the backtrace above, I have of course replaced the authentication information.) My first assumption is that the failing assertion is caused by a problem in GnuTLS, and Mutt code is OK. But I am not sure. Should I report this upstream? Where (Mutt/GnuTLS/Glibc/…?) Mutt version and settings during compilation: $ env LC_ALL=C mutt -v Mutt 1.12.2 (2019-09-21, gentoo-1.12.2/r0) Copyright (C) 1996-2016 Michael R. Elkins and others. Mutt comes with ABSOLUTELY NO WARRANTY; for details type `mutt -vv'. Mutt is free software, and you are welcome to redistribute it under certain conditions; type `mutt -vv' for details. System: Linux 5.3.0-gentoo-local1 (x86_64) ncurses: ncurses 6.1.20190609 (compiled with 6.1) libidn2: 2.2.0 (compiled with 2.2.0) hcache backend: GDBM version 1.18.1. 27/10/2018 (built Jan 20 2019 21:11:32) Compiler: Using built-in specs. COLLECT_GCC=x86_64-pc-linux-gnu-gcc COLLECT_LTO_WRAPPER=/usr/libexec/gcc/x86_64-pc-linux-gnu/9.1.0/lto-wrapper Target: x86_64-pc-linux-gnu Configured with: /var/tmp/portage/sys-devel/gcc-9.1.0-r1/work/gcc-9.1.0/configure --host=x86_64-pc-linux-gnu --build=x86_64-pc-linux-gnu --prefix=/usr --bindir=/usr/x86_64-pc-linux-gnu/gcc-bin/9.1.0 --includedir=/usr/lib/gcc/x86_64-pc-linux-gnu/9.1.0/include --datadir=/usr/share/gcc-data/x86_64-pc-linux-gnu/9.1.0 --mandir=/usr/share/gcc-data/x86_64-pc-linux-gnu/9.1.0/man --infodir=/usr/share/gcc-data/x86_64-pc-linux-gnu/9.1.0/info --with-gxx-include-dir=/usr/lib/gcc/x86_64-pc-linux-gnu/9.1.0/include/g++-v9 --with-python-dir=/share/gcc-data/x86_64-pc-linux-gnu/9.1.0/python --enable-languages=c,c++ --enable-obsolete --enable-secureplt --disable-werror --with-system-zlib --enable-nls --without-included-gettext --enable-checking=release --with-bugurl=https://bugs.gentoo.org/ --with-pkgversion='Gentoo 9.1.0-r1 p1.1' --disable-esp --enable-libstdcxx-time --enable-shared --enable-threads=posix --enable-__cxa_atexit --enable-clocale=gnu --enable-multilib --with-multilib-list=m32,m64 --disable-altivec --disable-fixed-point --enable-targets=all --enable-libgomp --disable-libmudflap --disable-libssp --disable-systemtap --enable-vtable-verify --disable-libquadmath --enable-lto --with-isl --disable-isl-version-check --enable-default-pie --enable-default-ssp Thread model: posix gcc version 9.1.0 (Gentoo 9.1.0-r1 p1.1) Configure options: '--prefix=/usr' '--build=x86_64-pc-linux-gnu' '--host=x86_64-pc-linux-gnu' '--mandir=/usr/share/man' '--infodir=/usr/share/info' '--datadir=/usr/share' '--sysconfdir=/etc' '--localstatedir=/var/lib' '--disable-dependency-tracking' '--disable-silent-rules' '--docdir=/usr/share/doc/mutt-1.12.2' '--htmldir=/usr/share/doc/mutt-1.12.2/html' '--libdir=/usr/lib64' '--disable-pgp' '--disable-smime' '--enable-gpgme' '--disable-debug' '--disable-doc' '--enable-nls' '--disable-notmuch' '--enable-imap' '--disable-pop' '--disable-nntp' '--enable-smtp' '--with-gnutls' '--without-ssl' '--with-sasl' '--with-idn2' '--without-idn' '--without-gss' 'a=b' '--with-curses=/usr' '--enable-compressed' '--enable-external-dotlock' '--enable-iconv' '--enable-nfs-fix' '--enable-sidebar' '--sysconfdir=/etc/mutt' '--with-docdir=/usr/share/doc/mutt-1.12.2' '--with-regex' '--with-exec-shell=/bin/sh' '--enable-hcache' '--without-lmdb' '--without-qdbm' '--without-tokyocabinet' '--with-gdbm' '--without-bdb' '--with-mailpath=/var/spool/mail' 'build_alias=x86_64-pc-linux-gnu' 'host_alias=x86_64-pc-linux-gnu' 'CFLAGS=-march=native -O2 -pipe -ggdb2' 'LDFLAGS=-Wl,-O1 -Wl,--as-needed' Compilation CFLAGS: -Wall -pedantic -Wno-long-long -march=native -O2 -pipe -ggdb2 Compile options: -CRYPT_BACKEND_CLASSIC_PGP -CRYPT_BACKEND_CLASSIC_SMIME +CRYPT_BACKEND_GPGME -DEBUG +DL_STANDALONE +ENABLE_NLS -EXACT_ADDRESS -HOMESPOOL -LOCALES_HACK -SUN_ATTACHMENT +HAVE_BKGDSET +HAVE_COLOR +HAVE_CURS_SET +HAVE_GETADDRINFO +HAVE_GETSID +HAVE_ICONV +HAVE_LANGINFO_CODESET +HAVE_LANGINFO_YESEXPR -HAVE_LIBIDN +HAVE_LIBIDN2 +HAVE_META -HAVE_REGCOMP +HAVE_RESIZETERM +HAVE_START_COLOR +HAVE_TYPEAHEAD +HAVE_WC_FUNCS +ICONV_NONTRANS +USE_DOTLOCK +USE_FCNTL -USE_FLOCK +USE_GNU_REGEX -USE_GSS +USE_HCACHE +USE_INOTIFY +USE_IMAP -USE_NNTP -USE_POP +USE_SASL +USE_SETGID +USE_SMTP +USE_SSL_GNUTLS -USE_SSL_OPENSSL -DOMAIN -ISPELL SENDMAIL="/usr/sbin/sendmail" MAILPATH="/var/spool/mail" PKGDATADIR="/usr/share/mutt" SYSCONFDIR="/etc/mutt" EXECSHELL="/bin/sh" -MIXMASTER This release of Mutt is heavily enriched with patches. For this reason, any bugs are better reported at https://bugs.gentoo.org/ or re-emerge with USE=vanilla and try to reproduce your problem. To contact the developers, please mail to <mutt-dev@mutt.org>. To report a bug, please contact the Mutt maintainers via gitlab: https://gitlab.com/muttmua/mutt/issues patch-fg.crypt_display_signature-gentoo patch-vk.pgp_verbose_mime-gentoo patch-vvv.quote-gentoo patch-xterm-no-tigetstr-on-tty-gentoo patch-xterm-only-window-title-gentoo patch-lpr.collapse_flagged-gentoo Lukas P. Ruf <lukas.ruf@lpr.ch> patch-dont-reveal-bcc-gentoo (modified version from Debian) patch-multiple-fcc-ow patch-timeout-neomutt patch-notmuch-gentoo patch-vvv.nntp patch-limit-current-thread-gentoo patch-quasi-delete-gentoo patch-index-color-gentoo patch-status-color-gentoo patch-skip-quoted-gentoo patch-progress-gentoo patch-sidebar-on-right-neomutt patch-vvv.initials patch-ifdef-gentoo patch-allow-slow-IO-interrupt-gentoo patch-bind-enter-return-separately-gentoo Reproducible: Sometimes Steps to Reproduce: 1. Reboot computer, auto-log in to desktop. 2. Start programs that I usually start, close some windows. 3. In GNU screen session inside terminal window, in the Mutt window, select an IMAP host to connect to. Actual Results: Mutt crashes with the assertion failure as shown above, OR hangs for a long time (while connecting/authenticating). After retrying about 3 or 4 times, it works again; and from then on continues to work. Expected Results: Mutt never crashes and never hangs.