]> git.ipfire.org Git - thirdparty/Python/cpython.git/commitdiff
gh-142627: Ignore anonymous mappings in Linux remote debugging (#142628)
authorVictor Stinner <vstinner@python.org>
Fri, 12 Dec 2025 13:12:11 +0000 (14:12 +0100)
committerGitHub <noreply@github.com>
Fri, 12 Dec 2025 13:12:11 +0000 (13:12 +0000)
Python/remote_debug.h

index 1c02870d3af4759c66f20dec1c3e9622d75b6549..d3932a3fd1e4d6c678b75f1dcb673ec9369e660c 100644 (file)
@@ -722,6 +722,11 @@ search_linux_map_for_section(proc_handle_t *handle, const char* secname, const c
         }
 
         const char *path = line + path_pos;
+        if (path[0] == '[' && path[strlen(path)-1] == ']') {
+            // Skip [heap], [stack], [anon:cpython:pymalloc], etc.
+            continue;
+        }
+
         const char *filename = strrchr(path, '/');
         if (filename) {
             filename++;  // Move past the '/'