Skip to content
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

Add more verifications in EventPipe rundownvalidation test. #89623

Conversation

lateralusX
Copy link
Member

Subtle changes done in:

#85558

like a change where one of the utf8->utf16 conversion routines changed behavior when passing in a string that is "" and len 0. In previous implementation it would return a new string "", but in new update change, it starts to return NULL. That in turn would cause some fields in some EventPipe events on Mono to fail serialize (using "" if value is not present), and that knocked out a couple of rundown events on Mono that was detected and fixed in #88634.

It would been ideal to catch this issue as part of CI, but turns out that our existing rundownvalidation test only tests a couple of rundown events, and not any of the module/assembly events that was affected by above change.

This commit adds validation that the following additional rundown events are included in the rundown event stream:

RuntimeStart
MethodDCStopInit
MethodDCStopComplete
LoaderModuleDCStop
LoaderDomainModuleDCStop
LoadAssemblyDCStop
LoadAppDomainDCStop

This would at least make sure the majority of important rundown events are present.

Subtle changes like:
dotnet@2f2aaae

Knocked out a couple of rundown events on Mono that was detected and
fixed in dotnet#88634.

It would been ideal to catch this issue as part of CI, but turns out
that our existing rundownvalidation test only tests a couple of rundown
events, and not any of the module/assembly events that was affected by
above change.

This commit adds validation that the following additional rundown events
are included in the rundown event stream:

RuntimeStart
MethodDCStopInit
MethodDCStopComplete
LoaderModuleDCStop
LoaderDomainModuleDCStop
LoadAssemblyDCStop
LoadAppDomainDCStop
@ghost
Copy link

ghost commented Jul 28, 2023

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

Issue Details

Subtle changes done in:

#85558

like a change where one of the utf8->utf16 conversion routines changed behavior when passing in a string that is "" and len 0. In previous implementation it would return a new string "", but in new update change, it starts to return NULL. That in turn would cause some fields in some EventPipe events on Mono to fail serialize (using "" if value is not present), and that knocked out a couple of rundown events on Mono that was detected and fixed in #88634.

It would been ideal to catch this issue as part of CI, but turns out that our existing rundownvalidation test only tests a couple of rundown events, and not any of the module/assembly events that was affected by above change.

This commit adds validation that the following additional rundown events are included in the rundown event stream:

RuntimeStart
MethodDCStopInit
MethodDCStopComplete
LoaderModuleDCStop
LoaderDomainModuleDCStop
LoadAssemblyDCStop
LoadAppDomainDCStop

This would at least make sure the majority of important rundown events are present.

Author: lateralusX
Assignees: lateralusX
Labels:

area-Diagnostics-coreclr, area-Diagnostics-mono

Milestone: -

@tommcdon tommcdon requested review from hoyosjs and davmason July 28, 2023 14:42
@am11
Copy link
Member

am11 commented Jul 29, 2023

@lateralusX, I didn't realize this difference in eventpipe. Thanks for the fix! Now that both coreclr and mono ep implementations end up calling the same minipal_{convert,get_length}_utf{16_to_utf8,8_to_utf16} APIs (via chain of wrappers), I think we can either move the ep wrapper to the common place under src/native/eventpipe or change the callsites to directly use minipal APIs. The minipal header inclusions, such as #include <minipal/utf8.h>, are available in global include paths for both mono and coreclr.

Copy link
Member

@davmason davmason left a comment

Choose a reason for hiding this comment

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

LGTM

@lateralusX lateralusX merged commit 177053e into dotnet:main Aug 2, 2023
@ghost ghost locked as resolved and limited conversation to collaborators Sep 1, 2023
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.

4 participants