Neomutt: Neomutt crashes with segmentation fault when opening notmuch mailbox

Created on 1 Dec 2019  路  4Comments  路  Source: neomutt/neomutt


I'm trying to set up neomutt with mbsync and notmuch.
At the moment I run mbsync manually and afterwards a bash script manually that tags the mail.

While mbsync syncs three accounts to three different folders under ~/Mail.
The bash script looks like this:

notmuch new
notmuch tag -new +sent -- \
  tag:new and \( \
  from:my_mail_address1 or \
  from:my_mail_address2 or \
  ...
\)

My muttrc sources:

virtual-mailboxes "New" "notmuch://?query=tag:new"
virtual-mailboxes "Sent" "notmuch://?query=tag:sent"

Expected Behaviour

When switching to Sent via sidebar, all mails tagged "sent" should show in index.

Actual Behaviour

Neomutt crashes. However it does not crash if the mail from my Posteo mail account is not yet tagged by notmuch.

If NeoMutt crashed, did your OS create a 'coredump' file?

Process 889549 (neomutt) of user 1000 dumped core.
Stack trace of thread 889549:
#0  0x000056422155d10a email_free (neomutt)
#1  0x00005642214da5d1 mx_mbox_open (neomutt)
#2  0x00005642214b67ca main_change_folder (neomutt)
#3  0x00005642214b7b35 mutt_index_menu (neomutt)
#4  0x000056422148e5da main (neomutt)
#5  0x00007f726e885153 __libc_start_main (libc.so.6)
#6  0x000056422148e8de _start (neomutt)

Steps to Reproduce

  1. run mbsync with my posteo account
  2. run my bash script which tags
  3. start neomutt
  4. switch to Sent mailbox

How often does this happen?

Always

When did it start to happen?

I'm installing new.

NeoMutt Version

NeoMutt 20191129-11-ec01ad                                                                                                                                                [8/40707]
Copyright (C) 1996-2016 Michael R. Elkins and others.
NeoMutt comes with ABSOLUTELY NO WARRANTY; for details type 'neomutt -vv'.
NeoMutt is free software, and you are welcome to redistribute it
under certain conditions; type 'neomutt -vv' for details.

System: Linux 5.3.13-arch1-1 (x86_64)
ncurses: ncurses 6.1.20180127 (compiled with 6.1.20180127)
libidn2: 2.3.0 (compiled with 2.3.0)
GPGme: 1.13.1
hcache backends: kyotocabinet, gdbm, lmdb

Compiler:
Using built-in specs.
COLLECT_GCC=cc
COLLECT_LTO_WRAPPER=/usr/lib/gcc/x86_64-pc-linux-gnu/9.2.0/lto-wrapper
Target: x86_64-pc-linux-gnu
Configured with: /build/gcc/src/gcc/configure --prefix=/usr --libdir=/usr/lib --libexecdir=/usr/lib --mandir=/usr/share/man --infodir=/usr/share/info --with-bugurl=https://bugs.ar
chlinux.org/ --enable-languages=c,c++,ada,fortran,go,lto,objc,obj-c++,d --enable-shared --enable-threads=posix --with-system-zlib --with-isl --enable-__cxa_atexit --disable-libunw
ind-exceptions --enable-clocale=gnu --disable-libstdcxx-pch --disable-libssp --enable-gnu-unique-object --enable-linker-build-id --enable-lto --enable-plugin --enable-install-libi
berty --with-linker-hash-style=gnu --enable-gnu-indirect-function --enable-multilib --disable-werror --enable-checking=release --enable-default-pie --enable-default-ssp --enable-c
et=auto gdc_include_dir=/usr/include/dlang/gdc
Thread model: posix
gcc version 9.2.0 (GCC)

Configure options: --prefix=/usr --sysconfdir=/etc --libexecdir=/usr/lib --gpgme --enable-lua --notmuch --gss --ssl --sasl --with-ui=ncurses --with-idn2=/usr --idn=0 --idn2=1 --lm
db --kyotocabinet --gdbm

Compilation CFLAGS: -march=native -O2 -pipe -fstack-protector-strong --param=ssp-buffer-size=4 -g -fvar-tracking-assignments -fdebug-prefix-map=/tmp/makepkg/neomutt-git/src=/usr/s
rc/debug -std=c99 -fno-delete-null-pointer-checks -D_ALL_SOURCE=1 -D_GNU_SOURCE=1 -D__EXTENSIONS__ -I/usr/include -DNCURSES_WIDECHAR

Default options:
  +attach_headers_color +compose_to_sender +compress +cond_date +debug
  +encrypt_to_self +forgotten_attachments +forwref +ifdef +imap +index_color
  +initials +limit_current_thread +multiple_fcc +nested_if +new_mail +nntp +pop
  +progress +quasi_delete +regcomp +reply_with_xorig +sensible_browser +sidebar
  +skip_quoted +smtp +status_color +timeout +tls_sni +trash

Compile options:
  -autocrypt +bkgdset +color +curs_set +fcntl -flock -fmemopen +futimens
  +getaddrinfo -gnutls +gpgme +gss +hcache -homespool +idn +inotify
  -locales_hack +lua +meta -mixmaster +nls +notmuch +openssl +pgp +sasl +smime
  -sqlite +start_color +sun_attachment +typeahead
MAILPATH="/var/mail"
PKGDATADIR="/usr/share/neomutt"
SENDMAIL="/usr/sbin/sendmail"
SYSCONFDIR="/etc"

To learn more about NeoMutt, visit: https://neomutt.org
If you find a bug in NeoMutt, please raise an issue at:
    https://github.com/neomutt/neomutt/issues
or send an email to: <[email protected]>

Extra Info

I'm using a current Arch Linux installation.

  • Were you using multiple copies of NeoMutt at once?
    No
  • Were you using 'screen' or 'tmux'?
    tmux
  • Is your email local (maildir) or remote (IMAP)?
    It's a notmuch query
confirmed crash notmuch

All 4 comments

same here, without tmux

Seeing the same segfault, though it opens my default inbox fine and segfaults on a mailbox change to another notmuch mailbox.

@rexVictor @muradm @jan--f
Please can you give this branch a try: [devel/notmuch-crash]

Thanks.

@flatcap I am affected by the same crash and can confirm that I cannot reproduce it on your branch (I don't have the time to look at the fix/bug further). Thank you for the swift response.

PS: I found that the bug has been introduced in commit edfa04da68816891eb49fd0fb948b13de8c24be0

edfa04da68816891eb49fd0fb948b13de8c24be0
Author: Richard Russon <[email protected]>
Date:   Mon Nov 18 14:29:15 2019 +0000

    mailbox: always alloc space for Emails

    Fixes: #1972
Was this page helpful?
0 / 5 - 0 ratings