-
Notifications
You must be signed in to change notification settings - Fork 4.9k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[release/6.0] Use BOOL (vs. bool) in event pipe qcall signatures #81238
[release/6.0] Use BOOL (vs. bool) in event pipe qcall signatures #81238
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Assuming the DllImport
definitions weren't changed in .NET 6, this looks good.
The definitions changed in 7.0 slightly and we got more entries like this, so this is not an automated backport, but the fix is essentially the same: |
The DllImport in 6.0 does not specify bool marshaling explicitly, which means it defaults to 4-byte BOOL. //
// These PInvokes are used as part of the EventPipeEventDispatcher.
//
[DllImport(RuntimeHelpers.QCall, CharSet = CharSet.Unicode)]
internal static extern unsafe bool GetSessionInfo(ulong sessionID, EventPipeSessionInfo* pSessionInfo);
[DllImport(RuntimeHelpers.QCall, CharSet = CharSet.Unicode)]
internal static extern unsafe bool GetNextEvent(ulong sessionID, EventPipeEventInstanceData* pInstance); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
approved. we will take for consideration in 6.0.x
Closing and reopening to rebase the PR on top of the latest infra fixes merged to the branch. The CI had too many failures and the logs are unfortunately gone already. |
Backport of #74389 to release/6.0
Fixes: #81181
There is an API signature mismatch (C++
bool
vs. CBOOL
, 1 vs. 4 byte) when exporting native event pipe helpers, which causes occasional nondeterministic crashes in apps.Customer Impact
Applications that use EventSource and published as SingleFile will randomly crash with AccessViolationException.
(the crash may happen in non-singlefile configuration as well, in theory, but was not observed)
Testing
Manual validation of a repro scenario. (app crashes after a minute or so, no crash after the fix)
The same fix was ported to 7.0 a while ago and there is a lot of evidence that the crash no longer happens.
Risk
Low. We are fixing obviously incorrect signatures.