]> git.ipfire.org Git - thirdparty/libvirt.git/commitdiff
Avoid crash in shunloadtest
authorDaniel P. Berrange <berrange@redhat.com>
Thu, 1 Dec 2011 16:33:50 +0000 (11:33 -0500)
committerEric Blake <eblake@redhat.com>
Thu, 1 Dec 2011 18:02:07 +0000 (11:02 -0700)
For unknown reasons, the shunloadtest will crash on Fedora 16
inside dlopen()

 (gdb) bt
 #0  0x00000000000050e6 in ?? ()
 #1  0x00007ff61a77b9d5 in floor () from /lib64/libm.so.6
 #2  0x00007ff61e522963 in _dl_relocate_object () from /lib64/ld-linux-x86-64.so.2
 #3  0x00007ff61e5297e6 in dl_open_worker () from /lib64/ld-linux-x86-64.so.2
 #4  0x00007ff61e525006 in _dl_catch_error () from /lib64/ld-linux-x86-64.so.2
 #5  0x00007ff61e52917a in _dl_open () from /lib64/ld-linux-x86-64.so.2
 #6  0x00007ff61e0f6f26 in dlopen_doit () from /lib64/libdl.so.2
 #7  0x00007ff61e525006 in _dl_catch_error () from /lib64/ld-linux-x86-64.so.2
 #8  0x00007ff61e0f752f in _dlerror_run () from /lib64/libdl.so.2
 #9  0x00007ff61e0f6fc1 in dlopen@@GLIBC_2.2.5 () from /lib64/libdl.so.2
 #10 0x0000000000400a15 in main (argc=<optimized out>, argv=<optimized out>) at shunloadtest.c:105

Changing from RTLD_NOW to RTLD_LAZY avoids this problem,
but quite possibly does not fix the root cause.

* shunloadtest.c: s/NOW/LAZY/

tests/shunloadtest.c

index 2cdb8b8bb1b71551732bcb790b869434785e5f95..ab6e56fced9a563f9b0779a2c3211b3cc6e96e51 100644 (file)
@@ -102,7 +102,7 @@ int main(int argc ATTRIBUTE_UNUSED, char **argv)
     fprintf(stderr, "      .%*s 1   ", 39, "");
     signal(SIGSEGV, sigHandler);
 
-    if (!(lib = dlopen("./.libs/libshunload.so", RTLD_NOW))) {
+    if (!(lib = dlopen("./.libs/libshunload.so", RTLD_LAZY))) {
         fprintf(stderr, "Cannot load ./.libs/libshunload.so %s\n", dlerror());
         return 1;
     }