From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail-wm1-x32c.google.com (mail-wm1-x32c.google.com [IPv6:2a00:1450:4864:20::32c]) by sourceware.org (Postfix) with ESMTPS id 6FA993858C50 for ; Tue, 29 Mar 2022 11:07:17 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.1 sourceware.org 6FA993858C50 Authentication-Results: sourceware.org; dmarc=none (p=none dis=none) header.from=dmllr.de Authentication-Results: sourceware.org; spf=none smtp.mailfrom=dmllr.de Received: by mail-wm1-x32c.google.com with SMTP id n63-20020a1c2742000000b0038d0c31db6eso1242215wmn.1 for ; Tue, 29 Mar 2022 04:07:17 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=dmllr-de.20210112.gappssmtp.com; s=20210112; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc:content-transfer-encoding; bh=ALi6I9fYA/acGDCjZhSDUctbOilB/SD9nGPdFL9LX7k=; b=cjw1o1iiQNLt8owNpiVXvgd+TdSvdbHIO7u2guaF2TRaA3PkM8Z4++PTkuiDLLDFFO XmPu17VhxKP8TY9VrE0q0jI3gcaErsIgc591qAF0YmSIj+IwZD07wXZvcQ5aL0Npa9Nu A2zovNiSat5mtV4ZfBXlu7amAIAMB2Dex5OKoBfEG3LRuPC5TVGqrJLn3W4BxPIlCfcq FkBQnoDJY6bTTT0laLbU5mXuCtCzNYIVQU65IgcyyrHOYhN3fYVdK4whUCDP/7b9PugG SJx+bm5Sh/1N+a2AAhmBoLS3bW5Hx36veD8k64EG4owKBCIl+arPYjITgR7yPY78boA2 o7Cg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc:content-transfer-encoding; bh=ALi6I9fYA/acGDCjZhSDUctbOilB/SD9nGPdFL9LX7k=; b=m6mZuOtQP2FIfFCWFUrzROPWtjgwA2onzSM0K5z/8fhSPxKYYU7nT7YKwj6XBwH1s6 zpVXO7jV4OkHnO0mLGnPaVrKe4RkVrUKihSdp/YGYnm6AKCwBKMxzddG1CxhLki8lxlZ 9JzvBtesFwOYubNDel9YkkABr3xVnHwFGmJaKnECqOCefDMRJ/YyBB0WndfIhV4HFR9B McLD4nE4R/WRSFIrvx8XfwD+jiSiYzWumIGhGb9X1Qh0N4IyE6OG0u1yth/VHyvJ9MRx oMQIapBJGyBwpN6EAFIjvV3p12dsLMD3znx2TMl5yMHPDgM0B19bEA01WEvnYpY5UA9t ySPQ== X-Gm-Message-State: AOAM531dVuK9SQjrD06TCG+jYflFC1rAqh5OGqBZjtQQePvMMTfxQGy5 zFJPkaRY+pRX3ibC4yrorbtw9lVdURxOq7VAmV96Wg== X-Google-Smtp-Source: ABdhPJxeUZtiiAR8jXnqNUT0Qunp9W1hpGAy1w9uHa/lAfwB+YjXfNkDNrFnNYSmRbldDT1txIydxjQqGsheCl50VUY= X-Received: by 2002:a05:600c:2206:b0:38c:9529:3e9 with SMTP id z6-20020a05600c220600b0038c952903e9mr5982533wml.46.1648552035807; Tue, 29 Mar 2022 04:07:15 -0700 (PDT) MIME-Version: 1.0 References: <20220328213641.8667-1-dirk@dmllr.de> In-Reply-To: From: =?UTF-8?B?RGlyayBNw7xsbGVy?= Date: Tue, 29 Mar 2022 13:06:59 +0200 Message-ID: Subject: Re: [PATCH] Avoid dlopen on debuginfod-client when not configured To: Mark Wielaard Cc: elfutils-devel@sourceware.org Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable X-Spam-Status: No, score=-1.5 required=5.0 tests=BAYES_00, DKIM_SIGNED, DKIM_VALID, RCVD_IN_DNSWL_NONE, SPF_HELO_NONE, SPF_NONE, TXREP, T_SCC_BODY_TEXT_LINE autolearn=ham autolearn_force=no version=3.4.4 X-Spam-Checker-Version: SpamAssassin 3.4.4 (2020-01-24) on server2.sourceware.org X-BeenThere: elfutils-devel@sourceware.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Elfutils-devel mailing list List-Unsubscribe: , List-Archive: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 29 Mar 2022 11:07:18 -0000 Hi Mark, Am Di., 29. M=C3=A4rz 2022 um 09:42 Uhr schrieb Mark Wielaard : > I assume this is because debuginfod-client loads and initializes > libcurl, which triggers crypto checks for https support? Yes, the dependencies of the DSO contain libcurl and other libraries including the openssl library, which, when patched with FIPS support, take quite a while to initialize. > The patch itself looks right. But I am slightly afraid this > (theoretically?) will break some programs which set DEBUGINFOD_URLS > themselves. We currently have no other way to make libdwfl use > debuginfod-client. Thoughts? I was concerned about that as well, but I couldn't google a case where this is the case. What we can also do is to do the initialization lazily upon first use rather than in a constructor function, but the intention of initializing early has been specified as avoiding issues in multiple threads with libcurl: commit fa0226a78a101d26fd80c7e9e70a5f0aa6f9d1cc Author: Mark Wielaard Date: Sun Nov 17 22:17:26 2019 +0100 debuginfod: add client context Add a mandatory debuginfod_begin()/_end() call pair to manage a client object that represents persistent but non-global state. From libdwfl, dlopen the debuginfod.so client library early on. This hopefully makes sure that the code (and the libcurl.so dependency) is loaded before the program goes into multi-threaded mode. What we can do is both, do the reinit at a later point in time if the environment variable happens to be set at that point in time. then you are risking the thread-safety issues only when there is no other way. Or just do it lazily on demand, and work through the libcurl or whatever the unsafety issue is. Greetings, Dirk