Skip to content

[NFC][sanitizer] Update DTLS_on_tls_get_addr failure comment #109546

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 10 additions & 2 deletions compiler-rt/lib/sanitizer_common/sanitizer_tls_get_addr.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -158,10 +158,18 @@ DTLS::DTV *DTLS_on_tls_get_addr(void *arg_void, void *res,
return dtv;
}
VReport(2, "__tls_get_addr: Can't guess glibc version\n");
// This may happen inside the DTOR of main thread, so just ignore it.
// This may happen inside the DTOR a thread, or async signal handlers before
// thread initialization, so just ignore it.
//
// If the unknown block is dynamic TLS, unlikely we will be able to recognize
// it in future, mark it as done with '{tls_beg, 0}'.
//
// If the block is static TLS, possible reason of failed detection is nullptr
// in `static_tls_begin`. Regardless of reasons, the future handling of static
// TLS is still '{tls_beg, 0}'.
dtv->beg = tls_beg;
dtv->size = 0;
return dtv;
return nullptr;
}

DTLS *DTLS_Get() { return &dtls; }
Expand Down
Loading