Skip to content

Remove HOST_CALLS contract and related stuff #100604

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

Merged
merged 2 commits into from
Apr 3, 2024

Conversation

janvorli
Copy link
Member

@janvorli janvorli commented Apr 3, 2024

The HOST_CALLS contract is obsolete remainder from the .NET framework era, this change removes all of the use of that contract and the related code.

Also closes #100563

The HOST_CALLS contract is obsolete remainder from the .NET framework
era, this change removes all of the use of that contract and the related
code.
@janvorli janvorli added this to the 9.0.0 milestone Apr 3, 2024
@janvorli janvorli requested a review from jkotas April 3, 2024 18:47
@janvorli janvorli self-assigned this Apr 3, 2024
Copy link
Contributor

Tagging subscribers to this area: @mangod9
See info in area-owners.md if you want to be subscribed.

@jkotas
Copy link
Member

jkotas commented Apr 3, 2024

Also closes #100563

How is this closing this issue?

The HOST_CALLS are debug-only checks. The log attached to the issue has Internal CLR error
https://helixre107v0xdcypoyl9e7f.blob.core.windows.net/dotnet-runtime-refs-pull-100110-merge-2305133847734c678e/System.Text.RegularExpressions.Tests/1/console.9c55cc56.log?helixlogtype=result

@janvorli
Copy link
Member Author

janvorli commented Apr 3, 2024

How is this closing this issue?

The HOST_CALLS are debug-only checks. The log attached to the issue has Internal CLR error

The dump for that issue that I've downloaded using the runfo shows a crash due to accessing a garbage address down the call chain of CONTRACT_ASSERT:

 # Child-SP          RetAddr               Call Site
00 000000ff`e5c73990 00007ff8`f02a9c06     coreclr!common_strnlen_simd<0,1,unsigned char>+0x17d [minkernel\crts\ucrt\src\appcrt\string\strnlen.cpp @ 152] 
01 000000ff`e5c73b20 00007ff8`f02ab02d     coreclr!common_strnlen<0,unsigned char>+0x26 [minkernel\crts\ucrt\src\appcrt\string\strnlen.cpp @ 185] 
02 000000ff`e5c73b50 00007ff8`f02917b8     coreclr!strnlen+0x1d [minkernel\crts\ucrt\src\appcrt\string\strnlen.cpp @ 204] 
03 000000ff`e5c73b80 00007ff8`f02913e2     coreclr!__crt_stdio_output::output_processor<char,__crt_stdio_output::string_output_adapter<char>,__crt_stdio_output::format_validation_base<char,__crt_stdio_output::string_output_adapter<char> > >::type_case_s_compute_narrow_string_length+0x28 [minkernel\crts\ucrt\inc\corecrt_internal_stdio_output.h @ 2354] 
04 000000ff`e5c73bb0 00007ff8`f028c402     coreclr!__crt_stdio_output::output_processor<char,__crt_stdio_output::string_output_adapter<char>,__crt_stdio_output::format_validation_base<char,__crt_stdio_output::string_output_adapter<char> > >::type_case_s+0x102 [minkernel\crts\ucrt\inc\corecrt_internal_stdio_output.h @ 2340] 
05 000000ff`e5c73bf0 00007ff8`f028871f     coreclr!__crt_stdio_output::output_processor<char,__crt_stdio_output::string_output_adapter<char>,__crt_stdio_output::format_validation_base<char,__crt_stdio_output::string_output_adapter<char> > >::state_case_type+0x82 [minkernel\crts\ucrt\inc\corecrt_internal_stdio_output.h @ 2066] 
06 000000ff`e5c73c60 00007ff8`f027bef5     coreclr!__crt_stdio_output::output_processor<char,__crt_stdio_output::string_output_adapter<char>,__crt_stdio_output::format_validation_base<char,__crt_stdio_output::string_output_adapter<char> > >::process+0x34f [minkernel\crts\ucrt\inc\corecrt_internal_stdio_output.h @ 1704] 
07 000000ff`e5c73cd0 00007ff8`f027cc71     coreclr!common_vsprintf<__crt_stdio_output::format_validation_base,char>+0x2a5 [minkernel\crts\ucrt\src\appcrt\stdio\output.cpp @ 170] 
08 000000ff`e5c74200 00007ff8`f02942b9     coreclr!common_vsprintf_s<char>+0x201 [minkernel\crts\ucrt\src\appcrt\stdio\output.cpp @ 273] 
09 000000ff`e5c742a0 00007ff8`ef917cc4     coreclr!__stdio_common_vsprintf_s+0x69 [minkernel\crts\ucrt\src\appcrt\stdio\output.cpp @ 302] 
0a (Inline Function) --------`--------     coreclr!_vsprintf_s_l+0x24 [C:\Program Files (x86)\Windows Kits\10\include\10.0.22621.0\ucrt\stdio.h @ 1491] 
0b 000000ff`e5c74330 00007ff8`ef8e3937     coreclr!sprintf_s+0x44 [C:\Program Files (x86)\Windows Kits\10\include\10.0.22621.0\ucrt\stdio.h @ 1827] 
0c 000000ff`e5c74390 00007ff8`efca2ad6     coreclr!CONTRACT_ASSERT+0x237 [D:\a\_work\1\s\src\coreclr\inc\contract.inl @ 541] 
0d 000000ff`e5c77a60 00007ff8`f02388cb     coreclr!EEContract::DoChecks+0x386 [D:\a\_work\1\s\src\coreclr\vm\eecontract.cpp @ 177] 
0e 000000ff`e5c77af0 00007ff8`f0245c05     coreclr!ExecutionManager::ReaderLockHolder::ReaderLockHolder+0xdb [D:\a\_work\1\s\src\coreclr\vm\codeman.cpp @ 657] 
 
0f 000000ff`e5c77be0 00007ff8`f02458e3     coreclr!ExecutionManager::IsManagedCodeWithLock+0xe5 [D:\a\_work\1\s\src\coreclr\vm\codeman.cpp @ 4551] 
10 000000ff`e5c77ca0 00007ff8`efa4cc1f     coreclr!ExecutionManager::IsManagedCode+0xf3 [D:\a\_work\1\s\src\coreclr\vm\codeman.cpp @ 4530] 
11 000000ff`e5c77d60 00007ff8`effcd8cd     coreclr!Frame::UpdateFloatingPointRegisters+0x27f [D:\a\_work\1\s\src\coreclr\vm\frames.cpp @ 471] 
12 000000ff`e5c77ed0 00007ff8`efb9bf65     coreclr!InlinedCallFrame::UpdateRegDisplay+0x1fd [D:\a\_work\1\s\src\coreclr\vm\amd64\cgenamd64.cpp @ 115] 
13 000000ff`e5c77ff0 00007ff8`efb9b7c3     coreclr!StackFrameIterator::NextRaw+0x745 [D:\a\_work\1\s\src\coreclr\vm\stackwalk.cpp @ 2735] 
14 000000ff`e5c780a0 00007ff8`effc617b     coreclr!StackFrameIterator::Next+0x73 [D:\a\_work\1\s\src\coreclr\vm\stackwalk.cpp @ 1636] 
15 (Inline Function) --------`--------     coreclr!MoveToNextNonSkippedFrame+0x8 [D:\a\_work\1\s\src\coreclr\vm\exceptionhandling.cpp @ 8321] 
16 000000ff`e5c780d0 00007ff8`a2a72d0e     coreclr!SfiNext+0x43b [D:\a\_work\1\s\src\coreclr\vm\exceptionhandling.cpp @ 8474] 
17 000000ff`e5c782a0 000000ff`e5c78828     System_Private_CoreLib!System.Runtime.EH.DispatchEx(System.Runtime.StackFrameIterator ByRef, ExInfo ByRef)+0xffffffff`d7c3008e
.
.
.
coreclr!common_strnlen_simd<0,1,unsigned char>+0x17d:
00007ff8`f02aa50d c5fe6f00        vmovdqu ymm0,ymmword ptr [rax] ds:00010119`00000000=??
0:009> dq @rax
00010119`00000000  ????????`????????

@janvorli janvorli merged commit 95b67ed into dotnet:main Apr 3, 2024
92 checks passed
@janvorli janvorli deleted the remove-host-call-contract branch April 3, 2024 23:48
matouskozak pushed a commit to matouskozak/runtime that referenced this pull request Apr 30, 2024
* Remove HOST_CALLS contract and related stuff

The HOST_CALLS contract is obsolete remainder from the .NET framework
era, this change removes all of the use of that contract and the related
code.

* Remove ShouldAvoidHost calls et al too.
@github-actions github-actions bot locked and limited conversation to collaborators May 4, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Test suite crash in new exception handling
2 participants