Files
swift-mirror/stdlib/public/CommandLineSupport/CommandLine.cpp
Alastair Houghton 5f1a540010 [CommandLine][Linux] Don't assume the stack is one range in maps.
In `/proc/self/maps`, the stack isn't necessarily a single range, even
immediately after process start-up.  Apparently sometimes it's possible
for the kernel to allocate extra ranges below the first one, and these
show up separately in `/proc/self/maps`.

The upshot was that we were finding that `environ` didn't point into
the stack range we found, and then returning no arguments as a result.

The fix is to merge contiguous ranges after the first stack range we
find in `/proc/self/maps`.

rdar://117963394
2024-02-21 14:29:30 +00:00

17 KiB