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

[NativeAOT] Assertion failed 'node->IsUnusedValue() && "found an unmarked unused value"' - when compiling System.Net.Sockets.Tests #84112

Closed
VSadov opened this issue Mar 30, 2023 · 9 comments · Fixed by #84155
Assignees
Labels
area-CodeGen-coreclr CLR JIT compiler in src/coreclr/src/jit and related components such as SuperPMI
Milestone

Comments

@VSadov
Copy link
Member

VSadov commented Mar 30, 2023

    // At this point the unusedDefs map should contain only unused values.
    if (checkUnusedValues)
    {
        for (auto kvp : unusedDefs)
        {
            GenTree* node = kvp.Key();
            assert(node->IsUnusedValue() && "found an unmarked unused value");      <==== here
            assert(!node->isContained() && "a contained node should have a user");
        }
    }
 	KernelBase.dll!wil::details::DebugBreak(void)	Unknown
>	clrjit_win_x64_x64.dll!assertAbort(const char * why, const char * file, unsigned int line) Line 304	C++
 	clrjit_win_x64_x64.dll!LIR::Range::CheckLIR(Compiler * compiler, bool checkUnusedValues) Line 1692	C++
 	[Inline Frame] clrjit_win_x64_x64.dll!Lowering::CheckBlock(Compiler * compiler, BasicBlock *) Line 7351	C++
 	[Inline Frame] clrjit_win_x64_x64.dll!Lowering::LowerBlock(BasicBlock *) Line 7382	C++
 	clrjit_win_x64_x64.dll!Lowering::DoPhase() Line 7151	C++
 	clrjit_win_x64_x64.dll!Phase::Run() Line 62	C++
 	clrjit_win_x64_x64.dll!Compiler::compCompile(void * * methodCodePtr, unsigned int * methodCodeSize, JitFlags * compileFlags) Line 5088	C++
 	clrjit_win_x64_x64.dll!Compiler::compCompileHelper(CORINFO_MODULE_STRUCT_ * classPtr, ICorJitInfo * compHnd, CORINFO_METHOD_INFO * methodInfo, void * * methodCodePtr, unsigned int * methodCodeSize, JitFlags * compileFlags) Line 7025	C++
 	[Inline Frame] clrjit_win_x64_x64.dll!Compiler::compCompile::__l164::__Body::Run(Compiler::compCompile::__l2::__JITParam *) Line 6181	C++
 	clrjit_win_x64_x64.dll!Compiler::compCompile(CORINFO_MODULE_STRUCT_ * classPtr, void * * methodCodePtr, unsigned int * methodCodeSize, JitFlags * compileFlags) Line 6185	C++
 	[Inline Frame] clrjit_win_x64_x64.dll!jitNativeCode::__l8::__Body::Run::__l6::__Body::Run(jitNativeCode::__l8::__Body::Run::__l5::__JITParam *) Line 7668	C++
 	clrjit_win_x64_x64.dll!`jitNativeCode'::`8'::__Body::Run(jitNativeCode::__l2::__JITParam * __JITpParam) Line 7671	C++
 	clrjit_win_x64_x64.dll!jitNativeCode(CORINFO_METHOD_STRUCT_ * methodHnd, CORINFO_MODULE_STRUCT_ * classPtr, ICorJitInfo * compHnd, CORINFO_METHOD_INFO * methodInfo, void * * methodCodePtr, unsigned int * methodCodeSize, JitFlags * compileFlags, void * inlineInfoPtr) Line 7695	C++
 	clrjit_win_x64_x64.dll!CILJit::compileMethod(ICorJitInfo * compHnd, CORINFO_METHOD_INFO * methodInfo, unsigned int flags, unsigned char * * entryAddress, unsigned int * nativeSizeOfCode) Line 272	C++
 	jitinterface_x64.dll!JitCompileMethod(CorInfoExceptionClass * * ppException, ICorJitCompiler * pJit, void * thisHandle, void * * callbacks, CORINFO_METHOD_INFO * methodInfo, unsigned int flags, unsigned char * * entryAddress, unsigned int * nativeSizeOfCode) Line 34	C++
 	ilc.exe!ILCompiler_RyuJit_Internal_JitInterface_CorInfoImpl__JitCompileMethod�()	Unknown
 	ilc.exe!ILCompiler_RyuJit_Internal_JitInterface_CorInfoImpl__CompileMethodInternal() Line 358	Unknown
 	ilc.exe!ILCompiler_RyuJit_Internal_JitInterface_CorInfoImpl__CompileMethod() Line 62	Unknown
 	ilc.exe!ILCompiler_RyuJit_ILCompiler_RyuJitCompilation__CompileSingleMethod_0() Line 190	Unknown
 	ilc.exe!System_Threading_Tasks_Parallel_System_Threading_Tasks_Parallel___c__DisplayClass19_0_1<System___Canon>___ForWorker_b__1() Line 1060	Unknown
 	ilc.exe!System_Threading_Tasks_Parallel_System_Threading_Tasks_TaskReplicator_Replica__Execute() Line 79	Unknown
 	ilc.exe!S_P_CoreLib_System_Threading_ExecutionContext__RunFromThreadPoolDispatchLoop() Line 268	Unknown
 	ilc.exe!S_P_CoreLib_System_Threading_Tasks_Task__ExecuteWithThreadLocal() Line 2353	Unknown
 	ilc.exe!S_P_CoreLib_System_Threading_ThreadPoolWorkQueue__Dispatch() Line 919	Unknown
 	ilc.exe!S_P_CoreLib_System_Threading_ThreadPool__DispatchCallback() Line 376	Unknown
@ghost ghost added the untriaged New issue has not been triaged by the area owner label Mar 30, 2023
@ghost
Copy link

ghost commented Mar 30, 2023

Tagging subscribers to this area: @agocke, @MichalStrehovsky, @jkotas
See info in area-owners.md if you want to be subscribed.

Issue Details

null

Author: VSadov
Assignees: -
Labels:

area-NativeAOT-coreclr

Milestone: -

@jkotas jkotas added the area-CodeGen-coreclr CLR JIT compiler in src/coreclr/src/jit and related components such as SuperPMI label Mar 30, 2023
@ghost
Copy link

ghost commented Mar 30, 2023

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

Issue Details
    // At this point the unusedDefs map should contain only unused values.
    if (checkUnusedValues)
    {
        for (auto kvp : unusedDefs)
        {
            GenTree* node = kvp.Key();
            assert(node->IsUnusedValue() && "found an unmarked unused value");      <==== here
            assert(!node->isContained() && "a contained node should have a user");
        }
    }
 	KernelBase.dll!wil::details::DebugBreak(void)	Unknown
>	clrjit_win_x64_x64.dll!assertAbort(const char * why, const char * file, unsigned int line) Line 304	C++
 	clrjit_win_x64_x64.dll!LIR::Range::CheckLIR(Compiler * compiler, bool checkUnusedValues) Line 1692	C++
 	[Inline Frame] clrjit_win_x64_x64.dll!Lowering::CheckBlock(Compiler * compiler, BasicBlock *) Line 7351	C++
 	[Inline Frame] clrjit_win_x64_x64.dll!Lowering::LowerBlock(BasicBlock *) Line 7382	C++
 	clrjit_win_x64_x64.dll!Lowering::DoPhase() Line 7151	C++
 	clrjit_win_x64_x64.dll!Phase::Run() Line 62	C++
 	clrjit_win_x64_x64.dll!Compiler::compCompile(void * * methodCodePtr, unsigned int * methodCodeSize, JitFlags * compileFlags) Line 5088	C++
 	clrjit_win_x64_x64.dll!Compiler::compCompileHelper(CORINFO_MODULE_STRUCT_ * classPtr, ICorJitInfo * compHnd, CORINFO_METHOD_INFO * methodInfo, void * * methodCodePtr, unsigned int * methodCodeSize, JitFlags * compileFlags) Line 7025	C++
 	[Inline Frame] clrjit_win_x64_x64.dll!Compiler::compCompile::__l164::__Body::Run(Compiler::compCompile::__l2::__JITParam *) Line 6181	C++
 	clrjit_win_x64_x64.dll!Compiler::compCompile(CORINFO_MODULE_STRUCT_ * classPtr, void * * methodCodePtr, unsigned int * methodCodeSize, JitFlags * compileFlags) Line 6185	C++
 	[Inline Frame] clrjit_win_x64_x64.dll!jitNativeCode::__l8::__Body::Run::__l6::__Body::Run(jitNativeCode::__l8::__Body::Run::__l5::__JITParam *) Line 7668	C++
 	clrjit_win_x64_x64.dll!`jitNativeCode'::`8'::__Body::Run(jitNativeCode::__l2::__JITParam * __JITpParam) Line 7671	C++
 	clrjit_win_x64_x64.dll!jitNativeCode(CORINFO_METHOD_STRUCT_ * methodHnd, CORINFO_MODULE_STRUCT_ * classPtr, ICorJitInfo * compHnd, CORINFO_METHOD_INFO * methodInfo, void * * methodCodePtr, unsigned int * methodCodeSize, JitFlags * compileFlags, void * inlineInfoPtr) Line 7695	C++
 	clrjit_win_x64_x64.dll!CILJit::compileMethod(ICorJitInfo * compHnd, CORINFO_METHOD_INFO * methodInfo, unsigned int flags, unsigned char * * entryAddress, unsigned int * nativeSizeOfCode) Line 272	C++
 	jitinterface_x64.dll!JitCompileMethod(CorInfoExceptionClass * * ppException, ICorJitCompiler * pJit, void * thisHandle, void * * callbacks, CORINFO_METHOD_INFO * methodInfo, unsigned int flags, unsigned char * * entryAddress, unsigned int * nativeSizeOfCode) Line 34	C++
 	ilc.exe!ILCompiler_RyuJit_Internal_JitInterface_CorInfoImpl__JitCompileMethod�()	Unknown
 	ilc.exe!ILCompiler_RyuJit_Internal_JitInterface_CorInfoImpl__CompileMethodInternal() Line 358	Unknown
 	ilc.exe!ILCompiler_RyuJit_Internal_JitInterface_CorInfoImpl__CompileMethod() Line 62	Unknown
 	ilc.exe!ILCompiler_RyuJit_ILCompiler_RyuJitCompilation__CompileSingleMethod_0() Line 190	Unknown
 	ilc.exe!System_Threading_Tasks_Parallel_System_Threading_Tasks_Parallel___c__DisplayClass19_0_1<System___Canon>___ForWorker_b__1() Line 1060	Unknown
 	ilc.exe!System_Threading_Tasks_Parallel_System_Threading_Tasks_TaskReplicator_Replica__Execute() Line 79	Unknown
 	ilc.exe!S_P_CoreLib_System_Threading_ExecutionContext__RunFromThreadPoolDispatchLoop() Line 268	Unknown
 	ilc.exe!S_P_CoreLib_System_Threading_Tasks_Task__ExecuteWithThreadLocal() Line 2353	Unknown
 	ilc.exe!S_P_CoreLib_System_Threading_ThreadPoolWorkQueue__Dispatch() Line 919	Unknown
 	ilc.exe!S_P_CoreLib_System_Threading_ThreadPool__DispatchCallback() Line 376	Unknown
