New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Segfault if nm_default_url
not set
#3036
Comments
Backtrace:
|
Can you try this patch to notmuch? It might (or might not) get a more graceful error response. From 4f2d2220228f4af2d1cdc7b188b44fbbbbdcae90 Mon Sep 17 00:00:00 2001
From: David Bremner <david@tethera.net>
Date: Tue, 14 Sep 2021 13:44:41 -0300
Subject: [PATCH] lib: add additional checks for null pointer in
_n_q_ensure_parsed
---
lib/query.cc | 3 +++
1 file changed, 3 insertions(+)
diff --git a/lib/query.cc b/lib/query.cc
index 792aba21..e7a197bc 100644
--- a/lib/query.cc
+++ b/lib/query.cc
@@ -119,6 +119,9 @@ notmuch_query_create (notmuch_database_t *notmuch,
static notmuch_status_t
_notmuch_query_ensure_parsed (notmuch_query_t *query)
{
+ if (! query || ! query->query_string)
+ return NOTMUCH_STATUS_NULL_POINTER;
+
if (query->parsed)
return NOTMUCH_STATUS_SUCCESS;
--
2.33.0 |
Just a minute |
No difference |
Are you using separate email and notmuch database directories?
…On 09/14, Chinmay Dalal wrote:
Backtrace:
```
Reading symbols from /usr/bin/neomutt...
(No debugging symbols found in /usr/bin/neomutt)
[New LWP 21744]
[New LWP 21745]
[Thread debugging using libthread_db enabled]
Using host libthread_db library "/usr/lib/libthread_db.so.1".
Core was generated by `neomutt'.
Program terminated with signal SIGSEGV, Segmentation fault.
#0 0x00007fdf6bb508e7 in Xapian::QueryParser::parse_query(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const&, unsignedint, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const&) () from /usr/lib/libxapian.so.30
[Current thread is 1 (Thread 0x7fdf6b69d600 (LWP 21744))]
(gdb) backtrace
#0 0x00007fdf6bb508e7 in Xapian::QueryParser::parse_query(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const&, unsignedint, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const&) () at /usr/lib/libxapian.so.30
#1 0x00007fdf6c9c7a0e in _notmuch_query_ensure_parsed(notmuch_query_t*) (query=0x55c42871ed10) at lib/query.cc:128
#2 0x00007fdf6c9c8337 in _notmuch_query_count_documents(notmuch_query_t*, char const*, unsigned int*)
(query=0x55c42871ed10, type=0x7fdf6c9d87db "mail", count_out=0x7fffa77eb7b4) at lib/query.cc:613
#3 0x000055c4282b5e6c in ()
#4 0x000055c4282b6090 in ()
#5 0x000055c428271348 in ()
#6 0x000055c4282570d3 in ()
#7 0x000055c4282363fd in ()
#8 0x00007fdf6c725b25 in __libc_start_main () at /usr/lib/libc.so.6
#9 0x000055c428236d8e in ()
```
--
You are receiving this because you are subscribed to this thread.
Reply to this email directly or view it on GitHub:
#3036 (comment)
|
No |
I mean my notmuch database is in |
I can duplicate this with a trivial neomuttrc that looks like
Poking about briefly in gdb, it looks like the |
`git bisect` shows @jindraj fixed this in commit e2a6cfc.
@p00f: Can you see if you can reproduce this `master`? IIRC, Arch's AUR
has a neomutt-git package.
…On 09/14, Chinmay Dalal wrote:
<!--
Sorry you've found a bug, but thanks for reporting it here.
Please try to give as much information as you can.
-->
## Expected Behaviour
Set a notmuch `virtual-mailboxes`, forget to `set nm_default_url` and not have neomutt crash
## Actual Behaviour
Neomutt crashes if there is a virtual notmuch mailbox and `nm_default_url` is not set
If NeoMutt crashed, did your OS create a 'coredump' file?
Yes,
[coredump.zip](https://github.com/neomutt/neomutt/files/7163607/coredump.zip)
## Steps to Reproduce
Described above
## How often does this happen?
- Always
## When did it start to happen?
- When I upgraded
Which version did you use to use?
- When I changed my config
Can you narrow down **what** you changed?
## NeoMutt Version
```
NeoMutt 20210205
Copyright (C) 1996-2020 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.14.2-arch1-2 (x86_64)
ncurses: ncurses 6.2.20200212 (compiled with 6.2.20200212)
libidn2: 2.3.2 (compiled with 2.3.0)
GPGME: 1.15.1
GnuTLS: 3.7.0
libnotmuch: 5.3.0
storage: kyotocabinet, gdbm, bdb, lmdb
compression: lz4, zlib, zstd
Configure options: --prefix=/usr --sysconfdir=/etc --libexecdir=/usr/lib --gpgme --sqlite --autocrypt --lua --notmuch --gss --gnutls --sasl --with-ui=ncurses --with-idn2=/usr --disable-idn --idn2 --bdb --lmdb --kyotocabinet --gdbm --lz4 --zlib --zstd
Compilation CFLAGS: -march=x86-64 -mtune=generic -O2 -pipe -fno-plt -std=c99 -fno-delete-null-pointer-checks -D_ALL_SOURCE=1 -D_GNU_SOURCE=1 -D__EXTENSIONS__ -I/usr/include -I/usr/include/lua5.3 -DNCURSES_WIDECHAR -I/include -I/usr/include/
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 +regex +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: ***@***.***>
```
## Extra Info
<!-- This info might help us narrow down the source of the problem. -->
* Operating System and its version - archlinux
* Were you using multiple copies of NeoMutt at once? - no
* Were you using 'screen' or 'tmux'? - no
* Is your email local (maildir) or remote (IMAP)? - local
Config permalink - https://git.sr.ht/~p00f/dotfiles/tree/09fecccd652cc2dbd0186902969507af89fa60b9/item/neomutt/.config/neomutt/
--
You are receiving this because you are subscribed to this thread.
Reply to this email directly or view it on GitHub:
#3036
|
Yes this is fixed in master. Sorry for the noise, I should've atleast checked master given that the version in the arch repos is not even the latest release |
Expected Behaviour
Set a notmuch
virtual-mailboxes
, forget toset nm_default_url
and not have neomutt crashActual Behaviour
Neomutt crashes if there is a virtual notmuch mailbox and
nm_default_url
is not setIf NeoMutt crashed, did your OS create a 'coredump' file?
Yes,
coredump.zip
Sorry for the tarball inside zip, github won't let me upload zst
Steps to Reproduce
Described above
How often does this happen?
When did it start to happen?
When I upgraded
Which version did you use to use?
When I changed my config
Can you narrow down what you changed?
NeoMutt Version
Extra Info
Config permalink - https://git.sr.ht/~p00f/dotfiles/tree/09fecccd652cc2dbd0186902969507af89fa60b9/item/neomutt/.config/neomutt/ I'll try to remember not to force push over this 😅
The text was updated successfully, but these errors were encountered: