Skip to content

Conversation

ericstj
Copy link
Member

@ericstj ericstj commented Jul 29, 2024

Fix #100198.

This Windows API will still try to write to a buffer if you tell it the buffer is 0 length and the string you're reading happens to be 0 length. We previously avoided an AV here because we were passing a StringBuilder, but that changed with the interop generator refactoring which passed null. Avoid the bug that by passing in a 1-character buffer rather than null.

I've tested manually using the file provided in the issue repro. I'll poke around a bit to see if I can manage to get a regression test for this without using the customer file but for now just sharing the fix.

Copy link
Contributor

Tagging subscribers to this area: @dotnet/area-system-diagnostics-eventlog
See info in area-owners.md if you want to be subscribed.

Copy link
Member

@jkoritzinsky jkoritzinsky left a comment

Choose a reason for hiding this comment

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

Use collection expressions? Other than that, looks good.

Copy link
Contributor

@carlossanlop carlossanlop left a comment

Choose a reason for hiding this comment

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

I'll poke around a bit to see if I can manage to get a regression test for this without using the customer file but for now just sharing the fix.

Yes that would be great.

Otherwise, this LGTM.

@ericstj
Copy link
Member Author

ericstj commented Jul 30, 2024

Corrected some mismatched active issues, filed a new active issue for a test crash in linq.expressions. With that BA is passing.

@ericstj
Copy link
Member Author

ericstj commented Jul 31, 2024

/backport to release/8.0-staging

Copy link
Contributor

Started backporting to release/8.0-staging: https://github.com/dotnet/runtime/actions/runs/10183531351

@github-actions github-actions bot locked and limited conversation to collaborators Aug 31, 2024
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.

EventLogRecord.TaskDisplayName throws System.AccessViolationException and termintates the program
4 participants