Page MenuHomePhabricator

[sanitizer] Simplify ThreadDescriptorSize on i386/x86_64/s390
Needs ReviewPublic

Authored by MaskRay on Tue, Mar 30, 1:12 AM.


Group Reviewers
Restricted Project

ThreadDescriptorSize is only used by lsan to scan thread-specific data keys in
the thread control block.

On TLS Variant II architectures (i386/x86_64/s390), our dl_iterate_phdr
based approach can cover the region from the first byte of the static
TLS block (static TLS surplus) to the thread pointer.
We just need to extend the range to include the first few members of
struct pthread. offsetof(struct pthread, specific_used) satisfies
the requirement and has not changed since 2007-05-10. We don't need to
update ThreadDescriptorSize for each glibc version.

Diff Detail

Unit TestsFailed

150 msx64 windows >
Script: -- : 'RUN: at line 14'; c:\ws\w32-1\llvm-project\premerge-checks\build\bin\dsymutil.exe -oso-prepend-path C:\ws\w32-1\llvm-project\premerge-checks\llvm\test\tools\dsymutil\X86/../Inputs C:\ws\w32-1\llvm-project\premerge-checks\llvm\test\tools\dsymutil\X86/../Inputs/private/tmp/label/label.out -o C:\ws\w32-1\llvm-project\premerge-checks\build\test\tools\dsymutil\X86\Output\label2.test.tmp.dSYM

Event Timeline

MaskRay created this revision.Tue, Mar 30, 1:12 AM
MaskRay requested review of this revision.Tue, Mar 30, 1:12 AM
Herald added a project: Restricted Project. · View Herald TranscriptTue, Mar 30, 1:12 AM
MaskRay edited the summary of this revision. (Show Details)Tue, Mar 30, 1:13 AM
vitalybuka added inline comments.

we don't need atomic_load_relaxed on non-glibcversion path


why this works only for x86?