Skip to content

Code coverage failing for corelib #81835

Closed

Description

Trying to do code coverage on corelib (e.g. do code coverage for System.Collections.Concurrent's tests) results in failure:

Unhandled exception. System.ArgumentException: Value does not fall within the expected range.
     at System.Runtime.CompilerServices.RuntimeHelpers.GetSpanDataFrom(RuntimeFieldHandle fldHandle, RuntimeTypeHandle targetTypeHandle, Int32& count)
     at System.Runtime.CompilerServices.RuntimeHelpers.CreateSpan[T](RuntimeFieldHandle fldHandle) in D:\repos\runtime\src\libraries\System.Private.CoreLib\src\System\Runtime\CompilerServices\RuntimeHelpers.cs:line 100
     at System.DateTime.get_DaysToMonth365() in D:\repos\runtime\src\libraries\System.Private.CoreLib\src\System\DateTime.cs:line 124
     at System.DateTime.CreateDateTimeFromSystemTime(SYSTEMTIME& time, UInt64 hundredNanoSecond) in D:\repos\runtime\src\libraries\System.Private.CoreLib\src\System\DateTime.Windows.cs:line 112
     at System.DateTime.UpdateLeapSecondCacheAndReturnUtcNow() in D:\repos\runtime\src\libraries\System.Private.CoreLib\src\System\DateTime.Windows.cs:line 247
     at System.DateTime.get_UtcNow() in D:\repos\runtime\src\libraries\System.Private.CoreLib\src\System\DateTime.Windows.cs:line 34
     at System.DateTimeOffset.get_UtcNow() in D:\repos\runtime\src\libraries\System.Private.CoreLib\src\System\DateTimeOffset.cs:line 340
     at Xunit.XunitFilters.ChangeTrackingHashSet`1..ctor(IEqualityComparer`1 comparer) in /_/src/xunit.runner.utility/Project/XunitFilters.cs:line 280
     at Xunit.XunitFilters..ctor() in /_/src/xunit.runner.utility/Project/XunitFilters.cs:line 33
     at Xunit.XunitProject..ctor() in /_/src/xunit.runner.utility/Project/XunitProject.cs:line 17
     at Xunit.ConsoleClient.CommandLine.GetProjectFile(List`1 assemblies) in /_/src/Microsoft.DotNet.XUnitConsoleRunner/src/CommandLine.cs:line 85
     at Xunit.ConsoleClient.CommandLine.Parse(Predicate`1 fileExists) in /_/src/Microsoft.DotNet.XUnitConsoleRunner/src/CommandLine.cs:line 234
     at Xunit.ConsoleClient.CommandLine..ctor(String[] args, Predicate`1 fileExists) in /_/src/Microsoft.DotNet.XUnitConsoleRunner/src/CommandLine.cs:line 21
     at Xunit.ConsoleClient.CommandLine.Parse(String[] args) in /_/src/Microsoft.DotNet.XUnitConsoleRunner/src/CommandLine.cs:line 110
     at Xunit.ConsoleClient.ConsoleRunner.EntryPoint(String[] args) in /_/src/Microsoft.DotNet.XUnitConsoleRunner/src/ConsoleRunner.cs:line 31
     at Xunit.ConsoleClient.Program.Main(String[] args) in /_/src/Microsoft.DotNet.XUnitConsoleRunner/src/Program.cs:line 16

Failure from RuntimeHelpers.CreateSpan like this typically means the field being referenced isn't properly aligned. Does the coverlet collector do anything that might impact such alignment?

cc: @ViktorHofer, @MarcoRossignoli

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions