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

Assert failure: !"embedClassHandle" #52450

Closed
BruceForstall opened this issue May 7, 2021 · 7 comments · Fixed by #52453
Closed

Assert failure: !"embedClassHandle" #52450

BruceForstall opened this issue May 7, 2021 · 7 comments · Fixed by #52453
Assignees
Labels
area-CrossGen/NGEN-coreclr blocking-outerloop Blocking the 'runtime-coreclr outerloop' and 'runtime-libraries-coreclr outerloop' runs untriaged New issue has not been triaged by the area owner
Milestone

Comments

@BruceForstall
Copy link
Member

Starting with:

https://dev.azure.com/dnceng/public/_build/results?buildId=1126222&view=results

All outerloop R2R jobs are failing to crossgen the framework:

4 / 259 (0%, 1 failed): failed in 10798 msecs, exit code 134, expected 0: crossgen @/__w/1/s/artifacts/tests/coreclr/obj/Linux.x64.Checked/crossgen.out/System.Private.Xml.dll.rsp
!! Assert failure(PID 6565 [0x000019a5], Thread: 6565 [0x19a5]): !"embedClassHandle"
!!     File: /__w/1/s/src/coreclr/zap/zapinfo.cpp Line: 1580
!!     Image: /__w/1/s/artifacts/bin/coreclr/Linux.x64.Checked/crossgen
  Microsoft (R) CoreCLR Native Image Generator - Version 6.0.0-ci
  Copyright (c) Microsoft Corporation.  All rights reserved.
5 / 259 (0%, 1 failed): launching: /__w/1/s/artifacts/bin/coreclr/Linux.x64.Checked/crossgen @/__w/1/s/artifacts/tests/coreclr/obj/Linux.x64.Checked/crossgen.out/Microsoft.Diagnostics.Tracing.TraceEvent.dll.rsp
...
8 / 259 (1%, 2 failed): failed in 584 msecs, exit code 134, expected 0: crossgen @/__w/1/s/artifacts/tests/coreclr/obj/Linux.x64.Checked/crossgen.out/System.Data.Common.dll.rsp
!! Assert failure(PID 6583 [0x000019b7], Thread: 6583 [0x19b7]): !"embedClassHandle"
!!     File: /__w/1/s/src/coreclr/zap/zapinfo.cpp Line: 1580
!!     Image: /__w/1/s/artifacts/bin/coreclr/Linux.x64.Checked/crossgen
  Microsoft (R) CoreCLR Native Image Generator - Version 6.0.0-ci
  Copyright (c) Microsoft Corporation.  All rights reserved.
@BruceForstall BruceForstall added area-CrossGen/NGEN-coreclr blocking-outerloop Blocking the 'runtime-coreclr outerloop' and 'runtime-libraries-coreclr outerloop' runs labels May 7, 2021
@BruceForstall BruceForstall added this to the 6.0.0 milestone May 7, 2021
@dotnet-issue-labeler dotnet-issue-labeler bot added the untriaged New issue has not been triaged by the area owner label May 7, 2021
@BruceForstall
Copy link
Member Author

One call stack:

 	KernelBase.dll!RaiseFailFastException�()	Unknown
