dlopen 里面异常问题怎么解决?求助大家(RedHat AS 2.1 )

sun_star221 2005-06-02 06:29:37
编写了一个动态库,在程序中第二次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 <dl_open_worker>, 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 <dlopen_doit>, args=0xbffebd50) at dl-error.c:152
#7 0x400456fb in _dlerror_run (operate=0x40045340 <dlopen_doit>,
args=0xbffebd50) at dlerror.c:130
#8 0x40045326 in __dlopen_check (
file=0xbffebdb0 "/home/zzl/libmycrypt.so", mode=1)
at dlopen.c:53


试验了另外的几个库,没有这个问题,但是应该如何定位,解决这个问题呢?
盼望回复
...全文
408 4 打赏 收藏 转发到动态 举报
写回复
用AI写文章
4 条回复
切换为时间正序
请发表友善的回复…
发表回复
sun_star221 2005-06-03
  • 打赏
  • 举报
回复
谢谢上面关注的朋友
sun_star221 2005-06-03
  • 打赏
  • 举报
回复
问题解决了,是编译参数的问题,makefile中连接参数问题 -lcurses
sharkhuang 2005-06-03
  • 打赏
  • 举报
回复
打开方式可能会有点关系
gettext 2005-06-03
  • 打赏
  • 举报
回复
是用RTLD_LAZY方式dlopen的把,改称RTLD_NOW试一下。

23,121

社区成员

发帖
与我相关
我的任务
社区描述
Linux/Unix社区 应用程序开发区
社区管理员
  • 应用程序开发区社区
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告
暂无公告

试试用AI创作助手写篇文章吧