From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from gnu.wildebeest.org (wildebeest.demon.nl [212.238.236.112]) by sourceware.org (Postfix) with ESMTPS id F22AE385E830 for ; Mon, 9 Nov 2020 13:49:45 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.3.2 sourceware.org F22AE385E830 Authentication-Results: sourceware.org; dmarc=none (p=none dis=none) header.from=klomp.org Authentication-Results: sourceware.org; spf=pass smtp.mailfrom=mark@klomp.org Received: from tarox.wildebeest.org (tarox.wildebeest.org [172.31.17.39]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by gnu.wildebeest.org (Postfix) with ESMTPSA id 78DEF30291AB; Mon, 9 Nov 2020 14:49:43 +0100 (CET) Received: by tarox.wildebeest.org (Postfix, from userid 1000) id B248740012A4; Mon, 9 Nov 2020 14:49:43 +0100 (CET) Message-ID: <95de2e2cf1dff241f0a5ce0828b17df654d05a94.camel@klomp.org> Subject: Re: [PATCH] libdwfl: Do not dlopen libdebuginfod if DEBUGINFOD_URLS is unset or empty From: Mark Wielaard To: Vitaly Chikunov , elfutils-devel@sourceware.org Date: Mon, 09 Nov 2020 14:49:43 +0100 In-Reply-To: <20201105144452.30409-1-vt@altlinux.org> References: <20201105144452.30409-1-vt@altlinux.org> Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable X-Mailer: Evolution 3.28.5 (3.28.5-10.el7) Mime-Version: 1.0 X-Spam-Status: No, score=-5.6 required=5.0 tests=BAYES_00, JMQ_SPF_NEUTRAL, KAM_DMARC_STATUS, SPF_HELO_NONE, SPF_PASS, TXREP autolearn=no autolearn_force=no version=3.4.2 X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) 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: Mon, 09 Nov 2020 13:49:47 -0000 Hi Vitaly, On Thu, 2020-11-05 at 17:44 +0300, Vitaly Chikunov wrote: > Avoid calling expensive dlopen at the cost of an extra getenv check when > we already know it would not be needed. >=20 > This mirrors the getenv check from debuginfod_query_server. I am sympathetic to this. It would have been a nicer way to fix the valgrind issue I recently had with dlopen having unsuppressible errors on some older glibc versions. But it also makes it so that an application can never use the debuginfod support afterwards. The current debuginfod_query_server check is late enough that an application could set DEBUGINFOD_URLS just before a Dwarf lookup. What do you think? Is that a valid use case? Should we maybe introduce setting debuginfod_urls on Dwfls so that an application can explicitly indicate they want to use debuginfod lookups and then dlopen libdebuginfod late? The problem with doing the dlopen late is that we also need libcurl and initializing libcurl (as done by libdebuginfod) is not thread-safe. Cheers, Mark