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

Teach the DAC how to unwrap ComWrappers-based CCWs #36048

Closed
jkoritzinsky opened this issue May 7, 2020 · 7 comments · Fixed by #36360
Closed

Teach the DAC how to unwrap ComWrappers-based CCWs #36048

jkoritzinsky opened this issue May 7, 2020 · 7 comments · Fixed by #36360

Comments

@jkoritzinsky
Copy link
Member

To ensure that we get an accurate diagnostics experience for RCWs and CCWs that use the new ComWrappers APIs, we should enlighten the DAC to how to discover them and dump them.

Additionally, this work should include updating the DAC's support for dumping a stowed exception to be able to unwrap ComWrappers-based CCW stowed exceptions.

Related: microsoft/CsWinRT#201, #35318

@ghost
Copy link

ghost commented May 7, 2020

Tagging subscribers to this area: @tommcdon
Notify danmosemsft if you want to be subscribed.

@Dotnet-GitSync-Bot Dotnet-GitSync-Bot added the untriaged New issue has not been triaged by the area owner label May 7, 2020
@jkoritzinsky
Copy link
Member Author

cc: @AaronRobinsonMSFT @tommcdon

@AaronRobinsonMSFT
Copy link
Member

@jkoritzinsky Thanks for filing this. Can you elaborate on what information would be helpful? The details that are in the ComWrappers RCW/CCW are vastly different than the built in ones.

@jkoritzinsky
Copy link
Member Author

For the stowed exception scenario in particular, the DAC needs to be able to identity an interface pointer as a ComWrappers CCW interface pointer, retrieve the managed object, and dump the managed object.

The implementations of

// COM
HRESULT GetRCWData(CLRDATA_ADDRESS addr, struct DacpRCWData *data);
HRESULT GetRCWInterfaces(CLRDATA_ADDRESS rcw, unsigned int count, struct DacpCOMInterfacePointerData *interfaces, unsigned int *pNeeded);
HRESULT GetCCWData(CLRDATA_ADDRESS ccw, struct DacpCCWData *data);
HRESULT GetCCWInterfaces(CLRDATA_ADDRESS ccw, unsigned int count, struct DacpCOMInterfacePointerData *interfaces, unsigned int *pNeeded);
HRESULT TraverseRCWCleanupList(CLRDATA_ADDRESS cleanupListPtr, VISITRCWFORCLEANUP pCallback, LPVOID token);
are what we need to enlighten.

In particular, GetCCWData at

HRESULT ClrDataAccess::GetCCWData(CLRDATA_ADDRESS ccw, struct DacpCCWData *ccwData)
is the function that the "dump stowed exception" path uses to unwrap the stowed exception object and get the information for the user.

@jkoritzinsky
Copy link
Member Author

jkoritzinsky commented May 8, 2020

If we implement all of the mentioned functions for the DAC, I think that will enable all of the CCW/RCW related SOS commands for ComWrappers CCWs and RCWs as well.

@AaronRobinsonMSFT
Copy link
Member

This is going to be unfortunate. I was hoping to avoid having a DAC build of the interoplib. We might want to redesign some of the data structures so the header contains everything. Don't know if that has already been done.

@tommcdon
Copy link
Member

tommcdon commented May 8, 2020

@noahfalk

@tommcdon tommcdon removed the untriaged New issue has not been triaged by the area owner label May 8, 2020
@tommcdon tommcdon added this to Needs Triage in .NET Core Diagnostics via automation May 8, 2020
@tommcdon tommcdon added this to the 5.0 milestone May 8, 2020
.NET Core Diagnostics automation moved this from Needs Triage to Done May 14, 2020
@ghost ghost locked as resolved and limited conversation to collaborators Dec 9, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
Development

Successfully merging a pull request may close this issue.

4 participants