Erik de Castro Lopo via llvm-dev
2017-Feb-06 07:35 UTC
[llvm-dev] Using ASAN on C code called from other languages
Hi all, I have haskell code that calls into C code and i'd like to compile the C code with ASAN. I've managed to convince the build system to compile the C code with '-fsanitize=address -g' (so that if I get a link errors of the ASAN library isn't linked) and then also managed to link libasan, but when my trivial test program with an obvious out-of-bounds access run, I don't get the ASAN error I was expecting. Is there some ASAN initialisation step that isn't happening? Any clues appreciated. Cheers, Erik -- ---------------------------------------------------------------------- Erik de Castro Lopo http://www.mega-nerd.com/
Kostya Serebryany via llvm-dev
2017-Feb-06 23:12 UTC
[llvm-dev] Using ASAN on C code called from other languages
I don't know anything about haskell, but if you post a minimal reproducer here we *may* be able to help. --kcc On Sun, Feb 5, 2017 at 11:35 PM, Erik de Castro Lopo via llvm-dev < llvm-dev at lists.llvm.org> wrote:> Hi all, > > I have haskell code that calls into C code and i'd like to compile the C > code with ASAN. I've managed to convince the build system to compile the > C code with '-fsanitize=address -g' (so that if I get a link errors of > the ASAN library isn't linked) and then also managed to link libasan, > but when my trivial test program with an obvious out-of-bounds access > run, I don't get the ASAN error I was expecting. > > Is there some ASAN initialisation step that isn't happening? > > Any clues appreciated. > > Cheers, > Erik > -- > ---------------------------------------------------------------------- > Erik de Castro Lopo > http://www.mega-nerd.com/ > _______________________________________________ > LLVM Developers mailing list > llvm-dev at lists.llvm.org > http://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-dev >-------------- next part -------------- An HTML attachment was scrubbed... URL: <http://lists.llvm.org/pipermail/llvm-dev/attachments/20170206/320f8747/attachment.html>
Erik de Castro Lopo via llvm-dev
2017-Feb-07 07:33 UTC
[llvm-dev] Using ASAN on C code called from other languages
Kostya Serebryany wrote:> I don't know anything about haskell, but if you post a minimal reproducer > here > we *may* be able to help.Its just so happens that I do have something here: https://github.com/erikd-ambiata/haskell-sanitize The Readme should have all the information you need. Any problems, please let mw know. Cheers, Erik -- ---------------------------------------------------------------------- Erik de Castro Lopo http://www.mega-nerd.com/
Seemingly Similar Threads
- Using ASAN on C code called from other languages
- ASAN not finding any bugs?
- [LLVMdev] radr://12777299, "potential pthread/eh bug exposed by libsanitizer"
- ASAN not finding any bugs?
- [LLVMdev] radr://12777299, "potential pthread/eh bug exposed by libsanitizer"