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 CONTRACT VIOLATION by Entry2MethodDesc at "D:\workspace\_work\1\s\src\coreclr\vm\method.cpp #51476

Closed
VincentBu opened this issue Apr 19, 2021 · 2 comments · Fixed by #51485
Assignees
Labels
arch-x64 arch-x86 area-CodeGen-coreclr CLR JIT compiler in src/coreclr/src/jit and related components such as SuperPMI GCStress os-windows untriaged New issue has not been triaged by the area owner
Milestone

Comments

@VincentBu
Copy link
Contributor

Run: runtime-coreclr gcstress0x3-gcstress0xc 20210418.1

Failed tests:

CoreCLR windows x64 Checked gcstress0x3 @ Windows.10.Amd64.Open
 -JIT\\Directed\\tailcall\\mutual_recursion\\mutual_recursion.cmd
 -JIT\\Directed\\tailcall\\more_tailcalls\\more_tailcalls.cmd
 -JIT\\opt\\ETW\\TailCallCases\\TailCallCases.cmd
 -JIT\\Methodical\\tailcall_v4\\hijacking\\hijacking.cmd
 -JIT\\jit64\\localloc\\call\\call07_dynamic\\call07_dynamic.cmd
 -JIT\\Directed\\IL\\Tailcall\\JitTailcall2\\JitTailcall2.cmd
 -JIT\\Regression\\JitBlue\\GitHub_5164\\GitHub_5164\\GitHub_5164.cmd
 -JIT\\Regression\\JitBlue\\devdiv_902271\\DevDiv_902271\\DevDiv_902271.cmd
 -JIT\\jit64\\localloc\\call\\call07_small\\call07_small.cmd

CoreCLR windows x86 Checked gcstress0x3 @ Windows.10.Amd64.Open
 -JIT\\jit64\\localloc\\call\\call07_dynamic\\call07_dynamic.cmd

Error message:

Assert failure(PID 6092 [0x000017cc], Thread: 2296 [0x08f8]): CONTRACT VIOLATION by Entry2MethodDesc at "D:\workspace\_work\1\s\src\coreclr\vm\method.cpp" @ 2243

THROWS called in a NOTHROW region.

 CONTRACT in Entry2MethodDesc at "D:\workspace\_work\1\s\src\coreclr\vm\method.cpp" @ 2243
 GCX_COOP in Thread::PerformPreemptiveGC at "D:\workspace\_work\1\s\src\coreclr\vm\threadsuspend.cpp" @ 2316
VIOLATED--> CONTRACT in Thread::PerformPreemptiveGC at "D:\workspace\_work\1\s\src\coreclr\vm\threadsuspend.cpp" @ 2280
 CONTRACT in Thread::RareEnablePreemptiveGC at "D:\workspace\_work\1\s\src\coreclr\vm\threadsuspend.cpp" @ 2341
 GCX_PREEMP_THREAD_EXISTS in PreStubWorker at "D:\workspace\_work\1\s\src\coreclr\vm\prestub.cpp" @ 1992
 CONTRACT in MethodDescCallSite::CallTargetWorker at "D:\workspace\_work\1\s\src\coreclr\vm\callhelpers.cpp" @ 286
 GCX_COOP in Assembly::ExecuteMainMethod at "D:\workspace\_work\1\s\src\coreclr\vm\assembly.cpp" @ 1636
 CONTRACT in Assembly::ExecuteMainMethod at "D:\workspace\_work\1\s\src\coreclr\vm\assembly.cpp" @ 1620
 GCX_COOP in CorHost2::ExecuteAssembly at "D:\workspace\_work\1\s\src\coreclr\vm\corhost.cpp" @ 357
 CONTRACT in CorHost2::ExecuteAssembly at "D:\workspace\_work\1\s\src\coreclr\vm\corhost.cpp" @ 306



CORECLR! CONTRACT_ASSERT + 0x31A (0x00007fff208938de)
CORECLR! BaseContract::DoChecks + 0x22D (0x00007fff2089c699)
CORECLR! EEContract::DoChecks + 0x87 (0x00007fff20bece2b)
CORECLR! Entry2MethodDesc + 0x17E (0x00007fff20a6a8d6)
CORECLR! ScanTailCallArgBufferRoots + 0x40 (0x00007fff20c177b4)
CORECLR! GCToEEInterface::GcScanRoots + 0x1A4 (0x00007fff20c15420)
CORECLR! WKS::gc_heap::mark_phase + 0x1D1 (0x00007fff20f3de7d)
CORECLR! WKS::gc_heap::gc1 + 0x268 (0x00007fff20f35e38)
CORECLR! WKS::gc_heap::garbage_collect + 0x4E2 (0x00007fff20f35b1e)
CORECLR! WKS::GCHeap::GarbageCollectGeneration + 0x292 (0x00007fff20f20d5e)
 File: D:\workspace\_work\1\s\src\coreclr\vm\method.cpp Line: 2243
 Image: C:\h\w\A9800923\p\corerun.exe


Return code: 1
Raw output file: C:\h\w\A9800923\w\94830874\e\JIT\Directed\Reports\JIT.Directed\tailcall\mutual_recursion\mutual_recursion.output.txt
Raw output:
BEGIN EXECUTION
 "C:\h\w\A9800923\p\corerun.exe" mutual_recursion.dll 
[FirstMethod] - 371.330600ms
[SecondMethod] - 46.598500ms
[ThirdMethod] - 118.955100ms
[FourthMethod] - 129.670100ms
[FifthMethod] - 155.264900ms
Expected: 100
Actual: -1073740286
END EXECUTION - FAILED
FAILED
Test Harness Exitcode is : 1
To run the test:
> set CORE_ROOT=C:\h\w\A9800923\p
> C:\h\w\A9800923\w\94830874\e\JIT\Directed\tailcall\mutual_recursion\mutual_recursion.cmd
Expected: True
Actual: False

Stack trace
   at JIT_Directed._tailcall_mutual_recursion_mutual_recursion_._tailcall_mutual_recursion_mutual_recursion_cmd()

@dotnet-issue-labeler dotnet-issue-labeler bot added area-CodeGen-coreclr CLR JIT compiler in src/coreclr/src/jit and related components such as SuperPMI untriaged New issue has not been triaged by the area owner labels Apr 19, 2021
@jkotas
Copy link
Member

jkotas commented Apr 19, 2021

@jakobbotsch This is regression from #51315. Could you please take a look?

The problem is that some of the work done by Entry2MethodDesc is not safe to run during the GC because of it can trigger GC recursively. The good news is that a lot of the work done by Entry2MethodDesc is not actually needed here. We only need the part that uses the RangeSection lookup (we should always find the RangeSection for the tailcall helper) that is safe to run during the GC.

@jakobbotsch
Copy link
Member

Yep, I'll take a look.

jakobbotsch added a commit to jakobbotsch/runtime that referenced this issue Apr 19, 2021
@ghost ghost added the in-pr There is an active PR which will close this issue when it is merged label Apr 19, 2021
@ghost ghost removed the in-pr There is an active PR which will close this issue when it is merged label Apr 19, 2021
@JulieLeeMSFT JulieLeeMSFT added this to the 6.0.0 milestone Apr 20, 2021
@ghost ghost locked as resolved and limited conversation to collaborators May 20, 2021
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
arch-x64 arch-x86 area-CodeGen-coreclr CLR JIT compiler in src/coreclr/src/jit and related components such as SuperPMI GCStress os-windows untriaged New issue has not been triaged by the area owner
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants