-
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
Sufficiently complex data type passed to EventSource results in invalid event data #27726
Comments
@noahfalk FYI. does look like a serialization bug. |
Following up on tip from @vancem. Changing the nullables to contain unique values for each byte: public int? N1 { get; set; } = unchecked((int)0x98765432);
public int? N2 { get; set; } = unchecked((int)0x98765432);
public int? N3 { get; set; } = unchecked((int)0x98765432);
public int? N4 { get; set; } = unchecked((int)0x98765432); Results in May not actually be an overrun, but obviously the value of the fourth nullable is affecting |
Yup. Definitely a bug. By the way, making the four values N1, N4 different (in every byte) in the test would make the test even better. e.g.
But that is a minor nit. |
That gives us -2039060991, which is the final 3 bytes of |
@jorive - we should probably understand this issue before we back-port the Nullable change to 2.1. If the issue is Nullable-specific (and @jbhensley testing suggested that it might be) then dotnet/corefx#20350 may have fixed one issue but exposed a second one. |
Test for this case added with https://github.com/dotnet/corefx/pull/32777/files |
@jbhensley would you have a standalone-self-contained repro? I just tried before and after the change and I could not repro the stomp, but I could see the original bug fix working. |
Just the branch referenced above. Note this particular set of tests have a |
@jbhensley Thanks, I overlooked the fact that in this case the tests were using EtwListener.cs. Now, I can see what you are describing. |
I spent more time looking at this bug and it seems like a deserialization bug on
which correspond to the following
In the latter, you can see Finally, these is the display from
|
This was determined to be a bug in the Microsoft.Diagnostics.Tracing.TraceEvent NuGet package. It has been fixed in V2.0.32 now up on nuget.org (see https://github.com/Microsoft/perfview/releases/tag/T2.0.32). If you upgrade the tests to use this version of TraceEvent, it should fix the problem |
Closing since this is not a CoreFX issue, and has been fixed in Microsoft.Diagnostics.Tracing.TraceEvent V2.0.32 and later |
See comment here.
Branch with repro code at this location
EDIT: referenced comment copied below for convenience.
I did note another error condition during my testing that we should look at, but I'll open a separate issue for it. For this test:
Modifying
UserData
by adding four nullables like so:results in invalid data coming back. If I dump the event, this is what I see:
Note that the fourth nullable disappears out of the payload and we appear to stomp on the memory space of
anInt
, changing its value from 5 to -255. This results in an assert fail atAssert.Equal(5, evt.PayloadValue(1, "anInt"));
.The concerning thing here is this looks suspiciously like a buffer overflow.
The text was updated successfully, but these errors were encountered: