From 7c71d0b98c1cd6ad539f15fb4397f698ff2045a6 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 be9b2ded87e91..a75408fc7d88d 100644 --- a/stdlib/public/runtime/CrashHandlerLinux.cpp +++ b/stdlib/public/runtime/CrashHandlerLinux.cpp @@ -672,7 +672,7 @@ memserver_read(void *to, const void *from, size_t len) { memcpy(to, from, len); return len; } else { - return 1; + return -1; } } }