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

Assertion failed 'value != 0' in 'System.Tests.DoubleTests_GenericMath:GetExponentShortestBitLengthTest()' during 'Do value numbering' #81460

Closed
MichalStrehovsky opened this issue Feb 1, 2023 · 7 comments · Fixed by #81516
Labels
area-CodeGen-coreclr CLR JIT compiler in src/coreclr/src/jit and related components such as SuperPMI

Comments

@MichalStrehovsky
Copy link
Member

ILC: Assertion failed 'value != 0' in 'System.Tests.DoubleTests_GenericMath:GetExponentShortestBitLengthTest()' during 'Do value numbering' (IL size 314; hash 0x60919730; FullOpts)
  
D:\a\_work\1\s\artifacts\bin\coreclr\windows.x64.Checked\build\Microsoft.NETCore.Native.targets(262,5): error MSB3073: The command ""D:\a\_work\1\s\artifacts\bin\coreclr\windows.x64.Checked\ilc-published\\ilc" @"D:\a\_work\1\s\artifacts\obj\System.Runtime.Tests\Release\net8.0-windows\native\System.Runtime.Tests.ilc.rsp"" exited with code 57005. [D:\a\_work\1\s\src\libraries\System.Runtime\tests\System.Runtime.Tests.csproj::TargetFramework=net8.0-windows]
##[error]artifacts\bin\coreclr\windows.x64.Checked\build\Microsoft.NETCore.Native.targets(262,5): error MSB3073: (NETCORE_ENGINEERING_TELEMETRY=Build) The command ""D:\a\_work\1\s\artifacts\bin\coreclr\windows.x64.Checked\ilc-published\\ilc" @"D:\a\_work\1\s\artifacts\obj\System.Runtime.Tests\Release\net8.0-windows\native\System.Runtime.Tests.ilc.rsp"" exited with code 57005.

This is failing the NativeAOT System.Runtime tests in runtime-extra-platform runs with checked runtime/release framework combo.

https://dev.azure.com/dnceng-public/public/_build/results?buildId=155217&view=logs&jobId=62c84a0c-1188-56fe-6938-e058a633beb1&j=62c84a0c-1188-56fe-6938-e058a633beb1&t=e508e8f5-7a40-5591-4aae-9625248f10c0

Looks to be related to #80789 cc @tannergooding

@MichalStrehovsky MichalStrehovsky added the area-CodeGen-coreclr CLR JIT compiler in src/coreclr/src/jit and related components such as SuperPMI label Feb 1, 2023
@ghost ghost added the untriaged New issue has not been triaged by the area owner label Feb 1, 2023
@ghost
Copy link

ghost commented Feb 1, 2023

Tagging subscribers to this area: @JulieLeeMSFT, @jakobbotsch, @kunalspathak
See info in area-owners.md if you want to be subscribed.

Issue Details
ILC: Assertion failed 'value != 0' in 'System.Tests.DoubleTests_GenericMath:GetExponentShortestBitLengthTest()' during 'Do value numbering' (IL size 314; hash 0x60919730; FullOpts)
  
D:\a\_work\1\s\artifacts\bin\coreclr\windows.x64.Checked\build\Microsoft.NETCore.Native.targets(262,5): error MSB3073: The command ""D:\a\_work\1\s\artifacts\bin\coreclr\windows.x64.Checked\ilc-published\\ilc" @"D:\a\_work\1\s\artifacts\obj\System.Runtime.Tests\Release\net8.0-windows\native\System.Runtime.Tests.ilc.rsp"" exited with code 57005. [D:\a\_work\1\s\src\libraries\System.Runtime\tests\System.Runtime.Tests.csproj::TargetFramework=net8.0-windows]
##[error]artifacts\bin\coreclr\windows.x64.Checked\build\Microsoft.NETCore.Native.targets(262,5): error MSB3073: (NETCORE_ENGINEERING_TELEMETRY=Build) The command ""D:\a\_work\1\s\artifacts\bin\coreclr\windows.x64.Checked\ilc-published\\ilc" @"D:\a\_work\1\s\artifacts\obj\System.Runtime.Tests\Release\net8.0-windows\native\System.Runtime.Tests.ilc.rsp"" exited with code 57005.

This is failing the NativeAOT System.Runtime tests in runtime-extra-platform runs with checked runtime/release framework combo.

https://dev.azure.com/dnceng-public/public/_build/results?buildId=155217&view=logs&jobId=62c84a0c-1188-56fe-6938-e058a633beb1&j=62c84a0c-1188-56fe-6938-e058a633beb1&t=e508e8f5-7a40-5591-4aae-9625248f10c0

Looks to be related to #80789 cc @tannergooding

Author: MichalStrehovsky
Assignees: -
Labels:

area-CodeGen-coreclr

Milestone: -

@EgorBo
Copy link
Member

EgorBo commented Feb 1, 2023

Presumably assert should just be removed from those helpers (or special cased to return value for 0)

@tannergooding
Copy link
Member

@EgorBo, the issue for BSR and BSF is that 0 as an input is undefined and there is an actual functional difference between them for Intel vs AMD and is documented as being "undefined".

Which is why all the usages in managed have an explicit path handling 0 (or in the case of Log2, doing value |= 1 first).

Likewise in importercalls we always introduce a (op1 == 0) ? ... : BSF (or (op1 == 0) ? ... : BSR) QMARK.

So it's unclear what is occurring that could lead to this and why it is only showing up in NativeAOT

@tannergooding
Copy link
Member

@MichalStrehovsky, what's the easiest way to repro this and see get a JIT dump?

@MichalStrehovsky
Copy link
Member Author

So it's unclear what is occurring that could lead to this and why it is only showing up in NativeAOT

Could this be because NativeAOT targets the minimum x64 we support and this is untested in libs tests outside NativeAOT? We had several of those.

@MichalStrehovsky, what's the easiest way to repro this and see get a JIT dump?

Follow this workflow:

### Running library tests
. Then you'll get a rsp file to invoke the compiler under obj. Invoke the compiler again with the rsp file and pass --codegenopt:JitDump=blah. Alternatively, you can add <ItemGroup><IlcArg Include="--codegenopt:JitDump=blah" /></ItemGroup> to the test project file.

@tannergooding
Copy link
Member

Could this be because NativeAOT targets the minimum x64 we support and this is untested in libs tests outside NativeAOT? We had several of those.

We also hit this for crossgen since lzcnt is "opportunistic" and we validate this path in the outerloop with the various Enable*=0 paths that all hit it currently passing.

It's possible its getting masked via some other env variable being set (maybe one of the JitStress ones?), but I don't initially see what could trigger it.

Follow this workflow:

Thanks! Will give this a try.

@MichalStrehovsky
Copy link
Member Author

We also hit this for crossgen since lzcnt is "opportunistic" and we validate this path in the outerloop with the various Enable*=0 paths that all hit it currently passing.

I think we don't run libs tests with crossgen - this is asserting while compiling a test in src/libraries. We'll do some limited crossgenning of libs tests after #80946, but likely not with extra COMPlus_ matrix. We're only equipped to find these bugs in src/tests.

@ghost ghost added the in-pr There is an active PR which will close this issue when it is merged label Feb 2, 2023
@ghost ghost removed in-pr There is an active PR which will close this issue when it is merged untriaged New issue has not been triaged by the area owner labels Feb 2, 2023
@ghost ghost locked as resolved and limited conversation to collaborators Mar 4, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
area-CodeGen-coreclr CLR JIT compiler in src/coreclr/src/jit and related components such as SuperPMI
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants