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

Create a 32-bit and a 64-bit exe #11

Open
0xd4d opened this issue Feb 7, 2019 · 13 comments
Open

Create a 32-bit and a 64-bit exe #11

0xd4d opened this issue Feb 7, 2019 · 13 comments

Comments

@0xd4d
Copy link

0xd4d commented Feb 7, 2019

CLRMD can only attach to processes with the same bitness. StringTheory is currently prefer32bit AnyCpu so it won't be able to attch to 64-bit processes. If you try to attach to it, CLRMD throws Microsoft.Diagnostics.Runtime.ClrDiagnosticsException but the exception is ignored by the app and it just keeps showing the indeterminate progressbar.

@drewnoakes
Copy link
Owner

Thanks, and good point. So far I've just been looking at devenv.exe. I'll set up a build to produce to executables.

@glenn-slayden

This comment has been minimized.

@0xd4d

This comment has been minimized.

@glenn-slayden

This comment has been minimized.

@drewnoakes

This comment has been minimized.

@glenn-slayden

This comment has been minimized.

@drewnoakes

This comment has been minimized.

@drewnoakes
Copy link
Owner

Reopening this as I'd like to automate production of the release archive, meaning a single script produces both builds.

@glenn-slayden

This comment has been minimized.

@aolszowka
Copy link

FWIW if it really only is removing that flag you can use CorFlags (https://docs.microsoft.com/en-us/dotnet/framework/tools/corflags-exe-corflags-conversion-tool) to remove it from the binary. That is what we're doing now to work around this issue.

Use like this (modifies the binary):

corflags.exe StringTheory.exe /32BITPREF-

We are/were seeing weird behavior where if we attempted to open up a dump from a x64 context that String-Theory would spin and spin without coming back but after applying the fix to remove the prefer 32bit flag it comes back instantly. Very helpful for us debugging dumps from 64bit MSBuild. Would you like me to open up another bug for that?

@drewnoakes
Copy link
Owner

@aolszowka thanks for the insight here. It'll be useful when revisiting this.

If it's spinning indefinitely that's a bug. If you have a way to repro it then yes please, open a bug. If you run StringTheory in a debugger, is there an exception that's being swallowed? Can you see what it's doing when spinning?

@aolszowka
Copy link

@drewnoakes So apparently the issue is only in the released binary; after git-ing and building from source it appears you recently change this to throw the exception up and put it in the clipboard:

System.AggregateException: One or more errors occurred. ---> System.InvalidOperationException: Mismatched architecture between this process and the dac.
   at Microsoft.Diagnostics.Runtime.DataTarget.CreateRuntime(ClrInfo clrInfo) in S:\GitHub\string-theory\clrmd\src\Microsoft.Diagnostics.Runtime\src\DataTargets\DataTarget.cs:line 280
   at Microsoft.Diagnostics.Runtime.ClrInfo.CreateRuntime() in S:\GitHub\string-theory\clrmd\src\Microsoft.Diagnostics.Runtime\src\DataTargets\ClrInfo.cs:line 96
   at StringTheory.Analysis.HeapAnalyzer..ctor(DataTarget dataTarget) in S:\GitHub\string-theory\StringTheory\Analysis\HeapAnalyzer.cs:line 35
   at StringTheory.Analysis.HeapAnalyzer..ctor(String dumpFilePath) in S:\GitHub\string-theory\StringTheory\Analysis\HeapAnalyzer.cs:line 17
   at StringTheory.UI.HomePage.<>c__DisplayClass19_1.<.ctor>b__4(Action`1 progressCallback, CancellationToken token) in S:\GitHub\string-theory\StringTheory\UI\HomePage.cs:line 52
   at StringTheory.UI.LoadingOperation.<Start>b__10_0() in S:\GitHub\string-theory\StringTheory\UI\LoadingOperation.cs:line 34
   at System.Threading.Tasks.Task`1.InnerInvoke()
   at System.Threading.Tasks.Task.Execute()
   --- End of inner exception stack trace ---
---> (Inner Exception #0) System.InvalidOperationException: Mismatched architecture between this process and the dac.
   at Microsoft.Diagnostics.Runtime.DataTarget.CreateRuntime(ClrInfo clrInfo) in S:\GitHub\string-theory\clrmd\src\Microsoft.Diagnostics.Runtime\src\DataTargets\DataTarget.cs:line 280
   at Microsoft.Diagnostics.Runtime.ClrInfo.CreateRuntime() in S:\GitHub\string-theory\clrmd\src\Microsoft.Diagnostics.Runtime\src\DataTargets\ClrInfo.cs:line 96
   at StringTheory.Analysis.HeapAnalyzer..ctor(DataTarget dataTarget) in S:\GitHub\string-theory\StringTheory\Analysis\HeapAnalyzer.cs:line 35
   at StringTheory.Analysis.HeapAnalyzer..ctor(String dumpFilePath) in S:\GitHub\string-theory\StringTheory\Analysis\HeapAnalyzer.cs:line 17
   at StringTheory.UI.HomePage.<>c__DisplayClass19_1.<.ctor>b__4(Action`1 progressCallback, CancellationToken token) in S:\GitHub\string-theory\StringTheory\UI\HomePage.cs:line 52
   at StringTheory.UI.LoadingOperation.<Start>b__10_0() in S:\GitHub\string-theory\StringTheory\UI\LoadingOperation.cs:line 34
   at System.Threading.Tasks.Task`1.InnerInvoke()
   at System.Threading.Tasks.Task.Execute()<---

Might be worth updating the binary drop. Its my bad because its the first place I go unless I think I found an issue (I should have cloned and repo'ed it on the latest; sorry!).

@drewnoakes
Copy link
Owner

Another idea is creating both 32/64 bit sub processes so that the user doesn't have to know ahead of time which version to launch.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants