Skip to content

[asan] Use standard POSIX code for AsanTSD (thread-specific data) han… - #15095

Merged
sbc100 merged 1 commit into
mainfrom
asan_thread_exit
Sep 22, 2021
Merged

sbc100 merged 1 commit into
mainfrom
asan_thread_exit

Conversation

@sbc100

@sbc100 sbc100 commented Sep 22, 2021

Copy link
Copy Markdown
Collaborator

…dling

As well use being less code to maintain and more shared code this also
enables thread exit handling which means ASan now tracks thread exit
where it didn't before. With the old/existing code noone was ever
calling the ASan thread destructor (passed as arg0 to AsanTSDInit).

I imagine this approach might not have been possible in the past since
there were some issues with using pthread_keys with destructors (e.g. #15086).

Testing by running entire asan test suite.

…dling

As well use being less code to maintain and more shared code this also
enables thread exit handling which means ASan now tracks thread exit
where it didn't before.  With the old/existing code noone was ever
calling the ASan thread destructor (passed as arg0 to AsanTSDInit).

I imagine this approach might not have been possible in the past since
there were some issues with using pthread_keys with destructors (e.g. #15086).

Testing by running entire `asan` test suite.
@sbc100
sbc100 requested a review from kripken September 22, 2021 17:45

// There's no initialization needed, and the passed-in destructor
// will never be called. Instead, our own thread destruction hook
// (below) will call AsanThread::TSDDtor directly.

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This was a lie ... looks like was copied asan_fuchsia.cpp where AsanThread::TSDDtor is actually called.

@sbc100
sbc100 requested a review from tlively September 22, 2021 17:55

@kripken kripken left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nice simplification!

@sbc100
sbc100 merged commit de04a79 into main Sep 22, 2021
@sbc100
sbc100 deleted the asan_thread_exit branch September 22, 2021 18:55
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants