From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 126847 invoked by alias); 31 Oct 2019 11:18:15 -0000 Mailing-List: contact elfutils-devel-help@sourceware.org; run by ezmlm Precedence: bulk List-Id: List-Post: List-Help: List-Subscribe: Sender: elfutils-devel-owner@sourceware.org Received: (qmail 126836 invoked by uid 89); 31 Oct 2019 11:18:15 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Checked: by ClamAV 0.100.3 on sourceware.org X-Virus-Found: No X-Spam-SWARE-Status: No, score=-6.6 required=5.0 tests=AWL,BAYES_00,SPF_PASS autolearn=ham version=3.3.1 spammy=lists.fedorahosted.org, sk:lists.f, UD:fedorahosted.org, listsfedorahostedorg X-Spam-Status: No, score=-6.6 required=5.0 tests=AWL,BAYES_00,SPF_PASS autolearn=ham version=3.3.1 X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on sourceware.org X-Spam-Level: X-HELO: gnu.wildebeest.org Received: from wildebeest.demon.nl (HELO gnu.wildebeest.org) (212.238.236.112) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with ESMTP; Thu, 31 Oct 2019 11:18:13 +0000 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 007D6302AB34; Thu, 31 Oct 2019 12:18:10 +0100 (CET) Received: by tarox.wildebeest.org (Postfix, from userid 1000) id A97F142CED01; Thu, 31 Oct 2019 12:18:10 +0100 (CET) Message-ID: Subject: Re: patch 0/2 debuginfod submission From: Mark Wielaard To: "Frank Ch. Eigler" Cc: elfutils-devel@sourceware.org, amerey@redhat.com Date: Thu, 31 Oct 2019 11:18:00 -0000 In-Reply-To: <20191030181108.GB10208@redhat.com> References: <20191028190438.GC14349@redhat.com> <20191030134035.GA10208@redhat.com> <1a487a3471ea495222da5217c03e17fe17e81ae5.camel@klomp.org> <20191030181108.GB10208@redhat.com> Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable X-Mailer: Evolution 3.28.5 (3.28.5-5.el7) Mime-Version: 1.0 X-Spam-Flag: NO X-IsSubscribed: yes X-SW-Source: 2019-q4/txt/msg00091.txt.bz2 Hi Frank, On Wed, 2019-10-30 at 14:11 -0400, Frank Ch. Eigler wrote: > Revised code to look like this (libdwfl/find-debuginfo.c): >=20 > 00404 /* NB: this is slightly thread-unsafe */ > 00405 static __typeof__ (debuginfod_find_debuginfo) *fp_debuginfod_fi= nd_debuginfo; > 00406 > 00407 if (fp_debuginfod_find_debuginfo =3D=3D NULL) > 00408 { > 00409 void *debuginfod_so =3D dlopen("libdebuginfod-" VERSION ".s= o", RTLD_LAZY); > 00410 if (debuginfod_so =3D=3D NULL) > 00411 debuginfod_so =3D dlopen("libdebuginfod.so", RTLD_LAZY); > 00412 if (debuginfod_so !=3D NULL) > 00413 fp_debuginfod_find_debuginfo =3D dlsym (debuginfod_so, "d= ebuginfod_find_debuginfo"); > 00414 if (fp_debuginfod_find_debuginfo =3D=3D NULL) > 00415 fp_debuginfod_find_debuginfo =3D (void *) -1; /* never tr= y again */ > 00416 } > 00417 > 00418 if (fp_debuginfod_find_debuginfo !=3D NULL && fp_debuginfod_fin= d_debuginfo !=3D (void *) -1) > 00419 { > 00420 /* If all else fails and a build-id is available, query the > 00421 debuginfo-server if enabled. */ > 00422 if (fd < 0 && bits_len > 0) > 00423 fd =3D (*fp_debuginfod_find_debuginfo) (bits, bits_len, N= ULL); > 00424 } Thanks, that looks perfectly fine for now. This should also be not too hard to make thread-safe when using atomics. > > > We document returning standard errnos generally, and a few particular > > > ones for network unreachability. > >=20 > > But those aren't propagated to users for libdwfl find_elf or > > find_debuginfo. I was really just wondering if you thought about that > > in the scope of the libdwfl calls. Currently there is no real good way > > to do any error reporting there. So it isn't a big concern. But if you > > have any ideas for improvement that would be nice. >=20 > Will think about it. One idea is described here: https://lists.fedorahosted.org/pipermail/elfutils-devel/2015-May/thread.htm= l#4841 Cheers, Mark