dlopen() crash -gcc 3.4.6 20060404

Gaurav Kheterpal gaurav.kheterpal@premiereglobal.com
Thu Jul 26 08:51:00 GMT 2007


Hello,

My apologies if this message doesn’t seem appropriate on this list.

gcc version 3.4.6 20060404 (Red Hat 3.4.6-3)
ES Linux 4.0

I am facing a dlopen() crash & am looking for guidance from C Gurus on the
same. I have a small program:-

#include <stdio.h>
#include <dlfcn.h>
int main()
{
  void* _handle;
printf ("\n Starting now !!! \n");
_handle = dlopen( "./libchrcv.so", RTLD_NOW | RTLD_GLOBAL );
         if ( 0 == _handle )
         {
            printf("ShareableContentHandler::Load() - dlopen failed
'%s'.\n", dlerror() );
         }
else
         {
            printf("ShareableContentHandler::Load() - dlopen success
'%s'.\n", dlerror() );
         }
return 0;
}

libchrcv.so is a shared library which in turn links against 2 libraries –
librcvagent.so and libcontrolagent.so. I verified that both these .so files
are present in the path specified in LD_LIBRARY_PATH.

I compile this program using gcc test.c –ldl & it compiles & links fine.
However, when I execute it, I get a segmentation fault. The output is:-

Starting now !!!
Segmentation fault

There is no core file generated. I capture the LD_DEBUG output & it is
attached for reference.

I’ll be thankful if somebody can look at the attached file & guide me on
what the problem is.

Thanks in advance.

Regards,
Gaurav.


-------------- next part --------------
A non-text attachment was scrubbed...
Name: ld.out.28704
Type: application/octet-stream
Size: 75805 bytes
Desc: not available
URL: <https://gcc.gnu.org/pipermail/gcc/attachments/20070726/a8f1c14a/attachment.obj>


More information about the Gcc mailing list