From: Eric Blake <eblake@redhat.com>
To: notmuch@notmuchmail.org
Subject: notmuch breaks on \. in config file with upgrade from glib2 2.76.1 to 2.76.5
Date: Wed, 6 Sep 2023 07:49:11 -0500 [thread overview]
Message-ID: <5a7paaqa2dvdo5lmnxvaeacfwhdytfnkr4gfh6mtlotdviki2s@ro4gz4m2aqsw> (raw)
Summarizing a regression bug I first reported on IRC, which I hit on
Fedora 38. These steps reproduce it without impacting anything else
you may have on your system:
$ rpm -q notmuch
notmuch-0.37-5.fc38.x86_64
$ sudo dnf downgrade -y glib2*.x86_64 glib2*.i686
<...>
$ rpm -q glib2
glib2-2.76.1-1.fc38.x86_64
glib2-2.76.1-1.fc38.i686
$ mkdir /tmp/foo
$ cd /tmp/foo
$ cat >.notmuch-config <<EOF
[database]
path=$PWD
EOF
$ yes $'\n' | NOTMUCH_notmuch --config=$PWD/.notmuch-config setup
<...>
$ notmuch --config=$PWD/.notmuch-config new
Found 1 total files (that's not much mail).
Note: Ignoring non-mail file: /tmp/foo/.notmuch-config
Processed 1 file in almost no time.
No new mail.
$ notmuch --config=$PWD/.notmuch-config config set query.q1 'from:/.*\.example\.org/'
$ printf 'q2=from:"/.*\\.example\\.org/"\n' >> .notmuch-config
$ tail -n3 .notmuch-config
[query]
q1=from:/.*\\.example\\.org/
q2=from:"/.*\.example\.org/"
$ notmuch --config=$PWD/.notmuch-config config get query.q1
from:/.*\.example\.org/
$ notmuch --config=$PWD/.notmuch-config config get query.q2
from:"/.*\.example\.org/"
$ notmuch --config=$PWD/.notmuch-config count
0
$ sudo dnf upgrade -y
$ rpm -q glib2
glib2-2.76.5-1.fc38.x86_64
glib2-2.76.5-1.fc38.i686
$ notmuch --config=$PWD/.notmuch-config config list
$ echo $?
0
$ notmuch --config=$PWD/.notmuch-config count
$ echo $?
1
Yikes - any configuration I wrote using 'notmuch config set' is stored
by older glib in a way that newer glib can still read. But any
configuration that I manually added directly into the config file
might contain data that older glib can parse but newer glib rejects.
In this particular case, it looks like older glib happily treats "\."
as a string with two literal characters, while newer glib is trying to
treat it as an escape sequence and failing. This failure is then
poorly handled by notmuch, which has knock-on odd effects ('config
list' producing no output but exiting successfully!, 'count' producing
no output but giving no error message why, etc.).
Last night, I filed
https://bugzilla.redhat.com/show_bug.cgi?id=2237562. Later, I found
this about glib 2.77 introducing regressions:
https://bugzilla.redhat.com/show_bug.cgi?id=2225257; looks like Fedora
backported enough of that into 2.76.5 to cause similar issues in
relation to 2.76.1, even though a patchlevel release of glib shouldn't
be changing behaviors.
I presume that 'notmuch config set' should be the preferred way to
modify the config file - but since it IS a human-readable file,
notmuch should do a much better job of reporting errors whenever
glib's gkeyfile API cannot parse the file (even if that failure to
parse is caused by an unintended regression in glib behavior for
rejecting something it used to accept).
--
Eric Blake, Principal Software Engineer
Red Hat, Inc.
Virtualization: qemu.org | libguestfs.org
next reply other threads:[~2023-09-06 14:03 UTC|newest]
Thread overview: 9+ messages / expand[flat|nested] mbox.gz Atom feed top
2023-09-06 12:49 Eric Blake [this message]
2023-09-06 14:37 ` notmuch breaks on \. in config file with upgrade from glib2 2.76.1 to 2.76.5 Michael J Gruber
2023-09-06 15:42 ` Eric Blake
2023-09-06 15:26 ` [PATCH] config: Inform user if config file is broken Eric Blake
2023-09-06 15:48 ` David Bremner
2023-09-06 16:11 ` Eric Blake
2023-09-10 0:37 ` notmuch breaks on \. in config file with upgrade from glib2 2.76.1 to 2.76.5 David Bremner
2023-09-10 11:58 ` David Bremner
2023-09-11 15:06 ` Eric Blake
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
List information: https://notmuchmail.org/
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=5a7paaqa2dvdo5lmnxvaeacfwhdytfnkr4gfh6mtlotdviki2s@ro4gz4m2aqsw \
--to=eblake@redhat.com \
--cc=notmuch@notmuchmail.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
Code repositories for project(s) associated with this public inbox
https://yhetil.org/notmuch.git/
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).