[PATCH] D29586: [lsan] Enable LSan for arm Linux

Maxim Ostapenko via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Wed Apr 5 09:50:12 PDT 2017


m.ostapenko added a comment.

In https://reviews.llvm.org/D29586#718621, @eugenis wrote:

> Going back to the issue with __interceptor_malloc not saving FP when built with GCC. In clang a function using __builtin_frame_address(0) automatically gets a proper frame pointer. As far as I can see, arm-gcc in the android ndk (version 4.9) behaves the same way on a simple test case. Is that some new optimization where a frame address is computed on the fly?


No, I just missed that GCC 4.8 emits **thumb** code by default on my Linaro Ubuntu 14.04 (configured with **--with-mode=thumb** switch). Passing **-marm** resolves the issue.



================
Comment at: lib/sanitizer_common/sanitizer_linux_libcdep.cc:202
     int minor = internal_simple_strtoll(buf + 8, &end, 10);
-    if (end != buf + 8 && (*end == '\0' || *end == '.')) {
+    if (end != buf + 8 && (*end == '\0' || *end == '.' || *end == '-')) {
       int patch = 0;
----------------
eugenis wrote:
> ygribov wrote:
> > m.ostapenko wrote:
> > > I don't really like this change . Perhaps we can create some white list of terminator symbols, or just drop the check?
> > Or just !isalpha(*end)?
> what exactly are we trying to avoid here? Something like 1.2abc ?
> This is where is comes from: https://gcc.gnu.org/bugzilla/show_bug.cgi?id=60038
Yeah, just filter out "strange" Glibc configurations.


================
Comment at: test/lsan/TestCases/swapcontext.cc:28
 int main(int argc, char *argv[]) {
-  char stack_memory[kStackSize + 1];
+  char stack_memory[kStackSize + 1] __attribute__((aligned(4)));
   char *heap_memory = new char[kStackSize + 1];
----------------
eugenis wrote:
> should it not be 16 for x86_64?
Yeah, x86_64 needs 16 here (not sure why did this work on my x86_64 box, perhaps my machine we OK with unaligned access).


Repository:
  rL LLVM

https://reviews.llvm.org/D29586





More information about the llvm-commits mailing list