the attached patch hopefully makes licq not to crash/exit while loading an old/bad plugin. i tested it with a broken/old plugin that i had arround
Before: $ licq -b ~/.licq2 -pconsole 20:08:31: [WRN] Licq: Ignoring stale lockfile (pid 8743) licq: relocation error: /home/juam/bin/licq/lib/licq/licq_console.so: undefined symbol: __8CIniFileUs Now: $ ./licq -b ~/.licq2 -pconsole 20:09:43: [WRN] Licq: Ignoring stale lockfile (pid 8751) 20:09:43: [ERR] Unable to load plugin (console): /home/juam/src/licq/tree//lib/licq/licq_console.so: undefined symbol: _._8ICQEvent. 20:09:43: [WRN] This usually happen when your plugin is not keep in sync with the daemon. Please try recompling it. the configure had a "copy paste" bug. I give more priority to RTLD_NOW ("...meaning resolve all undefined symbols before dlopen returns, and fail if this cannot be done..") -- Buenos Aires, Argentina
Index: configure.in =================================================================== RCS file: /cvsroot/licq/licq/configure.in,v retrieving revision 1.56 diff -u -d -p -r1.56 configure.in --- configure.in 31 Jan 2003 21:04:25 -0000 1.56 +++ configure.in 4 Feb 2003 23:04:04 -0000 @@ -120,10 +120,10 @@ AC_TRY_COMPILE([ #include <stdio.h> #include <dlfcn.h> ],[ -dlopen(NULL, RTLD_LAZY) +dlopen(NULL, RTLD_NOW) ],[ - AC_MSG_RESULT([RTLD_LAZY]) - AC_DEFINE_UNQUOTED(DLOPEN_POLICY, RTLD_LAZY, [2nd dlopen parameter]) + AC_MSG_RESULT(RTLD_NOW) + AC_DEFINE_UNQUOTED(DLOPEN_POLICY, RTLD_NOW, [2nd dlopen parameter]) ],[ AC_TRY_COMPILE([ #include <stdio.h> Index: src/licq.cpp =================================================================== RCS file: /cvsroot/licq/licq/src/licq.cpp,v retrieving revision 1.64 diff -u -d -p -r1.64 licq.cpp --- src/licq.cpp 18 Jan 2003 01:29:32 -0000 1.64 +++ src/licq.cpp 4 Feb 2003 23:04:10 -0000 @@ -439,14 +439,12 @@ CPlugin *CLicq::LoadPlugin(const char *_ if (handle == NULL) { const char *error = dlerror(); - gLog.Error("%sUnable to load plugin (%s): %s.\n", L_ERRORxSTR, _szName, + gLog.Error("%sUnable to load plugin (%s): %s.\n", L_ERRORxSTR, _szName, error); - // Suggest a remedy if this is a Qt problem - if (strstr("undefined symbol", error) != NULL && - strstr("qt-gui", error) != NULL) - { - gLog.Error("%sUpgrade Qt or recompile the qt-gui plugin.\n", L_ERRORxSTR); - } + gLog.Warn("%s This usually happen when your plugin is not keep in sync\n" + " %s with the daemon. Please try recompling it.\n", + L_WARNxSTR,L_SBLANKxSTR); + delete p; return NULL; }
msg02005/pgp00000.pgp
Description: signature