Skip to content

Conversation

@max-charlamb
Copy link
Member

@max-charlamb max-charlamb commented Sep 3, 2025

Found while implementing ISOSDacInterface::GetSyncBlockData in the cDAC. #119320

The DAC version of this API is intended to iterate the SList of waiting threads with a maximum cap of 1000.
However, the pLink pointer is never actually modified in the loop so if there are any waiting threads, the API will always return the maximum cap.

@dotnet-policy-service
Copy link
Contributor

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

Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull Request Overview

This PR fixes a bug in the DAC (Data Access Component) implementation where the GetSyncBlockData API incorrectly counts waiting threads. The issue was that the loop iterator pLink was being assigned from the wrong source, causing an infinite loop condition that always returned the maximum cap of 1000 threads instead of the actual count.

Key Changes:

  • Fixed the loop iteration logic to properly traverse the linked list of waiting threads
  • Changed the assignment from pBlock->m_Link.m_pNext to pLink->m_pNext to advance the iterator

@max-charlamb max-charlamb requested a review from rcj1 September 3, 2025 14:14
Copy link
Contributor

@rcj1 rcj1 left a comment

Choose a reason for hiding this comment

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

LGTM

@max-charlamb max-charlamb merged commit 78913e4 into dotnet:main Sep 4, 2025
96 checks passed
@max-charlamb max-charlamb deleted the dac-syncblock branch September 4, 2025 14:00
@github-actions github-actions bot locked and limited conversation to collaborators Oct 5, 2025
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants