This is the mail archive of the
libc-alpha@sources.redhat.com
mailing list for the glibc project.
segv if loading first shobj fails
- From: Corey Minyard <cminyard at mvista dot com>
- To: libc-alpha at sources dot redhat dot com
- Date: Mon, 29 Jul 2002 12:01:19 -0500
- Subject: segv if loading first shobj fails
In a patch I have to mlock() executables into memory, I noticed that if
loading the first shobj fails, the code will segv. In the lose()
function in dl-load.c, there is:
#ifndef SHARED
if (l->l_prev == NULL)
/* No other module loaded. */
_dl_loaded = NULL;
else
#endif
l->l_prev->l_next = NULL;
If the first shobj fails, the l->l_prev will be NULL. I'm not sure if
it would be better to remove the #ifndef, or add another check. This is
in glibc-2.2.5.
And unfortunately, I don't know a good way to build a testcase without
changing the code or using a bogus shobj.
-Corey