-
Notifications
You must be signed in to change notification settings - Fork 4.7k
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: System.Tests.StringTests/Ctor_CharSpan failed with "System.NullReferenceException" & "System.OutOfMemoryException" #23036
Comments
This looks like it's a new test that was added recently on PR dotnet/corefx#22673. @stephentoub is this supposed to work on uapaot? |
The ctor was added in dotnet/corert#4233, but if we don't have a uapaot leg in CI, it's possible it's not functioning correctly. What does it mean that it failed on line 15732480? cc: @jkotas |
I've never really trusted the line numbers since everything gets compiled and optimized into one executable so line numbers might be off. I can put this under the debugger and tell you exactly which line is failing. |
Line number 15732480 is 0xF00F00. 0xFEEFEE and 0xF00F00 are special. Cc @trylek @cshung if there's something that can be done about it. |
@MichalStrehovsky There are two tests that are failing, and I suspect that at least one of them is codegen bug. Test Ctor_CharSpan passes fine when ILCBuildType is set to chk so do you mind taking a look? Ctor_CharSpan_EmptyString test does seem to be an issue, which is throwing out of memory exception. I'll get the line numer details and a better callstack and hand it to @stephentoub |
@joperezr I have found the cause of the Ctor_CharSpan bug - there's a bug in Corelib, the String.Ctor method was not marked as "static". This basically caused a calling convention mismatch on amd64 as we were passing the ReadOnlySpan in rcx but the method expected it in rdx. It looks like unoptimized build happened to populate both registers with the proper reference to the span. Even though the Ctor_CharSpan_EmptyString is locally passing for me, I suspect that an OOM could be easily explained by this too (assuming you're talking about a runtime, not a compile-time OOM). I have already received sign-off on the fix from Michal, I'm about to check it in after finishing pre-checkin testing i.e. the fix should be included in tonight .NET Native drop. |
Oops! Thank you for investigating and fixing. |
It has been my pleasure Steve :-). The fix is in ProjectN as of CS #1669109. This is just for reference once the tests start failing again. |
fixed |
The OnProcessExit was iterating over the s_contextsToUnload and calling Unload on each of the contexts. However the s_contextsToUnload is a misnomer, it contains all the contexts, both collectible and non-collectible ones. So we were calling Unload on non-collectible contexts too there. That resulted in InvalidOperationException being thrown from the OnProcessExit. This change fixes that by calling unload only on ALCs whose IsCollectible returns true. It also renames the s_contextsToUnload to s_allContexts. Close #22902 Signed-off-by: dotnet-bot <dotnet-bot@microsoft.com>
The OnProcessExit was iterating over the s_contextsToUnload and calling Unload on each of the contexts. However the s_contextsToUnload is a misnomer, it contains all the contexts, both collectible and non-collectible ones. So we were calling Unload on non-collectible contexts too there. That resulted in InvalidOperationException being thrown from the OnProcessExit. This change fixes that by calling unload only on ALCs whose IsCollectible returns true. It also renames the s_contextsToUnload to s_allContexts. Close #22902 Signed-off-by: dotnet-bot <dotnet-bot@microsoft.com>
Opened on behalf of @JiayiLi1
The test
System.Tests.StringTests/Ctor_CharSpan(valueArray: ['a', 'b', 'c', 'd', 'e', ...], startIndex: 0, length: 12, expected: \"abcdefgh\\0ijk\")
has failed.System.NullReferenceException : Object reference not set to an instance of an object.
Build : Master - 20170803.01 (UWP ILC Tests)
Failing configurations:
Detail: https://mc.dot.net/#/product/netcore/master/source/official~2Fcorefx~2Fmaster~2F/type/test~2Ffunctional~2Filc~2F/build/20170803.01/workItem/System.Runtime.Tests/analysis/xunit/System.Tests.StringTests~2FCtor_CharSpan(valueArray:%20%5B'a',%20'b',%20'c',%20'd',%20'e',%20...%5D,%20startIndex:%200,%20length:%2012,%20expected:%20%5C%22abcdefgh%5C%5C0ijk%5C%22)
The text was updated successfully, but these errors were encountered: