Skip to content

tsan: align globals and stack on 8-bytes #621

Open
@dvyukov

Description

@dvyukov

Tsan shadow granularity is 8-bytes. When several variables are collocated in the same 8-bytes, it can cause false negatives due to shadow slot eviction. In http://reviews.llvm.org/D14434 Kuba Brecka proposed to align globals on 8-bytes to mitigate this. We could also align stack variables.
Aligning stack variables will cause stack usage increase and can lead to crashes if program uses small stacks.
I am not sure whether it is worth it or not. In http://reviews.llvm.org/D14434 tsan still detected the race occasionally. And heap and structs will be left un-aligned.

Metadata

Metadata

Assignees

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions