From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.133.124]) by sourceware.org (Postfix) with ESMTPS id 08AFB3858D39 for ; Wed, 24 May 2023 14:33:25 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org 08AFB3858D39 Authentication-Results: sourceware.org; dmarc=pass (p=none dis=none) header.from=redhat.com Authentication-Results: sourceware.org; spf=pass smtp.mailfrom=redhat.com DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1684938804; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=rE7tcahOkLfY7ezGdD1rUVUjvp31rhQwEIxy8YM6HdE=; b=S7zadDM5SDBxwqyDzB1d2Ht44NRtCk8/i1simLP0L2Hsv4tprNG6LBFaZvcXBJS0EZnTZL ti2vVT8BINZABy+lGblueIAsDy0bCVNNARCO1b+4+vBExhsiKwLI96xB0fER73oqd0BEor HnckqAzJaUsY2Jvtbh1eTaO4u1UWtn0= Received: from mail-wm1-f72.google.com (mail-wm1-f72.google.com [209.85.128.72]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-528-UENRvQvLOsmnb_RBCew0xw-1; Wed, 24 May 2023 10:33:16 -0400 X-MC-Unique: UENRvQvLOsmnb_RBCew0xw-1 Received: by mail-wm1-f72.google.com with SMTP id 5b1f17b1804b1-3f6089a9689so6813225e9.1 for ; Wed, 24 May 2023 07:33:15 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1684938795; x=1687530795; h=content-transfer-encoding:mime-version:message-id:date:references :in-reply-to:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=rE7tcahOkLfY7ezGdD1rUVUjvp31rhQwEIxy8YM6HdE=; b=E98TuQ80C+EZHWCgYeZuDFggrbypox+i71VnXcOEayN7j+eupzAlqziteREBii5ONz touS4k7s8QtNvhcIJcEJkOsUDRoiW6eOUdJkCSYOlE1/h4tWHL9LZMwqwdlqNvKMR2qj bsXVlxGhq9cd+BlVCeyh84fDgH5xvqY0GJ0PuKDJLB3hMc3CbWqzapISGz20UYgbj1o2 RCKDq3Jc1pQwW4gXliewUxyGvjeBKi8X/VacdnS3yfxhBqC95ED6oYnNY93YET0oUqWO I6bPx9Ni8KhtlXH+8e0/g/xfLYZqOBJ5sauXJu92ilIluC3s2bXlNh85pyhEpP+dtyOq jjNg== X-Gm-Message-State: AC+VfDzRbMNeSJ8MXqShzsmM+jLaI7m/NRQxK0kzsX9Xmn+wDWx/KM1h ibs3wGB7/1VxnGJXtkVDp3QgZzD3muL6Dvi2ABN7GMgI9n5ofXKuqE6IKCDvI4t/I+bU86emwKJ 1csMPqtN8/5wX1lZVhWKGhQ== X-Received: by 2002:a5d:54c4:0:b0:2f6:208d:2234 with SMTP id x4-20020a5d54c4000000b002f6208d2234mr33343wrv.2.1684938794936; Wed, 24 May 2023 07:33:14 -0700 (PDT) X-Google-Smtp-Source: ACHHUZ6ebnVZgqeN0mVcmsu+e/DhhaB34HQW2ZGuBxN/f9XzhwjPPEFKo0H4kDmH+XnOEkvHm90GZA== X-Received: by 2002:a5d:54c4:0:b0:2f6:208d:2234 with SMTP id x4-20020a5d54c4000000b002f6208d2234mr33330wrv.2.1684938794626; Wed, 24 May 2023 07:33:14 -0700 (PDT) Received: from localhost (11.72.115.87.dyn.plus.net. [87.115.72.11]) by smtp.gmail.com with ESMTPSA id f12-20020a5d58ec000000b00309257ad16csm14719847wrd.29.2023.05.24.07.33.13 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 24 May 2023 07:33:14 -0700 (PDT) From: Andrew Burgess To: Aaron Merey Cc: gdb-patches@sourceware.org, Mark Wielaard Subject: Re: [PATCH] gdb/debuginfod: cleanup debuginfod earlier In-Reply-To: References: <46c030dcd5fc7a1a2ef4e078a92798f18c947ace.1684840908.git.aburgess@redhat.com> Date: Wed, 24 May 2023 15:33:11 +0100 Message-ID: <875y8h7qag.fsf@redhat.com> MIME-Version: 1.0 X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable X-Spam-Status: No, score=-5.7 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH,DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_NONE,RCVD_IN_MSPIKE_H2,SPF_HELO_NONE,SPF_NONE,TXREP,T_SCC_BODY_TEXT_LINE autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on server2.sourceware.org List-Id: Aaron Merey writes: > On Tue, May 23, 2023 at 7:23=E2=80=AFAM Andrew Burgess wrote: >> >> And then a global debuginfod_client_up is created to hold a pointer to >> the debuginfod_client object. As a global this will be cleaned up >> using the standard C++ global object destructor mechanism, which is >> run after the at_exit handlers. >> >> However, it is expected that when debuginfod_end is called the >> debuginfod_client object will still be in a usable state, that is, we >> don't expect the at_exit handlers to have run and started cleaning up >> the library state. > > The crash comes down to curl_multi_cleanup triggering a double free > when it's called during process exit. Ideally this should be fixed in > libcurl or at least the libcurl docs should mention that curl_multi_clean= up > shouldn't be called at exit. > > But it's still a good idea to add this workaround to gdb. It's only a workaround if libcurl doesn't just update their docs to say don't call curl_multi_cleanup at exit! If they do that then debuginfod needs to update its docs to say don't call debuginfod_end at exit ... and then we're back here, right? > Thanks for loo= king > into this. I tested Simon's patch since it's a bit simpler and it fixes t= he > crash for me on F37. Excellent, I'll add a commit message to Simon's version and repost it. Thanks, Andrew > >> There's no test associated with this patch. I have no idea how I >> might trigger this bug from within the testsuite. If anyone has any >> ideas then I'm happy to have a go at writing something. > > gdb's debuginfod tests only pull files from local servers. This crash > does not reproduce when using a localhost URL. To test for this > gdb would have to download from a remote server and maybe > use the OPENSSL_CONF environment variable to set a custom > config file path. However this might cause more problems than it > solves. > > Aaron