This is an archive of the discontinued LLVM Phabricator instance.

Port LSan to ARM Linux
AbandonedPublic

Authored by m.ostapenko on Apr 16 2014, 11:06 PM.

Details

Reviewers
kcc
samsonov
Summary

This patch provides initial LSan support for ARM Linux (TLS is not yet supported).

Compiler-rt doesn't support cross-compilation, so we just ran numerous (for about 10) LSan tests manually on target board.
All tests have successfully passed (all leaks were detected and backtraces were correct).

Tested on arm-linux-gnueabi.

Diff Detail

Event Timeline

As noted in https://code.google.com/p/address-sanitizer/issues/detail?id=294#c3,
lsan's job is much harder on 32-bit arch than on a 64-bit arch.
Beware that on a 32-bit arch false negatives (missing a leak) are much more probable

Do you have any plans on setting a public build bot for asan on ARM?

lsan/lsan_allocator.cc
49

instead of duplicating this struct here, please move it out of ifdef and use FIRST_32_SECOND_64(54, 22)

Also, why do you think 22 bits is enough?

58

#endif // SANITIZER_WORDSIZE

60

A comment explaining 3UL<<27 would be nice. I know 32-bit systems that can allocate more.

lsan/lsan_common.cc
251

can you use if() instead of #ifdef?
E.g. simply disable lags()->use_tls on arm?

m.ostapenko abandoned this revision.May 5 2014, 11:29 PM

Cancelled.