From 920769794c7347bdd97330ad0c32f2419189e6c3 Mon Sep 17 00:00:00 2001 From: Alastair Houghton Date: Fri, 3 Nov 2023 11:13:23 +0000 Subject: [PATCH] [Backtracing][Linux] Handle inaccessible memory properly in Docker. Thanks to a missing `-` sign, we were returning garbage rather than indicating that the memory region in question was inaccessible. This mainly affects register dumps (since that's the time we expect to have to cope with out-of-bounds reads). rdar://117900760 --- stdlib/public/runtime/CrashHandlerLinux.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/stdlib/public/runtime/CrashHandlerLinux.cpp b/stdlib/public/runtime/CrashHandlerLinux.cpp index e737a64954c90..be8879a57eda5 100644 --- a/stdlib/public/runtime/CrashHandlerLinux.cpp +++ b/stdlib/public/runtime/CrashHandlerLinux.cpp @@ -668,7 +668,7 @@ memserver_read(void *to, const void *from, size_t len) { memcpy(to, from, len); return len; } else { - return 1; + return -1; } } }