Author: VSadov
Assignees: -
Labels:

area-CodeGen-coreclr, untriaged, area-NativeAOT-coreclr

Milestone: -

@VSadov
Copy link
Member Author

VSadov commented Mar 30, 2023

I will disable the offending test. Just need to be sure it is the only one affected.

@VSadov
Copy link
Member Author

VSadov commented Mar 30, 2023

This must be a relatively recent issue. I run tests with chk runtime frequently and did not see it.
However my base (5d88ff4) was a few days old. The issue must be newer than that commit.

@VSadov
Copy link
Member Author

VSadov commented Mar 30, 2023

This is the only test affected. With System.Net.Sockets.Tests excluded chk/ret NativeAOT Libraries tests pass locally.

@EgorBo
Copy link
Member

EgorBo commented Mar 30, 2023

@VSadov can you please remind me how do I build a specific BCL test suite with NAOT? I think last time I tried it only worked for the whole BCL suite and took several hours

@VSadov
Copy link
Member Author

VSadov commented Mar 30, 2023

I think last time I tried it only worked for the whole BCL suite and took several hours

I takes about 12-15 minutes to run the whole suite on AMD 5950X from clean state, so it is not too bad. I run the whole suite fairly often. It does need a fast machine with lots of memory though.

There were some instructions for selective compiling/running tests in #78717

@jkotas
Copy link
Member

jkotas commented Mar 30, 2023

build.cmd -s clr.aot+libs -rc checked -c Release
cd src\libraries\System.Net.Sockets\tests\FunctionalTests
..\..\..\..\..\dotnet.cmd build /t:Test -c Release /p:TestNativeAot=true /p:CoreCLRConfiguration=checked

@VSadov
Copy link
Member Author

VSadov commented Mar 30, 2023

@EgorBo - FYI. The test has been disabled on NativeAOT in #84114. If you decide to run the whole suite, you'd need to sync to before that change.

(also if you decide to run the whole suite on your new machine 🚀, do share how long it took. ;)

@JulieLeeMSFT JulieLeeMSFT removed the untriaged New issue has not been triaged by the area owner label Mar 30, 2023
@JulieLeeMSFT JulieLeeMSFT added this to the 8.0.0 milestone Mar 30, 2023
@EgorBo EgorBo self-assigned this Mar 31, 2023
@ghost ghost added the in-pr There is an active PR which will close this issue when it is merged label Mar 31, 2023
@ghost ghost removed the in-pr There is an active PR which will close this issue when it is merged label Mar 31, 2023
@ghost ghost locked as resolved and limited conversation to collaborators Apr 30, 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.

4 participants