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: Mon, 27 Jul 2026 23:19:05 -0300

To: Štěpán Němec, notmuch@notmuchmail.org

Cc:

From: David Bremner


Š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). Here is the json version of the empty part.

           {
                "id": 3,
                "content-type": "message/rfc822",
                "content-disposition": "inline",
                "content": [
                  {
                    "headers": {
                      "Subject": "",
                      "From": "",
                      "Date": "Thu, 01 Jan 1970 00:00:00 +0000"
                    },
                    "body": [
                      {
                        "id": 4,
                        "content-type": "text/plain",
                        "content": ""
                      }
                    ]
                  }
                ]
              }

We're running gmime 3.2.15 and afaik so is arch. I'm not sure what else
to try, maybe try running the test suite (make test after building) and
see if there are more widespread problems with the current libraries on
arch?

We can of course put some kind of guard for the NULL pointer, but it
isn't easy to test if the NULL isn't being generated here.

d
_______________________________________________
notmuch mailing list -- notmuch@notmuchmail.org
To unsubscribe send an email to notmuch-leave@notmuchmail.org

Thread: