summaryrefslogtreecommitdiffstats
path: root/tests/dwfl-proc-attach.c
diff options
context:
space:
mode:
authorMark Wielaard <[email protected]>2020-11-01 23:45:32 +0100
committerMark Wielaard <[email protected]>2020-11-01 23:45:32 +0100
commit8dd97a0a871672b3f7a58e1fb50b6f7195d8f32d (patch)
tree3a86d4fb1d7abf6966ff94a1e25f13f7e1809c48 /tests/dwfl-proc-attach.c
parent50a6eeef7d87623faa65126dc3d16c2a8e613aea (diff)
parentb503c358dde835d8a1ae3ebd4968755ff396f814 (diff)
Merge tag 'elfutils-0.182' into mjw/RH-DTSdts-0.182
elfutils 0.182 release
Diffstat (limited to 'tests/dwfl-proc-attach.c')
-rw-r--r--tests/dwfl-proc-attach.c19
1 files changed, 19 insertions, 0 deletions
diff --git a/tests/dwfl-proc-attach.c b/tests/dwfl-proc-attach.c
index 102ba181..d02e9fc0 100644
--- a/tests/dwfl-proc-attach.c
+++ b/tests/dwfl-proc-attach.c
@@ -97,7 +97,26 @@ main (int argc __attribute__ ((unused)),
if (dwfl_getthreads (dwfl, thread_callback, &threads) != DWARF_CB_OK)
error (-1, 0, "dwfl_getthreads failed: %s", dwfl_errmsg (-1));
+ dwfl_end (dwfl);
+
+ pthread_cancel (thread1);
+ pthread_cancel (thread2);
+ pthread_join (thread1, NULL);
+ pthread_join (thread2, NULL);
+
return (threads == 3) ? 0 : -1;
}
+/* HACK. This is a simple workaround for a combination of old glibc
+ and valgrind. libdw will try to dlopen libdebuginfod this causes
+ some unsuppressable memory leak warnings when the process is
+ multi-threaded under valgrind because of some bad backtraces.
+ So simply override dlopen and always return NULL so libdebuginfod
+ (and libcurl) are never loaded. This test doesn't rely on
+ libdebuginfod anyway. */
+void *dlopen (void)
+{
+ return NULL;
+}
+
#endif /* __linux__ */