-
-
Notifications
You must be signed in to change notification settings - Fork 984
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
Fix linux crash from disassembler #2413
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@timcassell thank you for providing a quick fix!
After reading dotnet/runtime#90794 (comment) I wonder whether we should simply unconditionally not try to map 0
and -1
. Thoughts?
This comment was marked as outdated.
This comment was marked as outdated.
@adamsitnik It looks like the IntelDisassembler already checks for it
But I guess that doesn't really catch it, because the address we're checking is |
I changed it to always check for |
Yes, -1 is treated in a special way in DAC. See e.g.:
This is true for Windows (actually, less or equal to that value are invalid). For Unix, this can differ based on the memory page size. On Linux, it is 4096 in most cases and 65536 for the case when the Linux kernel is configured for 64kB page size (some arm64 systems use that). But it can be different. For example, in WSL2 on Windows, it is 65536. The |
@janvorli How can I use that to get the value on Linux? I tried |
You are trying to run it, if that's the command you gave.
|
8d125d0
to
a5dc597
Compare
54fae10
to
3b51864
Compare
@adamsitnik This should be good to go, if you could take a look. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The changes look OK, but we have lost a possibility to map certain addresses.
Every time we introduce changes to the disassembler I run a sample benchmark with --disasmFilter *
to get the disassembly of everything that we can on Win x64, Lin x64 and arm64.
dotnet run -c Release -f net7.0 --filter BenchmarkDotNet.Samples.IntroDisassembly.SumLocal --disasmFilter '*'
I've run this command on master branch, created a copy of the exported asm file and then run it against your branch. When eyeballing the diff I've found:
The smallest repro is:
dotnet run -c Release -f net7.0 --filter BenchmarkDotNet.Samples.IntroDisassembly.SumLocal --disasmFilter "BenchmarkDotNet.Characteristics.CharacteristicSetPresenter..ctor()"
@timcassell PTAL
@adamsitnik I spent a few hours trying to figure out why that was happening. I finally found that if I delete my |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM, thank you @timcassell
I spent a few hours trying to figure out why that was happening. I finally found that if I delete my BenchmarkDotNet.Samples\bin directory before running, it works as expected. If I run it twice in a row without deleting it, I get the missing ctor method. I see the same behavior on master, so it's unrelated to my changes.
@janvorli it would be great if we could debug it one day
I have experimented with this a bit - just changing the runtime version in the test command line to 8.0. I cannot reproduce the behavior that @timcassell has seen, it fails to discover the method name for the constructor call all the time, even if I deleted the bin/obj folders before. |
dotnet/runtime#90794
Fixes #2404