[PATCH] [lsan] [mips] adding support of lsan for mips64/mips64el arch

Sergey Matveev earthdok at google.com
Thu Nov 20 10:59:17 PST 2014


Something must be wrong with your checkout. For me `ninja check-sanitizer` starts failing when I reverse the assertions in the test.

>>! In D5616#59, @kumarsukhani wrote:
> @earthdok: with check-sanitizer also I see no failures because of above changes in assertion.
> 
> Can you please commit this current version of patch ? if no more changes are require
> I will update lib/sanitizer_common/tests/sanitizer_linux_test.cc file so that same check works for mips.
> What do you think ?

I'm sorry, I'm not comfortable committing without this test. This has caused far too many issues in the past.

By the way, I looked at the Glibc sources and it turns out your TLS calculation is incorrect even if ThreadDescriptorSize() is correct. Consider _dl_allocate_tls_storage():

```
332 #if TLS_DTV_AT_TP
333   /* Memory layout is:
334      [ TLS_PRE_TCB_SIZE ] [ TLS_TCB_SIZE ] [ TLS blocks ]
335                           ^ This should be returned.  */
336   size += (TLS_PRE_TCB_SIZE + GL(dl_tls_static_align) - 1)
337           & ~(GL(dl_tls_static_align) - 1);
338 #endif
```

The size we get from _dl_get_tls_static_info is GL(dl_tls_static_align). This means that the upper TLS boundary as you compute it is off by TLS_PRE_TCB_SIZE.

We have very few tests for this stuff so please make sure you understand thoroughly how TLS is laid out - don't just rely on tests passing.

http://reviews.llvm.org/D5616






More information about the llvm-commits mailing list