-
Notifications
You must be signed in to change notification settings - Fork 4.8k
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
[EventPipe] Null passed as an event argument causes crash #12662
Comments
@brianrob Is this an expected behavior that's working as design? I tried something similar on Framework and it doesn't seem to be throwing there. Just wanted to know what the correct behavior should be here before I put out a "fix" :-) |
@sywhang, I would expect a null argument passed for |
I think the function being called here is |
Right - every manifest based event is implemented as something that looks like this:
There are various overloads of WriteEvent to avoid the array allocation and subsequent boxing associated with param object[], but if there isn't a specialized overload for the set of arguments to the event then the compiler will bind to So even though you see the exception inside fo |
I got tripped by that today. I have tracing in place and sometimes one of the write event parameters (type string) is null, most of the time it's not. So first it look all hunky dory then I get this back from customer traces:
|
I'm guessing the underlying issue may still actionable even if the test is gone or moved. Given that the bug is 3 years old there was probably some churn in the tests since then. The only way to know for sure would be to recreate a new test case that hits the issue. From the description it appears you would need to create an EventSource that takes a reference type argument such as a string and then pass null to it. Hope that helps! |
@JJamesWWang The introduction for EventSource is at https://learn.microsoft.com/dotnet/core/diagnostics/eventsource-getting-started. You could also try searching in git and check the history to recover the old test source that existed in 2019. |
Test:
coreclr\tests\src\tracing\eventsource\eventsourcetrace\EventSourceTrace.cs
Line 23:
this.WriteEvent(1, x, y, z, null);
The text was updated successfully, but these errors were encountered: