From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from localhost (localhost [127.0.0.1]) by arlo.cworth.org (Postfix) with ESMTP id 62BE46DE098B for ; Fri, 1 Sep 2017 13:33:08 -0700 (PDT) X-Virus-Scanned: Debian amavisd-new at cworth.org X-Spam-Flag: NO X-Spam-Score: -0.011 X-Spam-Level: X-Spam-Status: No, score=-0.011 tagged_above=-999 required=5 tests=[AWL=0.090, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, SPF_PASS=-0.001] autolearn=disabled Received: from arlo.cworth.org ([127.0.0.1]) by localhost (arlo.cworth.org [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id StAqIct_ijxr for ; Fri, 1 Sep 2017 13:33:06 -0700 (PDT) Received: from mail.koumakan.jp (happysky.koumakan.jp [195.154.222.77]) by arlo.cworth.org (Postfix) with ESMTPS id 77D4E6DE009B for ; Fri, 1 Sep 2017 13:33:06 -0700 (PDT) Received: from localhost (unknown [10.0.0.245]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.koumakan.jp (Postfix) with ESMTPSA id 6128FB02B; Sat, 2 Sep 2017 05:33:03 +0900 (JST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=oxij.org; s=default; t=1504297984; bh=fTFqLiDWQ6kPDvusPGCHMcxxwi6QqtEyPIUVFTjDpDA=; h=From:To:Subject:In-Reply-To:References:Date; b=M9wwzgy5R7lMJzhxhp9C3TGgy2bZyzTUPDdR+GADpe+V2QgKJcuEIG/MRUn8+Ja5l 9mHBNtMNG4axK3HZKML116N1RtHv5Ba/hwpLgBrt7OTr4zQwuphM36dEGYx8oiyH0d l50lMfN1NgbNvM4RU6LyJhq1vYu764ED/4giS4pA= From: Jan Malakhovski To: David Bremner , notmuch@notmuchmail.org Subject: Re: [PATCH] cli: propagate NULL from _mime_node_create, handle it in callers. In-Reply-To: <20170901001014.7610-1-david@tethera.net> References: <87ziafam1z.fsf@oxij.org> <20170901001014.7610-1-david@tethera.net> Date: Fri, 01 Sep 2017 20:32:16 +0000 Message-ID: <87k21inorz.fsf@oxij.org> MIME-Version: 1.0 Content-Type: text/plain X-BeenThere: notmuch@notmuchmail.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "Use and development of the notmuch mail system." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 01 Sep 2017 20:33:08 -0000 Hi. David Bremner writes: > Can you check if this fixes the segfault for you? It's based on your > patch, and your followup comment. It tries to handle all of the places > mime_node_child is called. It fixes segfaults the same way my patch does, but it also suffers from the same problems. It fixes the SIGSEGV, but, as with my patch, without some more code around those NULLs `notmuch search --format=sexp --decrypt` simply produces empty bodies (`:body ()`) for suspect messages. That breaks rendering of those messages in `notmuch.el` (it fails with some exception and stops rendering the rest of the thread; which is better than rendering no messages in the thread, but still very far from ideal). This solution also doesn't print any content when it could (in case of an invalid signature). Compiling with gmime-3.0.1, on the other hand, works perfectly. It just shows that the signature is invalid and that's it, the rest of the message and the rest of the thread renders perfectly. The problem with gmime-3.0.1, as my other message still stuck in moderation shows, is that a lot of other tests fail with some silly differences in the produced JSONs. Maybe its a bug in the tests. Maybe its a problem of `gmime` from `nixpkgs` (apparently, it can't do pkcs7 and I didn't investigate why yet). I'm not sure. TBH, I would just `exit(1)` with an error like "your gmime is broken" instead of producing NULLs whet gmime produces a NULL (to be future-proof), assert non-NULL in all the other places, drop support for gmime-2.6.*, require gmime-3.*, fix the tests (or `nixpkgs`) and get happy. Cheers, Jan