Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

rr doen't come along with Address Sanitizer #3730

Closed
critical27 opened this issue Apr 19, 2024 · 2 comments
Closed

rr doen't come along with Address Sanitizer #3730

critical27 opened this issue Apr 19, 2024 · 2 comments

Comments

@critical27
Copy link

critical27 commented Apr 19, 2024

I need to record a unit test built with asan. But rr record fails with following log:

(rr) c
Continuing.
==3841388==ASan runtime does not come first in initial library list; you should either link runtime to your application or manually preload it with LD_PRELOAD.

Program received signal SIGKILL, Killed.
0x00007f457c74bffb in ?? () from  /usr/lib64/libclang_rt.asan-x86_64.so

However, the runtime asan has been linked to my binary

> ldd ./my_test | grep clang 
libclang_rt.asan-x86_64.so => /usr/lib64/libclang_rt.asan-x86_64.so (0x00007fb021fa5000)

I have tried to LD_PRELOAD the asan library, which doesn't work as well. Refering to #1690 (comment) , I didn't see the log. My rr version is 5.6.0.

Am I missing anything? Thx~

@bernhardu
Copy link
Contributor

Hello, I tried to reproduce it like shown in following block.
Is using ASAN_OPTIONS=verify_asan_link_order=0 working for you?

git checkout 5.6.0
git show d12f8ffb004 | patch -p1
git show 2979c60ef | patch -p1

#apt install libclang-rt-14-dev


cat <<EOF > my_test.cpp
int main() {  return 0; }
EOF


clang++ -g -fsanitize=address -shared-libsan -fno-omit-frame-pointer my_test.cpp -o my_test

export LD_LIBRARY_PATH=/usr/lib/llvm-14/lib/clang/14.0.6/lib/linux


bin/rr record /tmp/rr-3730/my_test
rr: Saving execution to trace directory `.../my_test-6'.
==940172==ASan runtime does not come first in initial library list; you should either link runtime to your application or manually preload it with LD_PRELOAD.


ASAN_OPTIONS=verify_asan_link_order=0 bin/rr record /tmp/rr-3730/my_test
rr: Saving execution to trace directory `.../my_test-7'.


bin/rr replay -a my_test-7

@critical27
Copy link
Author

@bernhardu that will work, thx a lot~

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants