Hi all,
RHL7.2, glibc2.2.4, pthread.
Same dlsym() went well until segfault with stack trace below today:
#0 _dl_lookup_symbol (undef_name=0x8068e98 "callsub", undef_map=0x40016c00,
ref=0x42b6fef4, symbol_scope=0x814e2bc, type_class=0, explicit=1) at
do-lookup.h:80
#1 0x40c50e70 in _dl_sym (handle=0x1c80, name=0x8068e98 "callsub",
who=0x0)at dl-sym.c:62
#2 0x40acc450 in dlsym_doit (a=0x42b7003c) at dlsym.c:39
#3 0x4000d7c3 in _dl_catch_error (objname=0x837dda8,
errstring=0x837ddac,operate=0x40acc430 <dlsym_doit>, args=0x42b7003c) at
dl-error.c:152
#4 0x40acc6fb in _dlerror_run (operate=0x40acc430
<dlsym_doit>,args=0x42b7003c) at dlerror.c:130
#5 0x40acc416 in dlsym (handle=0x814e108, name=0x8068e98 "callsub") at
dlsym.c:51
#6 0x08065378 in myclass::calllib (this=0x83938d8, bufout=0x42b7ef9c) at
mychildthread.cpp:87
The code snippet as thus:
// mychildthread.cpp
....
plib = dlopen("mylib", RTLD_LAZY);
if (!plib) {
error = dlerror();
deb_dump(...);
return ERR_LIB;
}
dlerror();
callsub = ( func_callsub )dlsym(plib, "callsub"); // line 87
if ((error = dlerror())) {...}
....
App's main thread dlopen() "mylib" and dlclose() it only when it exits.
Should each (child)thread uses a mutex for dlopen()/dlsym()/dlclose() for
above issue? my app doesn't. If not, what is the possible reason?
Thanks in advance
-sean
|
|
0
|
|
|
|
Reply
|
Sean
|
1/16/2004 1:47:23 AM |
|
Hello Sean,
> RHL7.2, glibc2.2.4, pthread.
> Same dlsym() went well until segfault with stack trace below today:
[snip]
> The code snippet as thus:
[snip]
> App's main thread dlopen() "mylib" and dlclose() it only when it exits.
> Should each (child)thread uses a mutex for dlopen()/dlsym()/dlclose() for
> above issue? my app doesn't. If not, what is the possible reason?
I can't do anything with your input (and probably the others neither).
Pls could you post a minimal, working, code that shows your issue. It
doesn't need to be you full code (which can be proprietary).
TIA,
Loic.
|
|
0
|
|
|
|
Reply
|
loic
|
1/16/2004 2:52:21 PM
|
|
"Loic Domaigne" wrote:
>I can't do anything with your input (and probably the others neither).
>...
Thanks for reply.
Could be another developer updated the lib without restart my app the
reason? I'm not very sure though.
|
|
0
|
|
|
|
Reply
|
Sean
|
1/17/2004 12:30:52 AM
|
|
|
2 Replies
259 Views
(page loaded in 0.162 seconds)
Similiar Articles: Why do I need __USE_GNU to use RTLD_NEXT (Debian Linux) ? - comp ...C programming question. I have #include , to declare dlsym() and define RTLD_NEXT. I found that it doesn't work (complains that RTLD_NEXT is undefine... Unsatisfied symbols - comp.sys.hp.hpuxCan you tell me what I need to link for these? | | ld: Unsatisfied symbol "dlclose" in file /usr/lib/pa20_64/libnsl.1 | ld: Unsatisfied symbol "dlsym" in file /usr/lib ... Error loading shared library - comp.sys.hp.hpuxThe odd thing is that if I link in the libjvm.sl into my program, then it works fine (still doing the dlopen/dlsym) - with or without doing chatr +s enable. Static Linking Problem - comp.unix.programmerThe problem is that when I add the "-static" option to g++, I end up getting unresolved symbols: dlsym, dlopen, dlclose I tried linking in the dl library with the ... Cannot step inside shared object in Solaris 10 - comp.unix ...dllInstanceMR = dlopen("/usr/lib/libstorelib.so", RTLD_LAZY); ..... pfnProcessLibCommandMR = (ProcessLibCommandFunc)dlsym(dllInstanceMR, "ProcessLibCommand"); Later ... dlopen and SIGSEGV - comp.unix.programmerSo, I use dlopen to open every libraries in a particular folder, then I do a dlsym to check for an entry point to register the library in a plugin database. dynamic libraries, importing symbols - comp.unix.programmer ...Gregor wrote: > thanks for your help, what about importing symbols from exe file to shared > library? Use dlsym() -- John L. Fjellstad A: Top posting! open failed: illegal insecure pathname - comp.unix.solaris ...... loadit(void) { extern char **environ; char **env; int offset; next_select = CAST(int, (int, fd_set *, fd_set *, fd_set *, struct timeval * ))dlsym ... [tao-users] Can't restrict the handles in ACE_TP_Reactor to 1024 ...... CONFIG config-linux.h=0A#includ= e "ace/config-linux-common.h"=0A#define ACE_HAS_SVR4_DYNAMIC_LINKING=0A#def= ine ACE_HAS_AUTOMATIC_INIT_FINI=0A#define ACE_HAS_DLSYM ... GAWK: A fix for "missing file is a fatal error" - comp.lang.awk ...... static int (*real_open64) (const char *,int); static char *warn; int ret; if (!real_open64) { real_open64 = (int (*)(const char *,int)) dlsym(RTLD_NEXT ... dlsymDESCRIPTION. The dlsym() function shall obtain the address of a symbol defined within an object made accessible through a dlopen call. The handle argument is the ... dlsym(3) - Linux man pagedlsym() The function dlsym() takes a ... Name. dladdr, dlclose, dlerror, dlopen, dlsym, dlvsym - programming interface to dynamic linking loader 7/24/2012 4:02:09 AM
|