From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from gnu.wildebeest.org (gnu.wildebeest.org [45.83.234.184]) by sourceware.org (Postfix) with ESMTPS id 20A1D3858C62 for ; Thu, 8 Jun 2023 15:09:40 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org 20A1D3858C62 Authentication-Results: sourceware.org; dmarc=none (p=none dis=none) header.from=klomp.org Authentication-Results: sourceware.org; spf=pass smtp.mailfrom=klomp.org Received: from r6.localdomain (82-217-174-174.cable.dynamic.v4.ziggo.nl [82.217.174.174]) (using TLSv1.2 with cipher ADH-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by gnu.wildebeest.org (Postfix) with ESMTPSA id D7F96313ACA3; Thu, 8 Jun 2023 17:09:38 +0200 (CEST) Received: by r6.localdomain (Postfix, from userid 1000) id 5E208340276; Thu, 8 Jun 2023 17:09:38 +0200 (CEST) Message-ID: <47c3f773008dcbcc8522a3e009b572040d32dccc.camel@klomp.org> Subject: Re: [PATCHv2] gdb/debuginfod: cleanup debuginfod earlier From: Mark Wielaard To: Andrew Burgess , gdb-patches@sourceware.org Cc: Simon Marchi , Aaron Merey Date: Thu, 08 Jun 2023 17:09:38 +0200 In-Reply-To: References: <46c030dcd5fc7a1a2ef4e078a92798f18c947ace.1684840908.git.aburgess@redhat.com> Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable User-Agent: Evolution 3.48.1 (3.48.1-1.fc38) MIME-Version: 1.0 X-Spam-Status: No, score=-3028.3 required=5.0 tests=BAYES_00,JMQ_SPF_NEUTRAL,KAM_DMARC_STATUS,RCVD_IN_BARRACUDACENTRAL,SPF_HELO_NONE,SPF_PASS,TXREP,T_SCC_BODY_TEXT_LINE autolearn=no autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on server2.sourceware.org List-Id: Hi Andrew, On Thu, 2023-06-08 at 14:33 +0100, Andrew Burgess wrote: > To fix this issue we need to ensure that debuginfod_end is called > before the at_exit handlers have a chance to run. >=20 > This commit removes the debuginfod_client_up type, and instead has GDB > hold a raw pointer to the debuginfod_client object. We then make use > of GDB's make_final_cleanup to register a function that will call > debuginfod_end. >=20 > As GDB's final cleanups are called before exit is called, this means > that debuginfod_end will be called before the at_exit handlers are > called, and the crash identified above is resolved. The nice thing is that the code got simpler. > It's not obvious how this issue can easily be tested for. The bug does > not appear to manifest when using a local debuginfod server, so we'd > need to setup something more involved. For now I'm proposing this > patch without any associated tests. Agreed. This really is a somewhat obscure bug that only triggers for a legacy openssl backend in libcurl that is shutdown "too early". > Co-Authored-By: Mark Wielaard That is somewhat generous, I don't think any of what I suggested was left in this new (and better) version :) Code looks good to me. Thanks, Mark