PERFORCE change 168783 for review
Stanislav Sedov
stas at FreeBSD.org
Tue Sep 22 16:45:44 UTC 2009
http://perforce.freebsd.org/chv.cgi?CH=168783
Change 168783 by stas at stas_yandex on 2009/09/22 16:45:41
- MAP_STACK mappings are anonymous mappings too. This fixes pthread-related
failures in valgrind when it misses the allocated stack space.
Affected files ...
.. //depot/projects/valgrind/coregrind/m_aspacemgr/aspacemgr-linux.c#7 edit
.. //depot/projects/valgrind/include/vki/vki-freebsd.h#19 edit
Differences ...
==== //depot/projects/valgrind/coregrind/m_aspacemgr/aspacemgr-linux.c#7 (text+ko) ====
@@ -1993,13 +1993,13 @@
needDiscard = any_Ts_in_range( a, len );
init_nsegment( &seg );
- seg.kind = (flags & VKI_MAP_ANONYMOUS) ? SkAnonC : SkFileC;
+ seg.kind = (flags & (VKI_MAP_ANONYMOUS | VKI_MAP_STACK)) ? SkAnonC : SkFileC;
seg.start = a;
seg.end = a + len - 1;
seg.hasR = toBool(prot & VKI_PROT_READ);
seg.hasW = toBool(prot & VKI_PROT_WRITE);
seg.hasX = toBool(prot & VKI_PROT_EXEC);
- if (!(flags & VKI_MAP_ANONYMOUS)) {
+ if (!(flags & (VKI_MAP_ANONYMOUS | VKI_MAP_STACK))) {
// Nb: We ignore offset requests in anonymous mmaps (see bug #126722)
seg.offset = offset;
if (ML_(am_get_fd_d_i_m)(fd, &dev, &ino, &mode)) {
==== //depot/projects/valgrind/include/vki/vki-freebsd.h#19 (text+ko) ====
@@ -1343,6 +1343,7 @@
#define VKI_MAP_PRIVATE 0x02 /* Changes are private */
#define VKI_MAP_FIXED 0x10 /* Interpret addr exactly */
#define VKI_MAP_NORESERVE 0x0040 /* don't check for reservations */
+#define VKI_MAP_STACK 0x400
#define VKI_MAP_ANON 0x1000 /* don't use a file */
#define VKI_MAP_ANONYMOUS VKI_MAP_ANON
More information about the p4-projects
mailing list