ASAN/UBSAN prints /usr/bin/llvm-symbolizer: symbol lookup error: .../lib/libfoo.so: undefined symbol: __asan_option_detect_stack_use_after_return

Hi,

I have this error with ASAN+UBSAN on an application involving shared libraries. The asan runtime is statically linked to the binary. Everything is built with clang 7.0 (linked with lld) and -fsanitize=address,undefined

/usr/bin/llvm-symbolizer: symbol lookup error: …/lib/libfoo.so: undefined symbol: __asan_option_detect_stack_use_after_return
==153==WARNING: Can’t read from symbolizer at fd 128
/usr/bin/llvm-symbolizer: symbol lookup error: …/lib/libfoo.so: undefined symbol: __asan_option_detect_stack_use_after_return
==153==WARNING: Can’t read from symbolizer at fd 128
/usr/bin/llvm-symbolizer: symbol lookup error: …/lib/libfoo.so: undefined symbol: __asan_option_detect_stack_use_after_return
==153==WARNING: Can’t read from symbolizer at fd 128
/usr/bin/llvm-symbolizer: symbol lookup error: …/lib/libfoo.so: undefined symbol: __asan_option_detect_stack_use_after_return
==153==WARNING: Can’t read from symbolizer at fd 128
==153==WARNING: Failed to use and restart external symbolizer!
#0 0x96396d (path/to/my_binary+0x96396d)
#1 0x937fd7 (path/to/my_binary+0x937fd7)
#2 0x8a8971 (path/to/my_binary+0x8a8971)
#3 0x88ef99 (path/to/my_binary+0x88ef99)
#4 0xcaa95b (path/to/my_binary+0xcaa95b)
#5 0xcb6fa5 (path/to/my_binary+0xcb6fa5)
#6 0xcad584 (path/to/my_binary+0xcad584)
#7 0xcadc5a (path/to/my_binary+0xcadc5a)
#8 0xcad812 (path/to/my_binary+0xcad812)
#9 0x8b7f1c (path/to/my_binary+0x8b7f1c)
#10 0x7fa95711b82f (/lib/x86_64-linux-gnu/libc.so.6+0x2082f)
#11 0x7b3028 (path/to/my_binary+0x7b3028)

SUMMARY: UndefinedBehaviorSanitizer: undefined-behavior some_file.cpp:131:9 in
som_file.cpp:153:9: runtime error: load of value 190, which is not a valid value for type ‘bool’

This does not happen all the time, I also have ASAN traces that are well symbolized. It is possible that is happens only with UBSAN traces, but not totally sure.
Any pointer on how to debug this?

Thanks,