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 DD5676DE10D1 for ; Sat, 27 Jul 2019 16:39:57 -0700 (PDT) X-Virus-Scanned: Debian amavisd-new at cworth.org X-Spam-Flag: NO X-Spam-Score: 0.984 X-Spam-Level: X-Spam-Status: No, score=0.984 tagged_above=-999 required=5 tests=[AWL=-1.085, DATE_IN_PAST_96_XX=2.07, 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 q2fulrTBVB1e for ; Sat, 27 Jul 2019 16:39:57 -0700 (PDT) Received: from fethera.tethera.net (fethera.tethera.net [198.245.60.197]) by arlo.cworth.org (Postfix) with ESMTPS id 53A4C6DE109D for ; Sat, 27 Jul 2019 16:39:57 -0700 (PDT) Received: from remotemail by fethera.tethera.net with local (Exim 4.89) (envelope-from ) id 1hrWI8-0001Az-Hh; Sat, 27 Jul 2019 19:39:56 -0400 Received: (nullmailer pid 17190 invoked by uid 1000); Tue, 23 Jul 2019 18:53:42 -0000 From: David Bremner To: Ralph Seichter , notmuch@notmuchmail.org Subject: Re: Bug: SIGABRT if "notmuch dump" output file is not writeable In-Reply-To: <875zns4pnm.fsf@ra.horus-it.com> References: <877e8929g8.fsf@ra.horus-it.com> <87d0i1u36h.fsf@tethera.net> <87blxlmyjf.fsf@ra.horus-it.com> <877e88u7cl.fsf@tethera.net> <875zns4pnm.fsf@ra.horus-it.com> Date: Tue, 23 Jul 2019 15:53:42 -0300 Message-ID: <87sgqwshu1.fsf@tethera.net> MIME-Version: 1.0 Content-Type: text/plain X-BeenThere: notmuch@notmuchmail.org X-Mailman-Version: 2.1.29 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: Sat, 27 Jul 2019 23:39:58 -0000 Ralph Seichter writes: > gzclose_w(output) has already been called in line 332, before Notmuch > attempts to rename the temp file to the output file. At that point, > 'output' should be set to null as it is being checked later, but that > erroneously only happens in case the close operation fails. > > The rename in line 341 fails because of permission/ownership issues, > 'ret' contains the error code for that, 'output' is still non-null, so > gzclose_w is called again -- ergo boom. That sounds plausible to me. Thanks for thinking about this longer than I did. I'll be happy to look at a patch. d