当前位置: 技术问答>linux和unix
dlopen 里面异常问题怎么解决?求助大家(RedHat AS 2.1 )
来源: 互联网 发布时间:2015-10-01
本文导语: 编写了一个动态库,在程序中第二次dlopen (之前已经dlclose)时候,异常退出,现象如下 Program received signal SIGSEGV, Segmentation fault. [Switching to Thread 1024 (LWP 18605)] _dl_lookup_symbol (undef_name=0x4037a74c "_nc_outch", undef_m...
编写了一个动态库,在程序中第二次dlopen (之前已经dlclose)时候,异常退出,现象如下
Program received signal SIGSEGV, Segmentation fault.
[Switching to Thread 1024 (LWP 18605)]
_dl_lookup_symbol (undef_name=0x4037a74c "_nc_outch", undef_map=0x80503a0,
ref=0xbffeb94c, symbol_scope=0x805053c, type_class=0, explicit=0)
at do-lookup.h:52
52 do-lookup.h: No such file or directory.
in do-lookup.h
Current language: auto; currently c
(gdb) where
#0 _dl_lookup_symbol (undef_name=0x4037a74c "_nc_outch", undef_map=0x80503a0,
ref=0xbffeb94c, symbol_scope=0x805053c, type_class=0, explicit=0)
at do-lookup.h:52
#1 0x4000bb91 in _dl_relocate_object ()
at ../sysdeps/i386/i486/bits/string.h:135
#2 0x401dcd29 in dl_open_worker (a=0xbffebbe0) at dl-open.c:294
#3 0x4000d7c3 in _dl_catch_error (objname=0xbffebbd8, errstring=0xbffebbdc,
operate=0x401dc860 , args=0xbffebbe0) at dl-error.c:152
#4 0x401dce7e in _dl_open (
file=0xbffebdb0 "/home/zzl/JITCrypt/lib_da/libjitcrypt.so",
mode=-2147483647, caller=0x8049269) at dl-open.c:407
#5 0x40045375 in dlopen_doit (a=0xbffebd50) at dlopen.c:39
#6 0x4000d7c3 in _dl_catch_error (objname=0x8050308, errstring=0x805030c,
operate=0x40045340 , args=0xbffebd50) at dl-error.c:152
#7 0x400456fb in _dlerror_run (operate=0x40045340 ,
args=0xbffebd50) at dlerror.c:130
#8 0x40045326 in __dlopen_check (
file=0xbffebdb0 "/home/zzl/libmycrypt.so", mode=1)
at dlopen.c:53
试验了另外的几个库,没有这个问题,但是应该如何定位,解决这个问题呢?
盼望回复
Program received signal SIGSEGV, Segmentation fault.
[Switching to Thread 1024 (LWP 18605)]
_dl_lookup_symbol (undef_name=0x4037a74c "_nc_outch", undef_map=0x80503a0,
ref=0xbffeb94c, symbol_scope=0x805053c, type_class=0, explicit=0)
at do-lookup.h:52
52 do-lookup.h: No such file or directory.
in do-lookup.h
Current language: auto; currently c
(gdb) where
#0 _dl_lookup_symbol (undef_name=0x4037a74c "_nc_outch", undef_map=0x80503a0,
ref=0xbffeb94c, symbol_scope=0x805053c, type_class=0, explicit=0)
at do-lookup.h:52
#1 0x4000bb91 in _dl_relocate_object ()
at ../sysdeps/i386/i486/bits/string.h:135
#2 0x401dcd29 in dl_open_worker (a=0xbffebbe0) at dl-open.c:294
#3 0x4000d7c3 in _dl_catch_error (objname=0xbffebbd8, errstring=0xbffebbdc,
operate=0x401dc860 , args=0xbffebbe0) at dl-error.c:152
#4 0x401dce7e in _dl_open (
file=0xbffebdb0 "/home/zzl/JITCrypt/lib_da/libjitcrypt.so",
mode=-2147483647, caller=0x8049269) at dl-open.c:407
#5 0x40045375 in dlopen_doit (a=0xbffebd50) at dlopen.c:39
#6 0x4000d7c3 in _dl_catch_error (objname=0x8050308, errstring=0x805030c,
operate=0x40045340 , args=0xbffebd50) at dl-error.c:152
#7 0x400456fb in _dlerror_run (operate=0x40045340 ,
args=0xbffebd50) at dlerror.c:130
#8 0x40045326 in __dlopen_check (
file=0xbffebdb0 "/home/zzl/libmycrypt.so", mode=1)
at dlopen.c:53
试验了另外的几个库,没有这个问题,但是应该如何定位,解决这个问题呢?
盼望回复
|
是用RTLD_LAZY方式dlopen的把,改称RTLD_NOW试一下。
|
打开方式可能会有点关系
您可能感兴趣的文章:
本站(WWW.)旨在分享和传播互联网科技相关的资讯和技术,将尽最大努力为读者提供更好的信息聚合和浏览方式。
本站(WWW.)站内文章除注明原创外,均为转载、整理或搜集自网络。欢迎任何形式的转载,转载请注明出处。
本站(WWW.)站内文章除注明原创外,均为转载、整理或搜集自网络。欢迎任何形式的转载,转载请注明出处。