error in dlopen()

Andrew Haley
Sat Apr 18 09:35:00 GMT 2009

ranjith kumar wrote:

> I inserted a shared library(say  inside a running process(say mutatee) .
> I did not use dlopen() function for this.

OK, so how did you do that, then?

> The shared library(  contains dlopen() function ie) it depends on
> The problem is when I tried to call dlopen() function which is inside
> the shared library( the mutatee is getting crashed.
> When I call dlopen() with file="" , the mutatee is not getting
> crashed,  but when I give any other filename it is getting crashed.
> What could be the reason.

It's hard to tell without an example.

> General questions about dlopen().
> 1) In which section dlopen() inserts a library. Inside heap or text or
> data section??? How to know whether dlopen() has permissions for that
> section?
> 2) I want to debug dlopen() function to know where it is getting crashed.
>     I dont have gdb on my machine(armv5-linux).
>    Where can I download souce code??? that I will
> comiple it for arm and insert my own printf() statements inside it.

When dlopen() opens a library, it calls mmap() to allocate address space
for the library's segments.

The source code for is part of glibc.  You must download the
source from the same place you downloaded the binary.  If you download
it from anywhere else you may have a different version, one that doesn't
correspond with your binary.


More information about the Gcc-help mailing list