>	crossgen.exe!_DbgBreakCheck(const char * szFile, int iLine, const char * szExpr, int fConstrained) Line 427	C++
 	crossgen.exe!_DbgBreakCheckNoThrow(const char * szFile, int iLine, const char * szExpr, int fConstrained) Line 534	C++
 	crossgen.exe!DbgAssertDialog(const char * szFile, int iLine, const char * szExpr) Line 695	C++
 	crossgen.exe!ZapInfo::embedClassHandle(CORINFO_CLASS_STRUCT_ * handle, void * * ppIndirection) Line 1581	C++
 	clrjit.dll!Compiler::gtNewIconEmbClsHndNode(CORINFO_CLASS_STRUCT_ * clsHnd) Line 1048	C++
 	clrjit.dll!Compiler::impDevirtualizeCall(GenTreeCall * call, CORINFO_METHOD_STRUCT_ * * method, unsigned int * methodFlags, CORINFO_CONTEXT_STRUCT_ * * pContextHandle, CORINFO_CONTEXT_STRUCT_ * * pExactContextHandle, bool isLateDevirtualization, bool isExplicitTailCall, unsigned int ilOffset) Line 21162	C++
 	clrjit.dll!Compiler::fgLateDevirtualization(GenTree * * pTree, Compiler::fgWalkData * data) Line 737	C++
 	[Inline Frame] clrjit.dll!GenericTreeWalker<1,1,1,0,1>::PostOrderVisit(GenTree * *) Line 11110	C++
 	clrjit.dll!GenTreeVisitor<GenericTreeWalker<1,1,1,0,1>>::WalkTree(GenTree * * use, GenTree * user) Line 11063	C++
 	clrjit.dll!GenTreeVisitor<GenericTreeWalker<1,1,1,0,1>>::WalkTree(GenTree * * use, GenTree * user) Line 10760	C++
 	clrjit.dll!GenTreeVisitor<GenericTreeWalker<1,1,1,0,1>>::WalkTree(GenTree * * use, GenTree * user) Line 11036	C++
 	clrjit.dll!GenTreeVisitor<GenericTreeWalker<1,1,1,0,1>>::WalkTree(GenTree * * use, GenTree * user) Line 10760	C++
 	clrjit.dll!Compiler::fgWalkTree(GenTree * * pTree, Compiler::fgWalkResult(*)(GenTree * *, Compiler::fgWalkData *) preVisitor, Compiler::fgWalkResult(*)(GenTree * *, Compiler::fgWalkData *) postVisitor, void * callBackData) Line 2624	C++
 	clrjit.dll!Compiler::fgInline() Line 194	C++
 	clrjit.dll!Phase::Run() Line 62	C++
 	[Inline Frame] clrjit.dll!DoPhase(Compiler *) Line 136	C++
 	clrjit.dll!Compiler::compCompile(void * * methodCodePtr, unsigned int * methodCodeSize, JitFlags * compileFlags) Line 4659	C++
 	clrjit.dll!Compiler::compCompileHelper(CORINFO_MODULE_STRUCT_ * classPtr, ICorJitInfo * compHnd, CORINFO_METHOD_INFO * methodInfo, void * * methodCodePtr, unsigned int * methodCodeSize, JitFlags * compileFlags) Line 6424	C++
 	[Inline Frame] clrjit.dll!Compiler::compCompile::__l67::__Body::Run(Compiler::compCompile::__l2::__JITParam *) Line 5717	C++
 	clrjit.dll!Compiler::compCompile(CORINFO_MODULE_STRUCT_ * classPtr, void * * methodCodePtr, unsigned int * methodCodeSize, JitFlags * compileFlags) Line 5721	C++
 	[Inline Frame] clrjit.dll!jitNativeCode::__l8::__Body::Run::__l6::__Body::Run(jitNativeCode::__l8::__Body::Run::__l5::__JITParam *) Line 7067	C++
 	clrjit.dll!`jitNativeCode'::`8'::__Body::Run(jitNativeCode::__l2::__JITParam * __JITpParam) Line 7070	C++
 	clrjit.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 7094	C++
 	clrjit.dll!CILJit::compileMethod(ICorJitInfo * compHnd, CORINFO_METHOD_INFO * methodInfo, unsigned int flags, unsigned char * * entryAddress, unsigned int * nativeSizeOfCode) Line 279	C++
 	crossgen.exe!ZapInfo::CompileMethod() Line 545	C++
 	crossgen.exe!ZapImage::TryCompileMethodWorker(CORINFO_METHOD_STRUCT_ * handle, unsigned int md, unsigned int methodProfilingDataFlags) Line 2130	C++
 	crossgen.exe!ZapImage::TryCompileMethodDef(unsigned int md, unsigned int methodProfilingDataFlags) Line 1951	C++
 	crossgen.exe!ZapImage::CompileColdRegion() Line 1730	C++
 	crossgen.exe!ZapImage::Compile() Line 1790	C++
 	crossgen.exe!Zapper::CompileModule(CORINFO_MODULE_STRUCT_ * hModule, IMetaDataAssemblyEmit * pAssemblyEmit) Line 1498	C++
 	crossgen.exe!Zapper::CompileAssembly(_GUID * pNativeImageSig) Line 1384	C++
 	crossgen.exe!Zapper::CompileInCurrentDomain(const wchar_t * string, _GUID * pNativeImageSig) Line 1088	C++
 	crossgen.exe!Zapper::Compile(const wchar_t * string, _GUID * pNativeImageSig) Line 1018	C++
 	crossgen.exe!NGenWorker(const wchar_t * pwzFilename, unsigned long dwFlags, const wchar_t * pwzPlatformAssembliesPaths, const wchar_t * pwzTrustedPlatformAssemblies, const wchar_t * pwzPlatformResourceRoots, const wchar_t * pwzAppPaths, const wchar_t * pwzOutputFilename, unsigned __int64 customBaseAddress, ICorSvcLogger * pLogger, const wchar_t * pwszCLRJITPath) Line 109	C++
 	crossgen.exe!wmain(int argc, wchar_t * * argv) Line 906	C++
 	crossgen.exe!invoke_main() Line 91	C++
 	crossgen.exe!__scrt_common_main_seh() Line 288	C++
 	crossgen.exe!__scrt_common_main() Line 331	C++
 	crossgen.exe!wmainCRTStartup(void * __formal) Line 17	C++
 	kernel32.dll!BaseThreadInitThunk�()	Unknown
 	ntdll.dll!RtlUserThreadStart�()	Unknown

