isoalloc icon indicating copy to clipboard operation
isoalloc copied to clipboard

Enable sanitizers in the testsuite

Open jvoisin opened this issue 3 years ago • 1 comments

It would be nice to enable things like -fsanitize=undefined and -fsanitize=leak, to catch weird™ things.

jvoisin avatar Aug 03 '22 10:08 jvoisin

UBSan should already be supported via ENABLE_UBSAN and there is a built in leak detector via iso_alloc_detect_leaks. I'd have to look into how -fsanitize=leak would work with IsoAlloc. You can add the flag to CFlags and things will run but I'd need to look at the implementation to ensure its not bypassing IsoAlloc interfaces.

struct avatar Aug 06 '22 13:08 struct

Did some quick research here and LeakSanitizer does not look compatible with IsoAlloc today.

struct avatar Dec 16 '22 19:12 struct

Can you please elaborate/add a note somewhere about why it's incompatible?

jvoisin avatar Dec 17 '22 14:12 jvoisin

LSan intercepts malloc/free and replaces it. It's not intended to be used with other allocators.

https://github.com/llvm/llvm-project/tree/2e999b7dd1934a44d38c3a753460f1e5a217e9a5/compiler-rt/lib/lsan

struct avatar Dec 17 '22 16:12 struct