Repository navigation
SOS fixes for regions - #3062
Conversation
…rk for regions correctly, and that we haven't fixed GCHeapSnapshot::GetGeneration for regions yet.
| // TODO: This needs to be put on the Dac side. | ||
| if (this->segmentAddr == heap.generation_table[0].start_segment) | ||
| highAllocMark = heap.alloc_allocated; | ||
| if (heap.generation_table[0].start_segment != heap.generation_table[1].start_segment) |
There was a problem hiding this comment.
hmm, this should be pushed down further into the DAC, basically QI and call something that encapsulates all this logic and falls back to the logic prior to this PR as needed. There you could ask IsRegionGCEnabled (and maybe that is also something that should be exposed as an API on the DAC for cases like this).
There was a problem hiding this comment.
Excuse my ignorance, but how exactly would I go about "pushing it further into the DAC"? I was trying to get by with a local change in SOS, but perhaps this isn't the right way to go? Keep in mind I only have the foggiest notions about DAC...
There was a problem hiding this comment.
The DAC is the runtime version specific component (in the runtime repo) that SOS calls (the GetHeapSegmentData call). Like Juan said it would be better to make the change in the runtime repo code but as long as this change doesn't break the SOS heap commands when targeting a 3.1 or 6.0 runtime, then I think it is ok.
There was a problem hiding this comment.
I see this needs more thought. I also realized that there are more places in SOS (eeheap.cpp mostly) that need changes for regions. I'll see if I can work something out.
There was a problem hiding this comment.
I worked out a fix on the DAC side here: dotnet/runtime#69670.
I fixed more place to use seg.highAllocMark instead of seg.allocated.
I kept a small change in dacprivate.h to make sure a new SOS would keep working with an older DAC, and also that SOS would not step on the highAllocMark set in DAC.
…s work correctly for older DACs with segments. Fix more places where we need to use highAllocMark.
|
It looks like all the SOS GC tests are failing. Can seem to find the byte[] on the stack with DumpStackObjects. Not sure exactly how your changes affected this. The byte[] is here in the GCPOH.cs source. You can run the tests locally with "test.cmd" on Windows or "test.sh" on Linux. |
|
I wondered whether it's a good idea to essentially replicate the logic SOS has for this on the DAC side, and keep the SOS logic in for older DACs. One argument in favor is that it enables us to change the DAC in case the rules change some day, and not change SOS. Anyway, this should work now with or without the DAC change. |
1 similar comment
|
I wondered whether it's a good idea to essentially replicate the logic SOS has for this on the DAC side, and keep the SOS logic in for older DACs. One argument in favor is that it enables us to change the DAC in case the rules change some day, and not change SOS. Anyway, this should work now with or without the DAC change. |
The SOS logic needs to stay so that it can serve older runtimes with unchanged DAC. |
Fix setting of DacpHeapSegmentData::highAllocMark on DAC side. Keep some logic for backward compat in dacprivate.h, the copy here and the one in the Diagnostics repo, so that a new SOS can work correctly with an older DAC. The PR in the diagnostics repo is this: dotnet/diagnostics#3062.
* Update dependencies from https://github.com/dotnet/aspnetcore build 20220406.3 (#2990) [main] Update dependencies from dotnet/aspnetcore * Update dependencies from https://github.com/dotnet/runtime build 20220406.5 (#2991) [main] Update dependencies from dotnet/runtime * Set the build ID using arcade's scripts instead of retrieving it from another job (#2993) * Update dependencies from https://github.com/dotnet/source-build-reference-packages build 20220328.1 (#2967) [main] Update dependencies from dotnet/source-build-reference-packages * Update dependencies from https://github.com/dotnet/arcade build 20220406.10 (#3000) [main] Update dependencies from dotnet/arcade * Update dependencies from https://github.com/dotnet/symstore build 20220410.1 (#3002) Microsoft.SymbolStore From Version 1.0.320401 -> To Version 1.0.321001 Co-authored-by: dotnet-maestro[bot] <dotnet-maestro[bot]@users.noreply.github.com> * Update dependencies from https://github.com/dotnet/installer build 20220410.6 (#3001) Microsoft.Dotnet.Sdk.Internal From Version 6.0.104-servicing.22181.15 -> To Version 6.0.104-servicing.22210.6 Co-authored-by: dotnet-maestro[bot] <dotnet-maestro[bot]@users.noreply.github.com> * Update dependencies from https://github.com/dotnet/symstore build 20220411.1 (#3007) [main] Update dependencies from dotnet/symstore * Update dependencies from https://github.com/dotnet/aspnetcore build 20220411.2 (#3006) [main] Update dependencies from dotnet/aspnetcore * Update dependencies from https://github.com/dotnet/runtime build 20220411.4 (#3008) [main] Update dependencies from dotnet/runtime * Update dependencies from https://github.com/dotnet/runtime build 20220412.7 (#3011) [main] Update dependencies from dotnet/runtime * Update dependencies from https://github.com/dotnet/symstore build 20220412.1 (#3010) [main] Update dependencies from dotnet/symstore * Rewrite DumpAsync in C# (#2964) * Rewrite DumpAsync in C# This rewrites the dumpasync command as a C# SOS extension. Doing so makes the code easier to maintain and add features to in the future. Along with the rewrite, a variety of requests for the feature have been satisfied: - Added a "coalesced stacks" view (`--coalesce`) that coalesces stacks together to create a high-level view of the state of the process - Improved filtering so that a specified filter (address, method table, substring) applies to any frame of a stack and not just to the top frame - Improved stack stitching to always consider task objects from the heap and not just if `--tasks` was specified. This helps to better connect state machines separated by constructs like Task.Run. - Added synthesized frames to try to show what's being awaited in the case where the top frame is an async method. - Added DML links for more things to better navigate through results. * Fix tests * Fix tests for DumpAsync on WebApp3 * Skip visiting tasks multiple times * Special case completion sentinnel * Only synthesize faux awaiter frame if the task is not completed. * PR feedback Co-authored-by: Juan Sebastian Hoyos Ayala <[email protected]> * Update dependencies from https://github.com/dotnet/runtime build 20220413.11 (#3014) Microsoft.NETCore.App.Runtime.win-x64 , VS.Redist.Common.NetCore.SharedFramework.x64.6.0 From Version 6.0.5 -> To Version 6.0.5 Co-authored-by: dotnet-maestro[bot] <dotnet-maestro[bot]@users.noreply.github.com> * Update dependencies from https://github.com/dotnet/aspnetcore build 20220413.12 (#3013) [main] Update dependencies from dotnet/aspnetcore * Use symstore retry changes in tests (#2968) * Create clear error messages for dotnet-trace (#3012) * Catch UnauthorizedAccessException, Win32Exception and simplify for loop * altered to conventional C# style * Set symstore HTTP retry count in all test cases (#3015) * Set symstore HTTP retry count in all test cases * Update src/Microsoft.Diagnostics.DebugServices/ISymbolService.cs Co-authored-by: Juan Hoyos <[email protected]> * Code review feedback Co-authored-by: Juan Hoyos <[email protected]> * Update dependencies from https://github.com/dotnet/source-build-reference-packages build 20220415.1 (#3016) [main] Update dependencies from dotnet/source-build-reference-packages * Update dependencies from https://github.com/dotnet/arcade build 20220415.2 (#3017) [main] Update dependencies from dotnet/arcade * Update lldb instuctions (#3020) Mostly just delete distro versions that are not supported for any supported .NET version. * Use minipal in more places (#3019) * Port minipal/getexepath.h from runtime repo * Use ARRAY_SIZE from minipal in more places * Fix C4996 warning on windows * Introspect sys/auxv.h in SOS configuration * Fix include * [main] Update dependencies from dotnet/installer (#3018) * Update dependencies from https://github.com/dotnet/installer build 20220415.3 Microsoft.Dotnet.Sdk.Internal From Version 6.0.104-servicing.22210.6 -> To Version 6.0.105-servicing.22215.3 * Fix single-file runtime version Co-authored-by: dotnet-maestro[bot] <dotnet-maestro[bot]@users.noreply.github.com> Co-authored-by: Mike McLaughlin <[email protected]> * Update dependencies from https://github.com/dotnet/symstore build 20220418.1 (#3022) [main] Update dependencies from dotnet/symstore * Update dependencies from https://github.com/dotnet/source-build-reference-packages build 20220419.2 (#3023) [main] Update dependencies from dotnet/source-build-reference-packages * Create EventPipeFormat.md (#3024) * Update dependencies from https://github.com/dotnet/arcade build 20220422.4 (#3027) [main] Update dependencies from dotnet/arcade * Update dependencies from https://github.com/dotnet/installer build 20220419.37 (#3028) [main] Update dependencies from dotnet/installer * dotent-trace report - account for missing symbol (#3021) * Update dependencies from https://github.com/microsoft/clrmd build 20220426.1 (#3035) [main] Update dependencies from microsoft/clrmd * Write temp files to tempdir (#3031) * update to use viewport-relative coordinates (#3034) This fixes some rendering issues of dontet-counters, however, dotnet-counters renders incorrectly when: - terminal changes size while the tool is running - terminal is not wide enough to print the output As noted in #3036 * Update dependencies from https://github.com/dotnet/installer build 20220429.9 (#3038) [main] Update dependencies from dotnet/installer * Update dependencies from https://github.com/dotnet/arcade build 20220425.6 (#3037) [main] Update dependencies from dotnet/arcade * Update dependencies from https://github.com/dotnet/symstore build 20220502.1 (#3040) [main] Update dependencies from dotnet/symstore * Update dependencies from https://github.com/dotnet/source-build-reference-packages build 20220503.1 (#3043) [main] Update dependencies from dotnet/source-build-reference-packages * Update dependencies from https://github.com/dotnet/aspnetcore build 20220503.6 (#3041) [main] Update dependencies from dotnet/aspnetcore * Update dependencies from https://github.com/dotnet/source-build-reference-packages build 20220504.3 (#3045) [main] Update dependencies from dotnet/source-build-reference-packages * Update dependencies from https://github.com/dotnet/aspnetcore build 20220504.26 (#3044) [main] Update dependencies from dotnet/aspnetcore * Update dependencies from https://github.com/dotnet/aspnetcore build 20220505.18 (#3046) [main] Update dependencies from dotnet/aspnetcore * Update dependencies from https://github.com/dotnet/source-build-reference-packages build 20220505.1 (#3048) [main] Update dependencies from dotnet/source-build-reference-packages * Update dependencies from https://github.com/microsoft/clrmd build 20220505.1 (#3047) [main] Update dependencies from microsoft/clrmd * Update EventPipeStress (#3049) * Update dependencies from https://github.com/dotnet/arcade build 20220505.2 (#3052) [main] Update dependencies from dotnet/arcade * Update dependencies from https://github.com/dotnet/installer build 20220504.12 (#3053) [main] Update dependencies from dotnet/installer * Update dependencies from https://github.com/microsoft/clrmd build 20220509.1 (#3056) [main] Update dependencies from microsoft/clrmd * Update dependencies from https://github.com/dotnet/source-build-reference-packages build 20220509.4 (#3058) [main] Update dependencies from dotnet/source-build-reference-packages * Update dependencies from https://github.com/dotnet/symstore build 20220509.1 (#3057) [main] Update dependencies from dotnet/symstore * Update dependencies from https://github.com/dotnet/aspnetcore build 20220509.8 (#3055) [main] Update dependencies from dotnet/aspnetcore * Port setsymbolserver command to C# (#3050) * Port setsymbolserver command to C# Fixes issue: #3032 Removes quite a bit of native and interop code. Remove some noisy logging in success paths. Rename ISymbolService.DownloadModule to DownloadModuleFile. Add ISymbolService.DownloadSymbolFile. Rename some IModule properties to functions. Add IModule.LoadSymbols(). Fix MacOS test failures Make setsymbolserver a global command * Update dependencies from https://github.com/dotnet/aspnetcore build 20220510.8 (#3063) [main] Update dependencies from dotnet/aspnetcore * Enable SDL required warnings explicitly (#3054) * Enable SDL required warnings explicitly * Fix build issues that don't escape on failure properly * Add devcontainer infra to diagnostics repo (#2986) * Pass by reference (#3066) * Update dependencies from https://github.com/dotnet/aspnetcore build 20220512.8 (#3070) [main] Update dependencies from dotnet/aspnetcore * Fix Typo (#3071) * Misc dbgshim and SOS fixes (#3072) * Fix some issues found with netcoredbg * Fix some sign-extension issues on alpine arm32 * Fix DbgShim.UnitTest's Microsoft.Diagnostics.DbgShimAPI+NativeRuntimeStartupCallbackDelegate being called after collected by the GC * Code review feedback * [main] Update dependencies from dotnet/installer (#3076) [main] Update dependencies from dotnet/installer - Update single-file version * Update dependencies from https://github.com/dotnet/symstore build 20220516.1 (#3079) [main] Update dependencies from dotnet/symstore * Update dependencies from https://github.com/dotnet/arcade build 20220512.8 (#3075) [main] Update dependencies from dotnet/arcade * Update dependencies from https://github.com/dotnet/source-build-reference-packages build 20220511.1 (#3068) [main] Update dependencies from dotnet/source-build-reference-packages * Update dependencies from https://github.com/dotnet/arcade build 20220519.3 (#3086) [main] Update dependencies from dotnet/arcade * Enable shipping dbgshim packages (#3088) * Add error message to WriteDump response (#3084) Add error message to WriteDump response Add the new generate core dump command that can receive error text on failure. Fix issue #2976 * Use Environment.GetFolderPath to obtain home directory (#3087) * Use Environment.GetFolderPath to obtain home directory * Format documents in changeset * Update dependencies from https://github.com/dotnet/symstore build 20220523.1 (#3091) [main] Update dependencies from dotnet/symstore * Update dependencies from https://github.com/dotnet/source-build-reference-packages build 20220520.1 (#3085) [main] Update dependencies from dotnet/source-build-reference-packages * SOS fixes for regions (#3062) Noticed that DacpHeapSegmentData::Request doesn't set the highAllocMark for regions correctly, and that we haven't fixed GCHeapSnapshot::GetGeneration for regions yet. Moved fix for highAllocMark into the DAC, but keep some logic here so things work correctly for older DACs with segments. Fix more places where we need to use highAllocMark. Kudos to @cshung for pointing out the better way to fix this! * Update dependencies from https://github.com/dotnet/arcade build 20220526.1 (#3096) [main] Update dependencies from dotnet/arcade * Update dependencies from https://github.com/dotnet/installer build 20220527.1 (#3097) [main] Update dependencies from dotnet/installer * Update dependencies from https://github.com/dotnet/symstore build 20220530.1 (#3098) [main] Update dependencies from dotnet/symstore * Fix dbgshim's OpenVirtualProcess on windows arm64 (#3099) Co-authored-by: dotnet-maestro[bot] <42748379+dotnet-maestro[bot]@users.noreply.github.com> Co-authored-by: Juan Hoyos <[email protected]> Co-authored-by: dotnet-maestro[bot] <dotnet-maestro[bot]@users.noreply.github.com> Co-authored-by: Stephen Toub <[email protected]> Co-authored-by: Juan Sebastian Hoyos Ayala <[email protected]> Co-authored-by: mikelle-rogers <[email protected]> Co-authored-by: Dan Moseley <[email protected]> Co-authored-by: Adeel Mujahid <[email protected]> Co-authored-by: John Salem <[email protected]> Co-authored-by: Andrew Au <[email protected]> Co-authored-by: Martin-Molinero <[email protected]> Co-authored-by: Peter Sollich <[email protected]>
Noticed that DacpHeapSegmentData::Request doesn't set the highAllocMark for regions correctly, and that we haven't fixed GCHeapSnapshot::GetGeneration for regions yet.
This caused issues with checking card table entries in VerifyHeap, and SOS sometimes erroneously thinking that an object is not on the managed heap.
I'm not familiar with the exact interplay between SOS and DAC, so there may be a better way to do it.