Skip to content

[.NET] DotNetDiver.GetObject throws "Loading this assembly would produce a different grant set from other instances." #9

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

Open
theXappy opened this issue Jul 26, 2024 · 0 comments
Labels
bug Something isn't working

Comments

@theXappy
Copy link
Owner

In some cases, a call to DotNetDiver.GetObject throws a FileLoadException when inspecting the instance retrieved from the heap.

The FileLoadException's message is:
"Loading this assembly would produce a different grant set from other instances. (Exception from HRESULT: 0x80131401)"
Stack Trace:

This exception was originally thrown at this call stack:
    System.RuntimeType.RuntimeTypeCache.RuntimeTypeCache(System.RuntimeType)
    System.RuntimeType.Cache.get()
    System.RuntimeType.FullName.get()
    ScubaDiver.DotNetDiver.GetObject(ulong, bool, string, int?) in DotNetDiver.cs

Example target:
J𝚎tBrains dotP𝚎𝚎k 2024.1.4
Build 241.0.20240623.154825 built on 2024-06-23

How to reproduce:
Use RemoteNetSpy.
Look an instance of J𝚎tBrains.R𝚎Sharper.ExternalSources.ILViewer.Actions.ViewIlCodeActionHandler in the heap.
Once found, try to freeze it.

Guesses?
This might be happening because the target had 2 domains: A default one and a custom one.
Our diver was running in the default domain so perhapse the dumped object was in the custom one and that cause this error.
I'd not the DLL that failed to load is a legitimate one by the app.

@theXappy theXappy added the bug Something isn't working label Jul 26, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

1 participant