- Subject: libc/1168: BUG IN DYNAMIC LINKER ld.so
- From: borislav@ensim.com
- Date: Fri Jun 25 18:57:43 1999
Topics:
libc/1168: BUG IN DYNAMIC LINKER ld.so
----------------------------------------------------------------------
Date: Thu, 17 Jun 1999 09:18:20 -0400
From: borislav@ensim.com
To: bugs@gnu.org
Subject: libc/1168: BUG IN DYNAMIC LINKER ld.so
Message-Id: <199906171318.JAA03656@delysid.gnu.org>
>Number: 1168
>Category: libc
>Synopsis: BUG IN DYNAMIC LINKER ld.so
>Confidential: no
>Severity: critical
>Priority: medium
>Responsible: libc-gnats
>State: open
>Class: sw-bug
>Submitter-Id: unknown
>Arrival-Date: Thu Jun 17 09:20:01 EDT 1999
>Last-Modified:
>Originator: borislav@ensim.com
>Organization:
net
>Release: 2.1.1
>Environment:
glibc-2.1.1, egcs-2.91.66, linux kernel 2.2.9, redhat 6.0 on x86
>Description:
When running a small dynamically linked program (see below) I get the following:
BUG IN DYNAMIC LINKER ld.so: rtld.c: 841: dl_main: Assertion `_dl_rtld_map.l_prev->l_next == _dl_rtld_map.l_next' failed!
The line number is probably different due to Redhat patches but that assertion
appears only once in rtld.c, anyway.
>How-To-Repeat:
Here is a small program that reproduces this problem for me (the problem I am
trying to solve with it should be obvious too...):
- ---- t.c -----
#include <stdio.h>
#include <stdlib.h>
extern void foo(void);
int open(void)
{
printf("ha ha, tricked you!\n");
return -1;
}
int main(void)
{
foo();
exit(EXIT_SUCCESS);
}
- ---- foo.c ------
#include <stdio.h>
#include <fcntl.h>
void foo(void)
{
if (open("/tmp", O_RDONLY) == -1)
printf("open failed\n");
else
printf("success\n");
}
- ---- Makefile ------
all: t
foo.o: foo.c
gcc -fPIC -c foo.c
libfoo.so: foo.o Makefile
gcc -shared -Xlinker -f -Xlinker libc.so.6 \
-o libfoo.so foo.o
t.o: t.c
gcc -c t.c
t: t.o libfoo.so
gcc -o t t.o -L. -Xlinker -rpath -Xlinker . -lfoo
- --------------------
run ./t%0
>Fix:
>Audit-Trail:
>Unformatted:
------------------------------
End of forwardyKAkuO Digest
***************************