Skip to content
This repository was archived by the owner on Jan 23, 2023. It is now read-only.
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 4 additions & 1 deletion src/pal/src/thread/process.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -2716,6 +2716,9 @@ CreateProcessModules(
// Stack 00007fff5a930000-00007fff5b130000 [ 8192K 32K 32K 0K] rw-/rwx SM=PRV thread 0
// __TEXT 00007fffa4a0b000-00007fffa4a0d000 [ 8K 8K 0K 0K] r-x/r-x SM=COW /usr/lib/libSystem.B.dylib
// __TEXT 00007fffa4bbe000-00007fffa4c15000 [ 348K 348K 0K 0K] r-x/r-x SM=COW /usr/lib/libc++.1.dylib

// NOTE: the module path can have spaces in the name
// __TEXT 0000000196220000-00000001965b4000 [ 3664K 2340K 0K 0K] r-x/rwx SM=COW /Volumes/Builds/builds/devmain/rawproduct/debug/build/out/Applications/Microsoft Excel.app/Contents/SharedSupport/PowerQuery/libcoreclr.dylib
char *line = NULL;
size_t lineLen = 0;
int count = 0;
Expand All @@ -2737,7 +2740,7 @@ CreateProcessModules(
void *startAddress, *endAddress;
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)
Copy link

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?

Copy link
Author

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.

Copy link

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)

{
bool dup = false;
for (ProcessModules *entry = listHead; entry != NULL; entry = entry->Next)
Expand Down