Skip to content

Remove redundant event thread null check in Cordb::Terminate - #136653

Merged
rcj1 merged 1 commit into
dotnet:mainfrom
RutulPatel8:fix/cordb-terminate-event-thread-47463
Oct 31, 2026
Merged

rcj1 merged 1 commit into
dotnet:mainfrom
RutulPatel8:fix/cordb-terminate-event-thread-47463

Conversation

@RutulPatel8

Copy link
Copy Markdown
Contributor

Summary

Remove the redundant m_rcEventThread null check in Cordb::Terminate. Initialize sets m_initialized only after creating and starting this thread, and Terminate already dereferences it before the checked block. The later check therefore cannot protect against a null thread.

Fixes #47463.

Validation

  • git diff --check passed.
  • build.cmd clr -c Release restored dependencies, then stopped before native compilation because Visual Studio 2022 C++ tools are not installed on this machine. CI will validate the native build.

@dotnet-policy-service dotnet-policy-service Bot added the community-contribution Indicates that the PR has been added by a community member label Oct 29, 2026
@azure-pipelines

Copy link
Copy Markdown
Azure Pipelines:
Successfully started running 3 pipeline(s).
13 pipeline(s) were filtered out due to trigger conditions.
There may be pipelines that require an authorized user to comment /azp run to run.

@dotnet-policy-service

Copy link
Copy Markdown
Contributor

Tagging subscribers to this area: @steveisok, @tommcdon, @dotnet/dotnet-diag
See info in area-owners.md if you want to be subscribed.

@RutulPatel8

Copy link
Copy Markdown
Contributor Author

@dotnet/dotnet-diag Could an area maintainer review this PR? It addresses #47463 by removing a null check that follows an unconditional dereference. Initialize sets m_initialized only after the event thread starts, so the check cannot protect this path. All CI checks have completed without failures. Thanks!

@rcj1
rcj1 merged commit d02edc2 into dotnet:main Oct 31, 2026
113 checks passed
@dotnet-milestone-bot dotnet-milestone-bot Bot added this to the 12.0-preview1 milestone Nov 4, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

area-Diagnostics-coreclr community-contribution Indicates that the PR has been added by a community member

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Null checks in incorrect order in Cordb::Terminate

2 participants