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

Test failure: System.Runtime.Serialization.Formatters.Tests.BinaryFormatterTests/ValidateAgainstBlobs(obj: CookieContainer { Capacity = 10, Count = 1, MaxCookieSize = 1024, PerDomainCapacity = 5 }, blobs: [... #22562

Closed
ghost opened this issue Jun 29, 2017 · 42 comments · Fixed by dotnet/corefx#23285 or dotnet/corefx#23486
Assignees
Labels
area-System.Runtime os-mac-os-x macOS aka OSX test-bug Problem in test source code (most likely) test-run-core Test failures in .NET Core test runs
Milestone

Comments

@ghost
Copy link

ghost commented Jun 29, 2017

Opened on behalf of @danmosemsft

The test System.Runtime.Serialization.Formatters.Tests.BinaryFormatterTests/ValidateAgainstBlobs(obj: CookieContainer { Capacity = 10, Count = 1, MaxCookieSize = 1024, PerDomainCapacity = 5 }, blobs: [... has failed.

The stored blob for type System.Net.CookieContainer is outdated and needs to be updated.
Stored blob: AAEAAAD/////AQAAAAAAAAAMAgAAAElTeXN0ZW0sIFZlcnNpb249NC4wLjAuMCwgQ3VsdHVyZT1uZXV0cmFsLCBQdWJsaWNLZXlUb2tlbj1iNzdhNWM1NjE5MzRlMDg5BQEAAAAaU3lzdGVtLk5ldC5Db29raWVDb250YWluZXIGAAAADW1fZG9tYWluVGFibGUPbV9tYXhDb29raWVTaXplDG1fbWF4Q29va2llcxVtX21heENvb2tpZXNQZXJEb21haW4HbV9jb3VudA5tX2ZxZG5NeURvbWFpbgMAAAAAARxTeXN0ZW0uQ29sbGVjdGlvbnMuSGFzaHRhYmxlCAgICAIAAAAJAwAAAAAEAAAKAAAABQAAAAEAAAAGBAAAAAAEAwAAABxTeXN0ZW0uQ29sbGVjdGlvbnMuSGFzaHRhYmxlBwAAAApMb2FkRmFjdG9yB1ZlcnNpb24IQ29tcGFyZXIQSGFzaENvZGVQcm92aWRlcghIYXNoU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AAEAAAACRkAAAANAwUZAAAAEVN5c3RlbS5OZXQuQ29va2llFQAAAAltX2NvbW1lbnQMbV9jb21tZW50VXJpD21fY29va2llVmFyaWFudAltX2Rpc2NhcmQIbV9kb21haW4RbV9kb21haW5faW1wbGljaXQJbV9leHBpcmVzBm1fbmFtZQZtX3BhdGgPbV9wYXRoX2ltcGxpY2l0Bm1fcG9ydA9tX3BvcnRfaW1wbGljaXQLbV9wb3J0X2xpc3QIbV9zZWN1cmUKbV9odHRwT25seQttX3RpbWVTdGFtcAdtX3ZhbHVlCW1fdmVyc2lvbgttX2RvbWFpbktleQ9Jc1F1b3RlZFZlcnNpb24OSXNRdW90ZWREb21haW4BBAQAAQAAAQEAAQAHAAAAAQABAAAKU3lzdGVtLlVyaQIAAAAYU3lzdGVtLk5ldC5Db29raWVWYXJpYW50AgAAAAEBDQEBCAEBDQgBAQIAAAAJBAAAAAoF5f///xhTeXN0ZW0uTmV0LkNvb2tpZVZhcmlhbnQBAAAAB3ZhbHVlX18ACAIAAAABAAAAAAYcAAAACTEyNy4wLjAuMQAAAAAAAAAAAAYdAAAABW5hbWUxCRMAAAAACQQAAAABCgAAgFhsCQ2+tQgGIAAAAAV2YWx1ZQAAAAAJBwAAAAAACw==
Expected: True
Actual: False

    Stack Trace:

       at System.Runtime.Serialization.Formatters.Tests.BinaryFormatterTests.ValidateAgainstBlobs(Object obj, String[] blobs) in /Users/buildagent/agent/_work/45/s/corefx/src/System.Runtime.Serialization.Formatters/tests/BinaryFormatterTests.cs:line 62

Build : Master - 20170626.01 (Core Tests)
Failing configurations:

  • OSX.1013.Amd64-x64
    • Release
  • OSX.1012.Amd64-x64
    • Release
@danmoseley danmoseley assigned tarekgh and joperezr and unassigned tarekgh Jun 29, 2017
@danmoseley
Copy link
Member

danmoseley commented Jun 29, 2017

@joperezr Mac issue I mentioned

I decoded and I see
<<m_SortVersionculture ? System.Globalization.SortVersion???en-US
>>m_SortVersionculture ? System.Globalization.SortVersion

@ViktorHofer says The good thing: The serialization payload isn’t missing any fields, all names are in it. Only the value at the end of the payload is missing: en-US. After a quick look it seems like en-US is the value of the field m_name in CompareInfo. I don’t know why it is missing in the payload only for OSX. Was this the first time it failed? Maybe this has to do with some production code differences of CompareInfo on OSX?

@danmoseley
Copy link
Member

Ask @ViktorHofer if you need help

@joperezr
Copy link
Member

I can't repro this on my Mac, I have 10.12.5 (16F73) version installed and running latest master netcoreapp tests on Release configuration.

@joperezr
Copy link
Member

I checked the RuntimeInformation of the test that @danmosemsft added, and here are the differences:

RuntimeInfo of my machine (test passes)

OS=Darwin 16.6.0 Darwin Kernel Version 16.6.0: Fri Apr 14 16:21:16 PDT 2017; root:xnu-3789.60.24~6/RELEASE_X86_64 OSVer=Unix 16.6.0.0 OSArch=X64 Arch=X64 Framework=.NET Core 4.6.00001.0

Runtime Info on Helix (tests do not pass)

OS=Darwin 16.4.0 Darwin Kernel Version 16.4.0: Thu Dec 22 22:53:21 PST 2016; root:xnu-3789.41.3~3/RELEASE_X86_64 OSVer=Unix 16.4.0.0 OSArch=X64 Arch=X64 Framework=.NET Core 4.6.00001.0

@ViktorHofer
Copy link
Member

ViktorHofer commented Jul 4, 2017

Yes I'm investigating and was following up on that here: dotnet/corefx#21734

If I don't find the root cause by today I will just disable this one blob sanity check for CookieContainer. I still think it's somehow related to reflection...

@ViktorHofer
Copy link
Member

ViktorHofer commented Jul 4, 2017

@tarekgh we get different results when serializing a CookieContainer object which has a CompareInfo object in it on OSX. The serialized blob doesn't contain the m_name field value: https://www.diffchecker.com/wIO3OQ2U

This is the serialized object: new System.Net.CookieContainer(10, 5, 1024);

Any idea why this is happening? As you can read above this isn't happening on Darwin 16.6 but on Darwin 16.4.

@tarekgh
Copy link
Member

tarekgh commented Jul 5, 2017

we get different results when serializing a CookieContainer object which has a CompareInfo object in it on OSX. The serialized blob doesn't contain the m_name field value:

are we running on exactly same environment? I mean I am seeing in the original serialization data en-US is used. Are we using exactly the same on OSX? could be the used culture is the Invariant which has empty string name?

@ViktorHofer
Copy link
Member

Yes, it's the same test which passed on Windows but failed on OSX (Darwin 16.4). I'm not 100% sure which Culture is used for the CookieContainer. Will check later.

@danmoseley
Copy link
Member

I saw this cookiecontainer failure on a Unix run yesterday..

@ViktorHofer
Copy link
Member

Could be. But what I'm asking Tarek here is about the missing field name value. If you saw the test falling it could be something else in the blob.

@danmoseley
Copy link
Member

I can't find the Unix failure now -- it was in a PR. I see SortedList failing in 2.0 now (I guess this run had the change to skip CookieContainer):

https://mc.dot.net/#/product/netcore/200/source/official~2Fcorefx~2Frelease~2F2.0.0~2F/type/test~2Ffunctional~2Fcli~2F/build/20170705.02/workItem/System.Runtime.Serialization.Formatters.Tests/analysis/xunit/System.Runtime.Serialization.Formatters.Tests.BinaryFormatterTests~2FValidateAgainstBlobs(obj:%20%5B%5D,%20blobs:%20%5B%5C%22AAEAAAD~2F~2F~2F~2F~2FAQAAAAAAAAAEAQAAAB1TeXN0ZW0uQ29sbGVjdG%5C%22...,%20%5C%22AAEAAAD~2F~2F~2F~2F~2FAQAAAAAAAAAEAQ...

The stored blob for type System.Collections.SortedList is outdated and needs to be updated.\nStored blob: AAEAAAD/////AQAAAAAAAAAEAQAAAB1TeXN0Z...

@joperezr
Copy link
Member

joperezr commented Jul 7, 2017

Assinging to @ViktorHofer since he was looking into this.

@joperezr joperezr assigned ViktorHofer and unassigned joperezr Jul 7, 2017
@ViktorHofer
Copy link
Member

Yes, but I'm currently at an internal event. I can look into it earliest by Sunday.

@ViktorHofer
Copy link
Member

@safern The log you posted is a different issue (AdjustmentRule type, not CookieContainer type).

@safern
Copy link
Member

safern commented Jul 19, 2017

@safern The log you posted is a different issue (AdjustmentRule type, not CookieContainer type).

You're right. Deleting my comment.

@danmoseley
Copy link
Member

The failure now is The stored blob for type System.TimeZoneInfo is outdated and needs to be updated

https://mc.dot.net/#/product/netcore/uwp60/source/official~2Fcorefx~2Frelease~2Fuwp6.0~2F/type/test~2Ffunctional~2Fuwp~2F/build/20170725.01/workItem/System.Runtime.Serialization.Formatters.Tests/analysis/xunit/System.Runtime.Serialization.Formatters.Tests.BinaryFormatterTests~2FValidateAgainstBlobs(obj:%20UTC,%20blobs:%20%5B%5C%22AAEAAAD~2F~2F~2F~2F~2FAQAAAAAAAAAMAgAAAE5TeXN0ZW0uQ29yZSwgVm%5C%22...,%20%5C%22AAEAAAD~2F~2F~2F~2F~2FAQAAAAAAAAAMA...

@tarekgh 's workaround in ae66307 looks like it was for TimeZoneInfo.AdjustmentRule only.

@ViktorHofer @tarekgh do we need to add TimeZoneInfo itself as a workaround?
Also do we plan to converge the implementations (the "real fix") in UWP60 or only in master?

@tarekgh
Copy link
Member

tarekgh commented Jul 25, 2017

@ViktorHofer may need to investigate why we are getting this serialization failure and possibly fix the test. We decided the code unification effort will not be done for UWP6.0

@danmoseley
Copy link
Member

Moved out of UWP milestone.

@ViktorHofer
Copy link
Member

Code unification of TimeZoneInfo is a non goal for UWP6.0 but for .NET Core 2.1.

The test wasn't failing before and I am not sure why it's failing now. So the required work here is to

  • fix the test in uwp6.0
  • Finish converging TimeZoneInfo code and update blobs in master

I'm on it.

@ViktorHofer
Copy link
Member

Found the failure. The Culture=neutral casing is different (which I fixed a while ago).

Stored blob:
\0\u0001\0\0\0????\u0001\0\0\0\0\0\0\0\f\u0002\0\0\0NSystem.Core, Version=3.5.0.0, Culture=neutral

Runtime generated blob:
\0\u0001\0\0\0????\u0001\0\0\0\0\0\0\0\f\u0002\0\0\0NSystem.Core, Version=3.5.0.0, Culture=Neutral

I'm not exactly sure which codebase the UWP F5 tests are picking up as both coreclr and corert TimeZoneInfo versions have the lower cased Culture=neutral which is correct.

@ViktorHofer
Copy link
Member

I thought the F5 tests would use the coreclr release/uwp6.0 branch: https://github.com/dotnet/coreclr/blob/release/uwp6.0/src/mscorlib/src/System/TimeZoneInfo.cs#L32

@ViktorHofer
Copy link
Member

I can't repro that locally. It seems to be somehow related to a CI package mismatch. Closing for now.

@KristinXie1 KristinXie1 reopened this Jul 27, 2017
@danmoseley
Copy link
Member

@ViktorHofer decoded, basically same as I noted above earlier,

<<m_SortVersionculture ? System.Globalization.SortVersion???en-US
>>m_SortVersionculture ? System.Globalization.SortVersion

On OSX both versions, the en-US is expected but it is not present causing the test to fail.

@ViktorHofer
Copy link
Member

ViktorHofer commented Aug 7, 2017

It's a long standing issue now... Do we have OSX 10.12/10.13 machines I can connect to? I don't have one myself. I will probably also need help from @tarekgh.

@tarekgh
Copy link
Member

tarekgh commented Aug 7, 2017

@ViktorHofer let me know how I can help you here

@danmoseley
Copy link
Member

I assume @tarekgh has a machine as he has some other 10.13 issues to take care of. If not Priya does.

@tarekgh
Copy link
Member

tarekgh commented Aug 7, 2017

I don't have 10.13 machine but we had a remote which can be used. I'll communicate the details to @ViktorHofer

@KristinXie1 KristinXie1 reopened this Aug 18, 2017
@tarekgh
Copy link
Member

tarekgh commented Aug 18, 2017

@ViktorHofer do you know if this run has your fix?

@ViktorHofer
Copy link
Member

The PR was merged 22 hours ago so I expect the fix to be in it. But setting the culture helped because CookieContainer isn't failing anymore! Now DataTable is failing, I just discovered that the serialized xml contains a line which stores the culture:

<xs:element name="DataSet123" msdata:IsDataSet="true" msdata:Locale="en-US">

I need to update the stored blobs. I don't know why that only fails on OSX.

@tarekgh
Copy link
Member

tarekgh commented Aug 18, 2017

I need to update the stored blobs. I don't know why that only fails on OSX.

most likely is the OSX machine doesn't have en-US as the user language and instead, we use invariant.

@ViktorHofer
Copy link
Member

So should I instead use Invariant for all the tests?

@tarekgh
Copy link
Member

tarekgh commented Aug 18, 2017

You need to ensure having the same culture used in the serialized stream and when the test runs. If you can enforce specific culture in the serialized stream and have the same culture used in test validation that will guarantee same results. choosing Invariant is good.

@ViktorHofer
Copy link
Member

ViktorHofer commented Aug 19, 2017

Still failing: https://mc.dot.net/#/product/netcore/master/source/official~2Fcorefx~2Fmaster~2F/type/test~2Ffunctional~2Fcli~2F/build/20170819.01/workItem/System.Runtime.Serialization.Formatters.Tests/analysis/xunit/System.Runtime.Serialization.Formatters.Tests.BinaryFormatterTests~2FValidateAgainstBlobs(obj:%20System.Data.DataSet,%20blobs:%20%5B%5C%22AAEAAAD~2F~2F~2F~2F~2FAQAAAAAAAAAMAgAAAE5TeXN0ZW0uRGF0YSwgVm%5C%22...,%20%5C%22AAEAAAD~2F~2F...

@tarekgh why is OSX always behaving differently? Now with InvariantCulture the difference is the following:

Stored DataSet blob line:
<xs:element name="DataSet123" msdata:IsDataSet="true" msdata:Locale="">

Runtime generated DataSet blob line:
<xs:element name="DataSet123" msdata:IsDataSet="true" msdata:UseCurrentLocale="true">

@tarekgh
Copy link
Member

tarekgh commented Aug 21, 2017

Looking at the code

https://github.com/dotnet/corefx/blob/81506698c8355a23a1c5269b5fdeebd6fa94d687/src/System.Data.Common/src/System/Data/xmlsaver.cs#L1044

the check

                    !dt.Locale.Equals(CultureInfo.CurrentCulture)

I believe the OSX run has current culture is invariant which will cause setting

        _dsElement.SetAttribute(Keywords.MSD_USECURRENTLOCALE, Keywords.MSDNS, Keywords.TRUE);

Your test has to handle this as the type is producing different serialization data depending on the current culture.

@danmoseley
Copy link
Member

BTW @ViktorHofer maybe improve ValidateAgainstBlobs to log the decoded blobs .. would be easier since I don't thikn we've seen the last of ValidateAgainstBlobs...

@msftgits msftgits transferred this issue from dotnet/corefx Jan 31, 2020
@msftgits msftgits added this to the 2.1.0 milestone Jan 31, 2020
@ghost ghost locked as resolved and limited conversation to collaborators Dec 22, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
area-System.Runtime os-mac-os-x macOS aka OSX test-bug Problem in test source code (most likely) test-run-core Test failures in .NET Core test runs
Projects
None yet
8 participants