-
Notifications
You must be signed in to change notification settings - Fork 4.5k
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
The first sos command fails in live user mode debugging #8909
Comments
I've experienced this too, when running debugger tests. |
Are you running .NET Core because the desktop SOS was loaded?
|
@swgillespie , @mikem8361: ahh, you were right, sorry for the confusion. It works perfectly with .NET Core as you can see it in the example below.
|
I actually have observed the same issue with dump files (with .NET Framework), but only if the dump has been taken on the same computer as the one I'm using to run Windbg. It makes me think it could be an issue in the codepath used by Windbg when loading the local mscordacwks.dll (when opening a dump from another machine, the file will instead be fetched from the symbol store) |
I have been hitting this issue on nearly a daily basis for several years now. Further details as well as the cause are included in #5193. It is a bug in dbgeng. However, that is not part of the CoreClr stack, so the issue was worked around in dotnet/coreclr#3513. No such workaround (or a proper fix) has made it to the full CLR. |
I'm not that familiar with the desktop process and where to file a bug. I'm including @lt72. He may be able to address that. |
@bendono: you made a pretty good job there! Thanks for letting me know the details. It seems that I need to improve my search skills before submitting a duplicate issue. Lesson learned. :-) |
I reported this to the windbg team back in february last year, it's because dbgeng.dll fails to realise that the currently loaded sos version is the correct one, so sos gets reinitialized, Andy Luhrs said they had filed an issue internally. Here is my original report: If I
– then the command throws an exception first time its run, but works afterwards: Upon further investigation it turns out that g_ExtControl is indeed initialized, until the IG_GET_CLR_DATA_INTERFACE ioctl is performed in LoadClrDebugDll. This causes dbgeng to attempt to find and load the version of SoS that belongs to the version of the CLR loaded in the memory dump. This would normally be fine, however in this case the version of SoS to load is the same as the one already loaded, and that the ioctl was called from. This results in SoS being reinitialized which in turn resets the interface pointers in sos!DebugExtensionInitialize (and leaking reference to the old ones). The version of DbgEng.dll I have tested this with is 10.0.10586.0, and sos.dll is 4.6.1038.0 |
We will try to include a fix to the desktop SOS for the next update or immediately after. We will create a desktop tracking issue. Since this is fixed in coreclr would you mind closing this issue? |
@mikem8361 The CoreCLR fixes this by working around the problem in dbgeng.dll. I imagine a similar workaround could be done for the full desktop, but has there been any consideration to fixing the actual problem in dbgeng.dll? I would think that addressing the real problem would be the better fix than a workaround. |
@bendono Andy Lurhs (Program Manager for Debugging Tools for Windows) told me they had filed the issue as a bug, so I assume that means that they intend to fix it. However that was back in february last year and the issue is still present in the recent "WinDbg Preview", so it would seem that they consider it quite low priority. |
Thank you all for the clarification and details provided. I close this issue as it can be considered fixed in coreclr. |
The text was updated successfully, but these errors were encountered: