-
Notifications
You must be signed in to change notification settings - Fork 2.6k
Fix MacOS launch bug when spaces in module names. #20402
Conversation
cd66ac2
to
a2fa3cb
Compare
@dotnet-bot test this please |
I guess the build is partly broken in this branch at least for arm64
|
char moduleName[PATH_MAX]; | ||
|
||
if (sscanf_s(line, "__TEXT %p-%p [ %*[0-9K ]] %*[-/rwxsp] SM=%*[A-Z] %s\n", &startAddress, &endAddress, moduleName, _countof(moduleName)) == 3) | ||
if (sscanf_s(line, "__TEXT %p-%p [ %*[0-9K ]] %*[-/rwxsp] SM=%*[A-Z] %[^\n]", &startAddress, &endAddress, moduleName, _countof(moduleName)) == 3) |
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.
Out of curiosity, can the VSIZE RSDNT DIRTY SWAP
fields never have an M
in there for megabytes? Are they always in kilobytes?
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.
As far as I know they are always in KB. This isn't well documented.
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.
Yeah I couldn't find any info on this (though I also wasn't sure what to search for).
Is it possible to create a test case with an app that has a really large "one of those things" to see what it is? E.g. what if an app has more than 99,999KB of VSIZE? (only 5-digit numbers fit in the table)
The arm64 build failures are in the 2.2 branch and nothing to do with my changes. I’m sync’ing and will push a new commit with the latest 2.2 branch just in case it was fixed.
|
a2fa3cb
to
ec5e531
Compare
To be clear, my change didn’t affect any of that part of the parsing. Just the module name at the end. It has been this way since 1.1.
|
Approved for 2.2 |
Is it worth looking into the parsing further? To be clear, I have no background in this at all, just saw something curious. |
@Eilon you could write up an issue to investigate this more and assign it to me. |
Shiproom template
Description
The libdbgshim.dylib launch/attach helper had a bug with module names with spaces in them. The Excel (Oded Hanson) ran into this because ship the .NET Core in a sub-directory with a space in the path.
This causes launch (or attach) with VS (VSCode or VS for Mac) to hang..
The fix is to change the vmmap output parsing to include the rest of the line as the module name.
Customer Impact
Without this fix, Excel can not debug their product and an official build is needed to get the dbgshim for insertion into VS vsdbg to fix the problem.
Regression?
No.
Risk
Low.
Link to issue
https://github.com/dotnet/coreclr/issues/20401