From owner-freebsd-bugs Fri Mar 28 07:30:04 1997 Return-Path: Received: (from root@localhost) by freefall.freebsd.org (8.8.5/8.8.5) id HAA15438 for bugs-outgoing; Fri, 28 Mar 1997 07:30:04 -0800 (PST) Received: (from gnats@localhost) by freefall.freebsd.org (8.8.5/8.8.5) id HAA15430; Fri, 28 Mar 1997 07:30:02 -0800 (PST) Resent-Date: Fri, 28 Mar 1997 07:30:02 -0800 (PST) Resent-Message-Id: <199703281530.HAA15430@freefall.freebsd.org> Resent-From: gnats (GNATS Management) Resent-To: freebsd-bugs Resent-Reply-To: FreeBSD-gnats@freefall.FreeBSD.org, proff@suburbia.net Received: from pdx1.world.net (pdx1.world.net [192.243.32.18]) by freefall.freebsd.org (8.8.5/8.8.5) with ESMTP id HAA15264 for ; Fri, 28 Mar 1997 07:25:17 -0800 (PST) Received: from suburbia.net (suburbia.net [203.4.184.1]) by pdx1.world.net (8.7.5/8.7.3) with SMTP id HAA05658 for ; Fri, 28 Mar 1997 07:27:24 -0800 (PST) Received: (qmail 6279 invoked by uid 110); 28 Mar 1997 15:24:28 -0000 Message-Id: <19970328152428.6278.qmail@suburbia.net> Date: 28 Mar 1997 15:24:28 -0000 From: proff@suburbia.net Reply-To: proff@suburbia.net To: FreeBSD-gnats-submit@freebsd.org X-Send-Pr-Version: 3.2 Subject: bin/3131: dlsym() does not set error on error, breaks dlerror() Sender: owner-bugs@freebsd.org X-Loop: FreeBSD.org Precedence: bulk >Number: 3131 >Category: bin >Synopsis: dlsym() does not set error on error, breaks dlerror() >Confidential: no >Severity: critical >Priority: high >Responsible: freebsd-bugs >State: open >Class: sw-bug >Submitter-Id: current-users >Arrival-Date: Fri Mar 28 07:30:01 PST 1997 >Last-Modified: >Originator: Julian Assange >Organization: >Release: FreeBSD 2.2-GAMMA i386 >Environment: >Description: dlerror() is meant to return the last error from dlopen or dlsym. dlsym() doesn't actually set any error message when an error happens. and thus dlerror() will lie >How-To-Repeat: >Fix: --- src/gnu/usr.bin/ld/rtld/rtld.c.orig Sun Feb 2 04:17:09 1997 +++ src/gnu/usr.bin/ld/rtld/rtld.c Sat Mar 29 01:19:30 1997 @@ -27,7 +27,7 @@ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. * * $Id: rtld.c,v 1.46 1997/02/22 15:46:48 peter Exp $ */ #include @@ -1912,9 +1912,11 @@ src_map = smp; np = lookup(sym, &src_map, 1); - if (np == NULL) - return NULL; - + if (np == NULL) { + generror ("dlsym failed for \"%s\" : %s", + smp->som_path, sym); + return NULL; + } /* Fixup jmpslot so future calls transfer directly to target */ addr = np->nz_value; if (src_map) >Audit-Trail: >Unformatted: