Re: segfault in format_part_sprinter (due to gmime (mis?)parsing empty MIME part?)

Subject: Re: segfault in format_part_sprinter (due to gmime (mis?)parsing empty MIME part?)

Date: Tue, 04 Aug 2026 09:06:39 +0200

To: David Bremner

Cc: notmuch@notmuchmail.org

From: Štěpán Němec


On Mon, 27 Jul 2026 23:19:05 -0300
David Bremner wrote:

> Štěpán Němec <stepnem@smrk.net> writes:
>
>> The Subject parenthetical is obviously my uneducated
>> speculation.
>>
>> I'm getting segfaults (0.40-2 Arch Linux package) when
>> trying to 'notmuch show' the attached message (only --format
>> raw or mbox avoid the segfault).
>>
>> During 'notmuch new' inserting the message there was
>>
>> notmuch[552987]: g_mime_message_get_mime_part: assertion 'GMIME_IS_MESSAGE (message)' failed
>>
>> in the systemd journal.
>>
>
> Sorry about the long delay in replying. I don't see the segfault on
> Debian (also called 0.40-2, although I suppose the -2 is just
> coincidence).

That's strange, I can reproduce it on Debian just the same.
I did the following:

notmuch show --format=raw id:1782193672-98446-mlmmj-36f22ff2@FreeBSD.org >msg.segfault
podman run -it --rm --log-driver none -v ./msg.segfault:/root/msg debian:sid
root@4a4a4c01176e:/# apt update && apt install notmuch
[apt interaction elided]
root@4a4a4c01176e:/# notmuch
[accept all the interactive setup defaults; elided]
root@4a4a4c01176e:/# mkdir /root/mail
root@4a4a4c01176e:/# cp /root/msg /root/mail/
root@4a4a4c01176e:/# notmuch new
Found 1 total files (that's not much mail).

(process:759): gmime-CRITICAL **: 06:56:06.066: g_mime_message_get_mime_part: assertion 'GMIME_IS_MESSAGE (message)' failed
Processed 1 file in almost no time.
Added 1 new message to the database.
root@4a4a4c01176e:/# notmuch show id:1782193672-98446-mlmmj-36f22ff2@FreeBSD.org
Segmentation fault         (core dumped) notmuch show id:1782193672-98446-mlmmj-36f22ff2@FreeBSD.org
root@4a4a4c01176e:/# dpkg -l notmuch
+-- Desired=Unknown/Install/Remove/Purge/Hold
|+- Status=Not/Inst/Conf-files/Unpacked/halF-conf/Half-inst/trig-aWait/Trig-pend
||+ Err?=(none)/Reinst-required (Status,Err: uppercase=bad)
||| Name           Version      Architecture Description
+++-==============-============-============-============================================
ii  notmuch        0.40-2       amd64        thread-based email index, search and tagging
root@4a4a4c01176e:/# dpkg -l '*libgmime*'
+-- Desired=Unknown/Install/Remove/Purge/Hold
|+- Status=Not/Inst/Conf-files/Unpacked/halF-conf/Half-inst/trig-aWait/Trig-pend
||+ Err?=(none)/Reinst-required (Status,Err: uppercase=bad)
||| Name                    Version          Architecture Description
+++-=======================-================-============-=======================================
un  libgmime-3.0-0          <none>           <none>       (no description available)
ii  libgmime-3.0-0t64:amd64 3.2.15+dfsg-1+b1 amd64        MIME message parser and creator library

-- 
Štěpán
_______________________________________________
notmuch mailing list -- notmuch@notmuchmail.org
To unsubscribe send an email to notmuch-leave@notmuchmail.org

Thread: