[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Bug#430732: dlvsym() returns NULL on failure, but does not let dlerror() do the work on failure



Package: libc6
Version: 2.5-9

dlvsym can fail but does not seem to set dlerror(), contrary to the
manpage, which explains that error conditions should check dlvsym=NULL
and dlerror!=NULL, because 0 is a valid address.
The same can be said about dlsym also.



The following code outputs:
	(nil)
which is not expected.



/*BINFMTC: -ldl
 dlvsym test code
 */
#define _GNU_SOURCE
#include <dlfcn.h>
#include <stdio.h>

int main()
{
  dlerror();
  if (!dlvsym(RTLD_NEXT, "chown", "NONEXIST"))
    {
      printf("%p\n", dlerror());
    }
  return 0;
}



regards,
	junichi
-- 
dancer@{debian.org,netfort.gr.jp}   Debian Project



Reply to: