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

fix hang when prepare_to_change_heap_count fails #103386

Merged
merged 1 commit into from
Jun 13, 2024
Merged

Conversation

Maoni0
Copy link
Member

@Maoni0 Maoni0 commented Jun 13, 2024

when prepare_to_change_heap_count fails, we need to make sure to restart the EE otherwise the GC thread still holds the thread store lock and you'll observe hang like this -

0:061> k
 # Child-SP          RetAddr               Call Site
00 000000a0`b87ff138 00007ff8`a0d43c03     ntdll!ZwWaitForAlertByThreadId+0x14 [minkernel\ntdll\daytona\objfre\amd64\usrstubs.asm @ 4059] 
01 (Inline Function) --------`--------     ntdll!RtlpWaitOnAddressWithTimeout+0x43 [minkernel\ntos\rtl\waitaddr.c @ 851] 
02 (Inline Function) --------`--------     ntdll!RtlpWaitOnAddress+0xe5 [minkernel\ntos\rtl\waitaddr.c @ 1094] 
03 000000a0`b87ff140 00007ff8`a0d318e4     ntdll!RtlpWaitOnCriticalSection+0x1e3 [minkernel\ntos\rtl\resource.c @ 1604] 
04 000000a0`b87ff250 00007ff8`a0d316d2     ntdll!RtlpEnterCriticalSectionContended+0x204 [minkernel\ntos\rtl\resource.c @ 2318] 
05 000000a0`b87ff2d0 00007fff`a6f6f880     ntdll!RtlEnterCriticalSection+0x42 [minkernel\ntos\rtl\resource.c @ 1923] 
06 000000a0`b87ff300 00007fff`a6f9ccae     coreclr!CrstBase::Enter+0x90 [D:\runtime9.0\src\coreclr\vm\crst.cpp @ 328] 
07 (Inline Function) --------`--------     coreclr!ThreadStore::Enter+0x10 [D:\runtime9.0\src\coreclr\vm\threads.cpp @ 5136] 
08 000000a0`b87ff330 00007fff`a6f411d3     coreclr!ThreadSuspend::LockThreadStore+0x82 [D:\runtime9.0\src\coreclr\vm\threadsuspend.cpp @ 1885] 
09 (Inline Function) --------`--------     coreclr!ThreadStore::LockThreadStore+0x5 [D:\runtime9.0\src\coreclr\vm\threads.cpp @ 5158] 
0a (Inline Function) --------`--------     coreclr!StateHolder<&ThreadStore::LockThreadStore,&ThreadStore::UnlockThreadStore>::Acquire+0x5 [D:\runtime9.0\src\coreclr\inc\holder.h @ 349] 
0b (Inline Function) --------`--------     coreclr!StateHolder<&ThreadStore::LockThreadStore,&ThreadStore::UnlockThreadStore>::{ctor}+0x5 [D:\runtime9.0\src\coreclr\inc\holder.h @ 335] 
0c 000000a0`b87ff360 00007fff`a6ffdf85     coreclr!ThreadStore::AddThread+0x1f [D:\runtime9.0\src\coreclr\vm\threads.cpp @ 5184] 
0d 000000a0`b87ff390 00007fff`a6ffdd87     coreclr!SetupThread+0x1b5 [D:\runtime9.0\src\coreclr\vm\threads.cpp @ 725] 
0e 000000a0`b87ff430 00007fff`a6ffdc31     coreclr!SetupThreadNoThrow+0x6f [D:\runtime9.0\src\coreclr\vm\threads.cpp @ 821] 
0f 000000a0`b87ff4c0 00007fff`a6fff22f     coreclr!JIT_ReversePInvokeEnterRare+0x4d [D:\runtime9.0\src\coreclr\vm\jithelpers.cpp @ 5900] 
10 000000a0`b87ff510 00007fff`a376ab0a     coreclr!JIT_ReversePInvokeEnter+0x5f [D:\runtime9.0\src\coreclr\vm\jithelpers.cpp @ 6030] 
11 000000a0`b87ff540 00007ff8`a0d403bd     System_Private_CoreLib! [D:\runtime9.0\src\libraries\System.Private.CoreLib\src\System\Diagnostics\Tracing\EventProvider.cs @ 840] 
12 000000a0`b87ff5d0 00007ff8`a0d41ade     ntdll!EtwpEventApiCallback+0xe9 [minkernel\etw\ntdll\evntapi.c @ 310] 
13 000000a0`b87ff680 00007ff8`a0d6e787     ntdll!EtwpUpdateEnableInfoAndCallback+0xd6 [minkernel\etw\ntdll\evntsup.c @ 1586] 
14 000000a0`b87ff6d0 00007ff8`a0d6e33f     ntdll!EtwpProcessNotification+0x53 [minkernel\etw\ntdll\evntsup.c @ 1014] 
15 000000a0`b87ff700 00007ff8`a0d6e19d     ntdll!EtwDeliverDataBlock+0xcf [minkernel\etw\ntdll\evntsup.c @ 1089] 
16 000000a0`b87ff7e0 00007ff8`a0d5e2a2     ntdll!EtwpNotificationThread+0x6d [minkernel\etw\ntdll\notify.c @ 440] 
17 000000a0`b87ff970 00007ff8`a0d8ca7c     ntdll!TppExecuteWaitCallback+0xae [minkernel\threadpool\ntdll\wait.c @ 1611] 
18 000000a0`b87ff9c0 00007ff8`a0d45986     ntdll!TppDirectExecuteCallback+0xdc [minkernel\threadpool\ntdll\pool.c @ 3975] 
19 000000a0`b87ffa20 00007ff8`9fd5257d     ntdll!TppWorkerThread+0x8f6 [minkernel\threadpool\ntdll\worker.c @ 1149] 
1a 000000a0`b87ffd00 00007ff8`a0d6aa48     KERNEL32!BaseThreadInitThunk+0x1d [clientcore\base\win32\client\thread.c @ 75] 
1b 000000a0`b87ffd30 00000000`00000000     ntdll!RtlUserThreadStart+0x28 [minkernel\ntdll\rtlstrt.c @ 1166] 

Copy link
Contributor

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

@Maoni0
Copy link
Member Author

Maoni0 commented Jun 13, 2024

known test errors in SslStream tests.

@Maoni0 Maoni0 merged commit bfb028b into dotnet:main Jun 13, 2024
87 of 89 checks passed
@github-actions github-actions bot locked and limited conversation to collaborators Jul 13, 2024
@Maoni0
Copy link
Member Author

Maoni0 commented Sep 6, 2024

/backport to release/8.0-staging

@github-actions github-actions bot unlocked this conversation Sep 6, 2024
Copy link
Contributor

github-actions bot commented Sep 6, 2024

Started backporting to release/8.0-staging: https://github.com/dotnet/runtime/actions/runs/10744029416

@github-actions github-actions bot locked as resolved and limited conversation to collaborators Sep 6, 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.

2 participants