]> git.ipfire.org Git - thirdparty/Python/cpython.git/commitdiff
[3.14] gh-142627: Ignore anonymous mappings in Linux remote debugging (GH-142628...
authorMiss Islington (bot) <31488909+miss-islington@users.noreply.github.com>
Fri, 12 Dec 2025 13:38:09 +0000 (14:38 +0100)
committerGitHub <noreply@github.com>
Fri, 12 Dec 2025 13:38:09 +0000 (13:38 +0000)
gh-142627: Ignore anonymous mappings in Linux remote debugging (GH-142628)
(cherry picked from commit e0bca091a4f112b9f0beb4ce19dfac2a7fc50342)

Co-authored-by: Victor Stinner <vstinner@python.org>
Python/remote_debug.h

index 8f9b6cd4c4960f744258e44b2f92a461f408a1b8..ed213859a8afabf66c46ae62231c7311887364b2 100644 (file)
@@ -720,6 +720,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 '/'