From nobody  Sat Aug  2 09:37:29 1997
Received: (from nobody@localhost)
          by hub.freebsd.org (8.8.5/8.8.5) id JAA00709;
          Sat, 2 Aug 1997 09:37:29 -0700 (PDT)
Message-Id: <199708021637.JAA00709@hub.freebsd.org>
Date: Sat, 2 Aug 1997 09:37:29 -0700 (PDT)
From: livio@csl.sri.com
To: freebsd-gnats-submit@freebsd.org
Subject: dlsym returns null
X-Send-Pr-Version: www-1.0

>Number:         4216
>Category:       bin
>Synopsis:       dlsym returns null
>Confidential:   no
>Severity:       non-critical
>Priority:       medium
>Responsible:    freebsd-bugs
>State:          closed
>Quarter:        
>Keywords:       
>Date-Required:  
>Class:          sw-bug
>Submitter-Id:   current-users
>Arrival-Date:   Sat Aug  2 09:40:01 PDT 1997
>Closed-Date:    Sat May 2 07:25:06 PDT 1998
>Last-Modified:  Sat May  2 07:25:52 PDT 1998
>Originator:     livio ricciulli
>Release:        2.2-970422-RELENG2.2-970422-RELENG
>Organization:
sri International
>Environment:
FreeBSD hyacinth.csl.sri.com 2.2-970422-RELENG FreeBSD 2.2-970422-RELENG #0: Thu Apr 24 14:29:18 PDT 1997     gilham@hyacinth.csl.sri.com:/usr/src/sys/compile/HYACINTH  i386

>Description:
dlsym returns null pointer on FreeBSD system while exact same function works on both Linux and SunOs.

>How-To-Repeat:
here is the culprit..

spawn_thread(thread,path)
int thread;
char *path;
{
        char *error;

       threadtable[thread].handle = dlopen (path, 1);
        if (!threadtable[thread].handle) { fputs (dlerror(), stderr); exit(1); }
       printf("Spawning thread %d with entry point %s\n",thread,threadtable[thread].argv[0]);
       threadtable[thread].main_fun=dlsym(threadtable[thread].handle, threadtable[thread].argv[0]);
       if ((error = dlerror()) != NULL)  { fputs(error, stderr); exit(1); }
       threadtable[thread].main_fun(threadtable[thread].argc, threadtable[thread].argv);
}

>Fix:
I do not know why this does not work..
>Release-Note:
>Audit-Trail:

From: Dmitrij Tejblum <tejblum@arc.hq.cti.ru>
To: livio@csl.sri.com
Cc: freebsd-gnats-submit@FreeBSD.ORG
Subject: Re: bin/4216: dlsym returns null 
Date: Fri, 17 Apr 1998 20:49:59 +0400

 > >Description:
 > dlsym returns null pointer on FreeBSD system while exact same function 
 > works on both Linux and SunOs.
 
 Do you still see this? I suspect that it fixed by following:
 
 RCS file: /home/ncvs/src/gnu/usr.bin/ld/rtld/rtld.c,v
 ....
 revision 1.40.2.4
 date: 1997/09/02 14:18:52;  author: nate;  state: Exp;  lines: +30 -2
 MFC: Prepend an underscore if a symbol lookup fails and try again.
 
 
 Dima
 
 
State-Changed-From-To: open->closed 
State-Changed-By: steve 
State-Changed-When: Sat May 2 07:25:06 PDT 1998 
State-Changed-Why:  
Believed to be fixed in revision 1.40.2.4 of rtld.c. 
>Unformatted:
