From proff@suburbia.net  Fri Mar 28 07:25:18 1997
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 <FreeBSD-gnats-submit@freebsd.org>; 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 <FreeBSD-gnats-submit@freebsd.org>; 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
Subject: <Synopsis of the problem (one line)> dlsym() does not set error on error, breaks dlerror()
X-Send-Pr-Version: 3.2

>Number:         3131
>Category:       bin
>Synopsis:       dlsym() does not set error on error, breaks dlerror()
>Confidential:   no
>Severity:       critical
>Priority:       high
>Responsible:    freebsd-bugs
>State:          closed
>Quarter:
>Keywords:
>Date-Required:
>Class:          sw-bug
>Submitter-Id:   current-users
>Arrival-Date:   Fri Mar 28 07:30:01 PST 1997
>Closed-Date:    Tue Aug 19 13:25:52 PDT 1997
>Last-Modified:  Tue Aug 19 13:32:08 PDT 1997
>Originator:     Julian Assange
>Release:        FreeBSD 2.2-GAMMA i386
>Organization:
>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 <sys/param.h>
@@ -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)
	
	

>Release-Note:
>Audit-Trail:
State-Changed-From-To: open->closed 
State-Changed-By: jlemon 
State-Changed-When: Tue Aug 19 13:25:52 PDT 1997 
State-Changed-Why:  

Apparently fixed by jdp in rtld.c, rev 1.47 
>Unformatted:
