1 // FIXME: https://code.google.com/p/address-sanitizer/issues/detail?id=316
5 // RUN: mkdir -p %t-dir
6 // RUN: %clangxx_asan -DSHARED %s -shared -o %t-dir/stack_trace_dlclose.so -fPIC
7 // RUN: %clangxx_asan -DSO_DIR=\"%t-dir\" %s %libdl -o %t
8 // RUN: %env_asan_opts=exitcode=0 %run %t 2>&1 | FileCheck %s
9 // REQUIRES: stable-runtime
17 #include <sanitizer/common_interface_defs.h>
28 int main(int argc
, char **argv
) {
29 void *handle
= dlopen(SO_DIR
"/stack_trace_dlclose.so", RTLD_LAZY
);
31 void *(*foo
)() = (void *(*)())dlsym(handle
, "foo");
38 free(p
); // double-free
44 // CHECK: {{ #0 0x.* in (__interceptor_)?malloc}}
45 // CHECK: {{ #1 0x.* \(<unknown module>\)}}
46 // CHECK: {{ #2 0x.* in main}}