This is an archive of the discontinued LLVM Phabricator instance.

[LSan] Use __tls_get_addr interceptor to keep track of dynamic TLS.
ClosedPublic

Authored by samsonov on Jan 13 2016, 4:11 PM.

Details

Summary

We have a way to keep track of allocated DTLS segments: let's use it
in LSan. Although this code is fragile and relies on glibc
implementation details, in some cases it proves to be better than
existing way of tracking DTLS in LSan: marking as "reachable" all
memory chunks allocated directly by "ld".

The plan is to eventually get rid of the latter, once we are sure
it's safe to remove.

Diff Detail

Repository
rL LLVM

Event Timeline

samsonov updated this revision to Diff 44812.Jan 13 2016, 4:11 PM
samsonov retitled this revision from to [LSan] Use __tls_get_addr interceptor to keep track of dynamic TLS..
samsonov updated this object.
samsonov added a reviewer: kcc.
samsonov added a subscriber: llvm-commits.
kcc edited edge metadata.Jan 13 2016, 4:24 PM

code looks ok. is a test possible here?

I actually wanted to verify that code added here works by:
(1) adding a flag to optionally disable pre-existing DTLS handling (looking at allocations from "ld")
(2) checking that DTLS test we have passes with pre-existing DTLS handling disabled

I have failed to quickly construct an example for my glibc/ld that would be fixed by this code.
Let me know if you're fine with that plan.

kcc accepted this revision.Jan 13 2016, 4:51 PM
kcc edited edge metadata.

LGTM

This revision is now accepted and ready to land.Jan 13 2016, 4:51 PM
This revision was automatically updated to reflect the committed changes.