need to instrument thread-local globals #12

Open
ramosian-glider opened this Issue Aug 31, 2015 · 1 comment

Comments

Projects
None yet
3 participants
Member

ramosian-glider commented Aug 31, 2015

Originally reported on Google Code with ID 12

Currently, asan does not instrument thread-local globals, but it should. 

Two problems here: 

1. The address of main thread's thread-local is not available at the link time where
we currently form the array which will be passed to __asan_register_globals

2. Need to poison the non-main-thread's copies somehow. 

Reported by konstantin.s.serebryany on 2011-11-23 02:38:42

Member

ramosian-glider commented Aug 31, 2015

For the main executable we can keep a stencil corresponding to the .tls segment with
poisoned redzones (the redzone positions are determined using a function similar to
__asan_register_globals). In the pthread_create callback we can copy that stencil over
the current thread's TLS, which is usually before the thread's stack.


For the shared libraries it's a little bit trickier, because their TLS data is stored
in a two-level map.

Reported by ramosian.glider on 2012-02-01 16:05:18

@kcc kcc assigned kcc and unassigned google Dec 2, 2015

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment