From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 84007 invoked by alias); 30 Oct 2019 18:11:19 -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 83417 invoked by uid 89); 30 Oct 2019 18:11:18 -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=-2.7 required=5.0 tests=AWL,BAYES_00,SPF_PASS autolearn=ham version=3.3.1 spammy=HX-Languages-Length:1808 X-Spam-Status: No, score=-2.7 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: us-smtp-1.mimecast.com Received: from us-smtp-delivery-1.mimecast.com (HELO us-smtp-1.mimecast.com) (207.211.31.120) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with ESMTP; Wed, 30 Oct 2019 18:11:16 +0000 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1572459075; 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=3XTSP7ij29iLPyt6NNbgSbSwIt1r6x8PKy6KcfuiVMo=; b=GGxbEl4hBUittfanog6Gib36222/7FTlA/tirpE+/T8fpyYC9oxXfyPiSllxbj9Vq9CUjE lT9P+IaF1lESBcplC5YT0Lek6MRSaXSdRP2SQ4FQl709Bz4ANrjWBUEohXiLEsk2enRj79 4pBDqcpHzCuFqMzUR2T9yUL05ewBbi8= Received: from mimecast-mx01.redhat.com (mimecast-mx01.redhat.com [209.132.183.4]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-87-Ot2Qq1ikMVakBwu4ebCFtw-1; Wed, 30 Oct 2019 14:11:10 -0400 Received: from smtp.corp.redhat.com (int-mx04.intmail.prod.int.phx2.redhat.com [10.5.11.14]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id 16467800D49; Wed, 30 Oct 2019 18:11:10 +0000 (UTC) Received: from redhat.com (ovpn-116-53.phx2.redhat.com [10.3.116.53]) by smtp.corp.redhat.com (Postfix) with ESMTPS id E9C9B5DA70; Wed, 30 Oct 2019 18:11:09 +0000 (UTC) Received: from fche by redhat.com with local (Exim 4.92) (envelope-from ) id 1iPsR2-0004H5-AK; Wed, 30 Oct 2019 14:11:08 -0400 Date: Wed, 30 Oct 2019 18:11:00 -0000 From: "Frank Ch. Eigler" To: Mark Wielaard Cc: elfutils-devel@sourceware.org, amerey@redhat.com Subject: Re: patch 0/2 debuginfod submission Message-ID: <20191030181108.GB10208@redhat.com> References: <20191028190438.GC14349@redhat.com> <20191030134035.GA10208@redhat.com> <1a487a3471ea495222da5217c03e17fe17e81ae5.camel@klomp.org> MIME-Version: 1.0 In-Reply-To: <1a487a3471ea495222da5217c03e17fe17e81ae5.camel@klomp.org> User-Agent: Mutt/1.12.0 (2019-05-25) X-Scanned-By: MIMEDefang 2.79 on 10.5.11.14 X-MC-Unique: Ot2Qq1ikMVakBwu4ebCFtw-1 X-Mimecast-Spam-Score: 0 Content-Type: text/plain; charset=WINDOWS-1252 Content-Transfer-Encoding: quoted-printable Content-Disposition: inline X-IsSubscribed: yes X-SW-Source: 2019-q4/txt/msg00086.txt.bz2 Hi - > Ah, I was not thinking that far yet. I was just worried about the > dlopen/dlsym dance being done on every call. Which does its own file > search to find the library. So simply setting debuginfod_so =3D (void *) > -1; on first failure to make sure dlopen/dlsym it is never called > again. Revised code to look like this (libdwfl/find-debuginfo.c): 00404 /* NB: this is slightly thread-unsafe */ 00405 static __typeof__ (debuginfod_find_debuginfo) *fp_debuginfod_find= _debuginfo; 00406 00407 if (fp_debuginfod_find_debuginfo =3D=3D NULL) 00408 { 00409 void *debuginfod_so =3D dlopen("libdebuginfod-" VERSION ".so"= , 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, "deb= uginfod_find_debuginfo"); 00414 if (fp_debuginfod_find_debuginfo =3D=3D NULL) 00415 fp_debuginfod_find_debuginfo =3D (void *) -1; /* never try = again */ 00416 } 00417 00418 if (fp_debuginfod_find_debuginfo !=3D NULL && fp_debuginfod_find_= 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, NUL= L); 00424 } > > We document returning standard errnos generally, and a few particular > > ones for network unreachability. > > 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. Will think about it. - FChE