[notmuch] [PATCH] Do not segfault on empty mime parts

Carl Worth cworth at cworth.org
Tue Apr 13 08:55:01 PDT 2010


On Tue,  2 Mar 2010 16:31:28 +0100, "martin f. krafft" <madduck at madduck.net> wrote:
> notmuch previously unconditionally checked mime parts for various
> properties, but not for NULL, which is the case if libgmime encounters
> an empty mime part.

Thanks for the fix.

> Upon encounter of an empty mime part, the following is printed to
> stderr (the second line due to my patch):
> 
>   (process:17197): gmime-CRITICAL **: g_mime_message_get_mime_part: assertion `GMIME_IS_MESSAGE (message)' failed
>   Warning: Not indexing empty mime part.

That message is all quite ugly. I'm perpetually annoyed by libraries
that claim to detect major problems, (even "CRITICAL" problems!), and
just print messages and march along.

Either there *is* a critical problem here, in which case the library
should halt after printing the message, (see for example, what notmuch
does with its INTERNAL_ERROR macro), or there's no problem at all and
the code should operate correctly without these obnoxious messages.

Anyway, I've put a note into TODO that we should do the following (in
order):

  1. Add a test case to trigger this message

  2. File a bug against GMime to eliminate its portion of the message

  3. Remove the notmuch portion of the message

-Carl
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 189 bytes
Desc: not available
URL: <http://notmuchmail.org/pipermail/notmuch/attachments/20100413/5b85b352/attachment.pgp>


More information about the notmuch mailing list