]> git.ipfire.org Git - thirdparty/valgrind.git/commitdiff
Comment: explain why v.info location no longer detects stack guard pages on FreeBSD
authorPaul Floyd <pjfloyd@wanadoo.fr>
Wed, 28 Feb 2024 21:00:37 +0000 (22:00 +0100)
committerPaul Floyd <pjfloyd@wanadoo.fr>
Wed, 28 Feb 2024 21:00:37 +0000 (22:00 +0100)
Workaround: sysctl security.bsd.stack_guard_page=0

coregrind/m_addrinfo.c

index 1796eb8152e0e5f26fb9a30c06a992ebdc08a502..0d4624dbbcc927a03e17ed25b2fd0e8c51d3f52b 100644 (file)
@@ -241,6 +241,19 @@ void VG_(describe_addr) ( DiEpoch ep, Addr a, /*OUT*/AddrInfo* ai )
             if (tid != VG_INVALID_THREADID)
                stackPos = StackPos_guard_page;
          }
+         /*
+          * On FreeBSD the above heuristic fails since version 14.0
+          *
+          * I think that is because of a bug or at least a misfeature
+          * in the way that the kernel grows mmap'd MAP_STACK memory
+          * See https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=277382
+          *
+          * I could add a lot of ugliness like
+          * "if the address is RW and sysctl security.bsd.stack_guard_page
+          * times the page size is PROT_NONE then it's a wonky guard page"
+          *
+          * Naaah.
+          */
       }
 
       if (tid != VG_INVALID_THREADID) {