Menu

#3 kawari 8.2.8 segfault in Linux on dlclose NULL pointer

open
nobody
None
5
2010-11-08
2010-11-08
No

The original bug report is on Debian. Please read [1].

In the non-WIN32 load_library():
...
if (!fallback_always) {
// SAORI_FALLBACK_ALWAYSが空でも0でもなければ、まずは試しに
dlopenしてみる。
void* handle = ::dlopen(file.c_str(), RTLD_LAZY);
if (handle != NULL) {
// load, unload, requestを取り出してみる。
void* sym_load = ::dlsym(handle, "load");
void* sym_unload = ::dlsym(handle, "unload");
void* sym_request = ::dlsym(handle, "request");
if (sym_load != NULL && sym_unload != NULL &&
sym_request != NULL) {
do_fallback = false;
}
}
::dlclose(handle);
}
...

It tries to dlopen an win32 dll file under Linux but
it failed and return NULL And then
dlclose(NULL) causes the crash.

So I made a patch to fix the problem. I just move that dlclose() into
the if{}. And it should fix the segfault.

I attached the patch in the bug report.

[1] http://bugs.debian.org602611

Discussion

  • Ying-Chun Liu (PaulLiu)

    Patch to fix this bug.

     
  • Ying-Chun Liu (PaulLiu)

     

Log in to post a comment.

MongoDB Logo MongoDB