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 222806DE0A7F for ; Tue, 17 Oct 2017 17:39:32 -0700 (PDT) X-Virus-Scanned: Debian amavisd-new at cworth.org X-Spam-Flag: NO X-Spam-Score: 0 X-Spam-Level: X-Spam-Status: No, score=0 tagged_above=-999 required=5 tests=[AWL=0.011, SPF_PASS=-0.001, T_RP_MATCHES_RCVD=-0.01] 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 UQ5Bn5v-ehV4 for ; Tue, 17 Oct 2017 17:39:31 -0700 (PDT) Received: from fethera.tethera.net (fethera.tethera.net [198.245.60.197]) by arlo.cworth.org (Postfix) with ESMTPS id 19A836DE0A6C for ; Tue, 17 Oct 2017 17:39:30 -0700 (PDT) Received: from remotemail by fethera.tethera.net with local (Exim 4.89) (envelope-from ) id 1e4cKb-0001VV-29; Tue, 17 Oct 2017 20:35:33 -0400 Received: (nullmailer pid 29961 invoked by uid 1000); Wed, 18 Oct 2017 00:39:27 -0000 From: David Bremner To: Jani Nikula , notmuch@notmuchmail.org Subject: Re: [PATCH] cli/crypto: fix segfault on failed gmime2 crypto context creation In-Reply-To: <20171016154044.14564-1-jani@nikula.org> References: <20171016154044.14564-1-jani@nikula.org> Date: Tue, 17 Oct 2017 21:39:27 -0300 Message-ID: <87tvyxi91c.fsf@tethera.net> 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: Wed, 18 Oct 2017 00:39:32 -0000 Jani Nikula writes: > > So while the right thing to do would be to handle NULL returns > properly all over the place, and we have other scenarios that do > return NULL from above mentioned functions, the crypto context > creation failure is something that does seem to show up regularly in > some scenarios, revert back to the functionality before commit > 1fdc08d0ffab as an interim fix. I'm not sure how interim this is. Are we ready to deprecate gmime-2.6 in the next release? As you mention, even if this particular NULL return goes away, the code is still somehow broken in terms of checking for NULL returns from _mime_node_create (and propagating / handling them). I previously wrote a patch that did that work [1], but this turns out to be not so helpful, since we arrive at the formatted output with a NULL pointer. It occurred to me that we could add an error code and/or string to the mime-node structure, and then never return NULL from _mime_node_create except for OOM. Then we could actually report useful errors in the structured output [2]. If that seems like a reasonable plan, then I guess I could live with this interim fix to get master working for people again. Is this an important important enough issue that we should think about a point release? [1] id:20170901001014.7610-1-david@tethera.net [2] the notion of reporting errors on stderr for the CLI makes much less sense for the structured output case