Skip to content

fix: Resolve a TSan warning for ShaderCompilerService#9792

Open
z3moon wants to merge 1 commit intomainfrom
zm/fix-tsan-scs
Open

fix: Resolve a TSan warning for ShaderCompilerService#9792
z3moon wants to merge 1 commit intomainfrom
zm/fix-tsan-scs

Conversation

@z3moon
Copy link
Contributor

@z3moon z3moon commented Mar 11, 2026

When the backend thread checks the availability of the token, it directly accesses gl.program, which caused a TSan warning.

BUGS=[491819760]

When the backend thread checks the availability of the token, it
directly accesses `gl.program`, which caused a TSan warning.

BUGS=[491819760]
@z3moon z3moon added the internal Issue/PR does not affect clients label Mar 11, 2026
Copy link
Collaborator

@pixelflinger pixelflinger left a comment

Choose a reason for hiding this comment

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

LGTM, but I think the code could have a few more comments

return;// It's ready.
if (mMode == Mode::THREAD_POOL) {
if (token->isReady()) {
return;
Copy link
Collaborator

Choose a reason for hiding this comment

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

shouldn't we also check or assert that token->gl.program is not zero?

return false;
}
token->retrievedFromBlobCache = true;
token->signal();
Copy link
Collaborator

Choose a reason for hiding this comment

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

mayeb add a comment that this acts as a "release" for token->gl.program

if (token->gl.program) {
return;// It's ready.
if (mMode == Mode::THREAD_POOL) {
if (token->isReady()) {
Copy link
Collaborator

Choose a reason for hiding this comment

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

maybe add a comment that this acts as "acquire" for token->gl.program

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

Labels

internal Issue/PR does not affect clients

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants