-
Notifications
You must be signed in to change notification settings - Fork 154
Update Microsoft.Diagnostics.Runtime.Utilities to first publicly stable version #1143
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
Conversation
- Update the dbgeng extension to use NativeAOT. - Update the dbgeng extension to use the new debugger plugin paradigm in the most recent ClrMD.
@AArnott (From our email discussion.) Unfortunately I was not able to build or test this change. So, if you decide this is the direction you want to go in, you’ll need to build/test the changes I’ve made. I’m about to go on vacation so I’m unfortunately out of time on this project. :( |
Thanks. I'll take a look. Unfortunately it appears you based your changes on a commit from before #1138 merged, so you not only have merge conflicts, but that may be why the diff in this PR wasn't conveying what you expected it to. I'd like to try out NativeAOT though, so I'll see what I can make of your PR. |
@leculver, I merged main into your branch. It doesn't build, I think because you didn't add/update any PackageReference or PackageVersion items, so the new work you did in another repo doesn't show up here. We're getting errors such as:
Do you have time to push another commit?
From your email it sounds like you simply don't have the required SDK installed. This repo requires the .NET 7.0.101 SDK (allowing for higher patch versions). You can either install that SDK (which our init.ps1 script will do for you) or you can change the |
Oh, that fixed it. The init.ps1 script did fix it, but I'm not sure how I didn't have that .Net 7 (or greater) build on my machine. I was just testing something using that SDK on Monday! Strange... The errors you see are due to the Microsoft.Diagnostics.Runtime.Utilities package not being fully updated to this one: https://www.nuget.org/packages/Microsoft.Diagnostics.Runtime.Utilities/2.3.405501 which was shipped yesterday. I attempted to update to that version, but I'm getting NuGet errors. In particular, this feed seems to have Microsoft.Diagnostics.Runtime.Utilities packages for versions I've never shipped: Are you using a different M.D.R.U library? Can you update that package feed to point to the real one on NuGet? |
The feed we consume from uses nuget.org as an upstream, so all I had to do was switch the Directory.Packages.props file over to the new versions and the compilation worked. I've pushed that change to your branch. I'm testing out your changes now. |
The native code generation step fails for Debug builds:
The release configuration builds just fine (with the System.Net.Http warning notwithstanding), and it appears to work, so that's great. |
That is unfortunately expected, and should be ignored. ClrMD does use System.Net.Http, but not in any way that triggers a NativeAOT failure (it doesn't go down codepaths using reflection). I'm not clear on whether the Http library simply hasn't been updated to fully support NativeAOT (not all libraries have). Or whether there's a real problem with Http and we should be using something else when making symbol server requests. Either way, I haven't had any issues with ClrMD+NativeAOT, despite what the warning says. |
Any idea why the debug build fails to produce native code? I'm also curious about the dev inner loop, considering any change to SosThreadingTools made locally will have to be run through |
Apparently the debug config failure was an incremental build issue. It worked after I cleaned the repo. |
Ah glad you figured that out.
So I actually build the library as a pure IL library too. I load up DbgEng from disk, load a crash dump, then call my extension directly. Here's the startup path: https://github.com/microsoft/clrmd/blob/main/src/Samples/DbgEngStandalone/Program.cs#L20-L35 Then for my DbgEng commands I simply initialize with that DbgEng instance and run them directly (unit tests would work similarly): https://github.com/microsoft/clrmd/blob/main/src/Samples/DbgEngStandalone/Program.cs#L20-L35 This leads to a really good inner-dev loop...it's all C# code (not compiled to NativeAOT), and my F5 loads dbgeng as a dll...you don't have to interact with windbg/cdb just to test. I didn't add that constructor override to your code, one sec I'm going to push a change to add that. |
Ooh... I just saw this error:
We build a win-x86 binary so it can be loaded into x86 WinDbg for x86 process debugging. It looks like this is still required, as WinDbgX's debug engine crashes when we try to load 64-bit SosThreadingTools for a 32-bit dump file. |
Ah shoot. I've been doing pure x64 debugging, so I never ran into that. I suppose this won't work for you after all. =( |
This is because AOT doesn't support win-x86.
A lot of changes are required for this upgrade. Nearly all of them were originally crafted with the end in mind of going with NativeAOT, but that doesn't support win-x86, so we're sticking with DNNE, but otherwise most of the changes @leculver prepared are good and forward-looking.