@BruceForstall
Copy link
Member Author

This is due to #52210

@AndyAyersMS
Copy link
Member

Either need to try and fake up a resolved token and call a more general method, or just defer this case for ready to run.

Will do the latter for now.

AndyAyersMS added a commit to AndyAyersMS/runtime that referenced this issue May 7, 2021
Some unboxed entries require an additional generic context argument, and
finding the right form for this argument when prejitting is more complex than
it is for jitting. So, defer this update when prejitting.

Resolves dotnet#52450.
@ghost ghost added the in-pr There is an active PR which will close this issue when it is merged label May 7, 2021
@AndyAyersMS
Copy link
Member

Seems like there may be a related issue with prejitting and GDV -- I need to double-check that we're forming the right runtime tests there.

@mangod9
Copy link
Member

mangod9 commented May 7, 2021

@dotnet/crossgen-contrib, assume this affects crossgen2 as well or just crossgen?

@AndyAyersMS
Copy link
Member

Just crossgen, and just a checked build.

@AndyAyersMS
Copy link
Member

Seems like there may be a related issue with prejitting and GDV

Looks like we're doing the right thing... here's a GDV check in prejitted code (enabled via class profile static PGO):

G_M28490_IG03:              ;; offset=0015H
       488B0500000000       mov      rax, qword ptr [(reloc 0x4000000000420070)]
       483B07               cmp      rax, qword ptr [rdi]
       751B                 jne      SHORT G_M28490_IG07

and here's the same test when that method gets rejitted at Tier1 (again from that same bit of static PGO data)

G_M28490_IG03:              ;; offset=0015H
       48B8D07272A1FB7F0000 mov      rax, 0x7FFBA17272D0
       483907               cmp      qword ptr [rdi], rax
       751B                 jne      SHORT G_M28490_IG07

AndyAyersMS added a commit that referenced this issue May 7, 2021
#52210 requires class handle embedding that crossgen does not support.

Remove an assert as this is now an area where crossgen2 and crossgen diverge.

Resolves #52450.
@ghost ghost removed the in-pr There is an active PR which will close this issue when it is merged label May 7, 2021
@ghost ghost locked as resolved and limited conversation to collaborators Jun 6, 2021
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
area-CrossGen/NGEN-coreclr blocking-outerloop Blocking the 'runtime-coreclr outerloop' and 'runtime-libraries-coreclr outerloop' runs untriaged New issue has not been triaged by the area owner
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants