Subject: bin/9903: dlopen() core dumps when a dependent library is missing
To: None <gnats-bugs@gnats.netbsd.org>
From: None <root@ihack.net>
List: netbsd-bugs
Date: 04/16/2000 09:14:12
>Number:         9903
>Category:       bin
>Synopsis:       dlopen() core dumps when a dependent library is missing
>Confidential:   no
>Severity:       serious
>Priority:       medium
>Responsible:    bin-bug-people
>State:          open
>Class:          sw-bug
>Submitter-Id:   net
>Arrival-Date:   Sun Apr 16 09:15:00 PDT 2000
>Closed-Date:
>Last-Modified:
>Originator:     Charles M. Hannum
>Release:        -current as of 12APR2000
>Organization:
	Internetwork Hacker
>Environment:
	n/a

>Description:
	When a dependent library of the object being loaded is not found,
	dlopen() will core dump.

>How-To-Repeat:
$ cat foo.c
#include <dlfcn.h>

int
main()
{
        dlopen("/usr/pkg/lib/libgii.so", RTLD_LAZY);
}
$ cc -o foo foo.c
$ ldd ./foo /usr/pkg/lib/libgii.so
./foo:
         -lc.12 => /usr/lib/libc.so.12
/usr/pkg/lib/libgii.so:
         -lgg.0 => not found
         -lc.12 => /usr/lib/libc.so.12
$ ./foo
Segmentation fault - core dumped
$ LD_LIBRARY_PATH=/usr/pkg/lib ./foo
$ 

>Fix:
	Not provided.
>Release-Note:
>Audit-Trail:
>Unformatted: