Skip to content
This repository was archived by the owner on Jan 23, 2023. It is now read-only.

Commit bba9fda

Browse files
author
Mike McLaughlin
authored
Fix MacOS launch bug when spaces in module names. (#20402)
1 parent e809449 commit bba9fda

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

src/pal/src/thread/process.cpp

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2716,6 +2716,9 @@ CreateProcessModules(
27162716
// Stack 00007fff5a930000-00007fff5b130000 [ 8192K 32K 32K 0K] rw-/rwx SM=PRV thread 0
27172717
// __TEXT 00007fffa4a0b000-00007fffa4a0d000 [ 8K 8K 0K 0K] r-x/r-x SM=COW /usr/lib/libSystem.B.dylib
27182718
// __TEXT 00007fffa4bbe000-00007fffa4c15000 [ 348K 348K 0K 0K] r-x/r-x SM=COW /usr/lib/libc++.1.dylib
2719+
2720+
// NOTE: the module path can have spaces in the name
2721+
// __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
27192722
char *line = NULL;
27202723
size_t lineLen = 0;
27212724
int count = 0;
@@ -2737,7 +2740,7 @@ CreateProcessModules(
27372740
void *startAddress, *endAddress;
27382741
char moduleName[PATH_MAX];
27392742

2740-
if (sscanf_s(line, "__TEXT %p-%p [ %*[0-9K ]] %*[-/rwxsp] SM=%*[A-Z] %s\n", &startAddress, &endAddress, moduleName, _countof(moduleName)) == 3)
2743+
if (sscanf_s(line, "__TEXT %p-%p [ %*[0-9K ]] %*[-/rwxsp] SM=%*[A-Z] %[^\n]", &startAddress, &endAddress, moduleName, _countof(moduleName)) == 3)
27412744
{
27422745
bool dup = false;
27432746
for (ProcessModules *entry = listHead; entry != NULL; entry = entry->Next)

0 commit comments

Comments
 (0)