Skip to content

Conversation

@tommcdon
Copy link
Member

@tommcdon tommcdon commented Dec 8, 2025

Fix a recent regression in perfmaps caused by #116203
The fix changes fprintf usage in PerfMap::WriteLine to using

@tommcdon tommcdon added this to the 10.0.x milestone Dec 8, 2025
@tommcdon tommcdon requested a review from a team December 8, 2025 01:19
@tommcdon tommcdon self-assigned this Dec 8, 2025
Copilot AI review requested due to automatic review settings December 8, 2025 01:19
@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 regression in perfmap output caused by incorrect error checking in fprintf usage. The previous code treated successful writes as errors due to checking if the return value was not equal to zero, when fprintf actually returns the number of characters written (> 0) on success.

Key Changes

  • Replaced fprintf(m_fp, "%s", line.GetUTF8()) with a direct write() system call using the file descriptor
  • Fixed error checking to properly detect write failures and partial writes

@jkotas
Copy link
Member

jkotas commented Dec 8, 2025

cc @huoyaoyuan

@jkotas
Copy link
Member

jkotas commented Dec 8, 2025

Fix a recent regression in perfmaps caused by #116203
tommcdon added this to the 10.0.x milestone

#116203 was merge 3 weeks ago. It is not in .NET 10.

@tommcdon
Copy link
Member Author

tommcdon commented Dec 8, 2025

Fix a recent regression in perfmaps caused by #116203
tommcdon added this to the 10.0.x milestone

#116203 was merge 3 weeks ago. It is not in .NET 10.

Setting the milestone to 10.0 was an error on my part. The intent was to fix this in main only.

Copy link
Member

@jkotas jkotas left a comment

Choose a reason for hiding this comment

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

Thanks!

@tommcdon tommcdon merged commit 128db82 into dotnet:main Dec 8, 2025
99 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants