You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
build a simple program on Ubuntu 15.10 with -fsantizer=address
run rr ./simple-program
get:
==20722==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.
I don't get this problem with clang 3.7.0 in Fedora 23. I hit a couple of other bugs, but after fixing those on master, I can now record and replay a trivial ASAN program that triggers a stack overflow report. I'll try it on Ubuntu 15.10 later.
I tried replicating this same issue with Ubuntu 14.04 with -fsanitizer=address and the above test program, and it did not produce "==20722==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.", it triggered the report as well.
This can be reproduced with the following compiler which I think is the default on Ubuntu 15.10:
$ cc --version
cc (Ubuntu 5.2.1-22ubuntu2) 5.2.1 20151010
$ cc -fsanitize=address test.cc
$ rr ./a.out
rr: Saving the execution of `./a.out' to trace directory `/home/ehsan/.local/share/rr/a.out-1'.
==12305==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.
OK, I think to fix this we just need to ensure libasan is added to LD_PRELOAD before librrpreload. librrpreload doesn't need to be the first library loaded (though the earlier it's loaded, the faster things will be).
Probably the most flexible way to do this would be to add a command-line parameter to recording that allows the user to inject an arbitrary string to be inserted into the tracee LD_PRELOAD before librrpreload. This would also let you generally add things tracee LD_PRELOAD without injecting them into rr itself.
It would be more convenient to have rr scan the libraries required by the tracee executable and automatically insert the required LD_PRELOAD so asan just works without any user intervention, but that's a bit more complicated and wouldn't solve some cases.
I am encountering this error with rr at version 4.5.0, and my binary compiled with clang 11.1.0 and ASAN as a shared library (-fsanitize=address -shared-libasan).
If you run with RR_LOG=RecordSession do you see the "Prepending ... to LD_PRELOAD" message?
Activity
rocallahan commentedon May 6, 2016
I don't get this problem with clang 3.7.0 in Fedora 23. I hit a couple of other bugs, but after fixing those on master, I can now record and replay a trivial ASAN program that triggers a stack overflow report. I'll try it on Ubuntu 15.10 later.
rocallahan commentedon May 7, 2016
OK, I tried this on up-to-date Ubuntu 15.10 and it worked too. Maybe we need more detailed steps to reproduce your bug?
rocallahan commentedon May 7, 2016
Here's my test program FWIW:
abrowne2 commentedon May 16, 2016
I tried replicating this same issue with Ubuntu 14.04 with -fsanitizer=address and the above test program, and it did not produce "==20722==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.", it triggered the report as well.
jrmuizel commentedon May 16, 2016
Yep. I can't reproduce this anymore either.
ehsan commentedon Jun 2, 2016
This can be reproduced with the following compiler which I think is the default on Ubuntu 15.10:
test.cc is the test program above.
rocallahan commentedon Jun 26, 2016
OK, I think to fix this we just need to ensure libasan is added to
LD_PRELOADbefore librrpreload. librrpreload doesn't need to be the first library loaded (though the earlier it's loaded, the faster things will be).Probably the most flexible way to do this would be to add a command-line parameter to recording that allows the user to inject an arbitrary string to be inserted into the tracee
LD_PRELOADbefore librrpreload. This would also let you generally add things traceeLD_PRELOADwithout injecting them into rr itself.It would be more convenient to have rr scan the libraries required by the tracee executable and automatically insert the required
LD_PRELOADso asan just works without any user intervention, but that's a bit more complicated and wouldn't solve some cases.rocallahan commentedon Jun 26, 2016
Then again, if we require a special command line parameter that's not very discoverable :-(.
rocallahan commentedon Jun 27, 2016
OK, I implemented the fully automatic approach in dc23125.
glandium commentedon Dec 3, 2016
I just hit this with rr 4.4 on Debian...
rocallahan commentedon Dec 5, 2016
If you run with
RR_LOG=RecordSessiondo you see the "Prepending ... to LD_PRELOAD" message?Pamplemousse commentedon Jun 30, 2021
I am encountering this error with
rrat version4.5.0, and my binary compiled withclang 11.1.0and ASAN as a shared library (-fsanitize=address -shared-libasan).No, I don't 😕
rocallahan commentedon Jul 1, 2021
This issue is long gone. Please follow #2892 instead.