]> git.ipfire.org Git - thirdparty/valgrind.git/commitdiff
Darwin regtest: add an expected for memcheck dw4
authorPaul Floyd <pjfloyd@wanadoo.fr>
Sun, 15 Mar 2026 17:21:45 +0000 (18:21 +0100)
committerPaul Floyd <pjfloyd@wanadoo.fr>
Sun, 15 Mar 2026 17:21:45 +0000 (18:21 +0100)
This test uses sbrk(). The macOS man page starts with

     The brk and sbrk functions are historical curiosities left over from earlier days before
     the advent of virtual memory management.

Looks like they have a bit of an opinion there. This change also
turns off the sbrk() tests on Darwin.

memcheck/tests/Makefile.am
memcheck/tests/dw4.c
memcheck/tests/dw4.stderr.exp
memcheck/tests/dw4.stderr.exp-darwin [new file with mode: 0644]
memcheck/tests/dw4.stderr.exp-solaris

index 3ce55d123a095ea3a90f8365bb109fdda3cf3fbe..1ce689bc770e938bbcab9410bc94ed3585015fa2 100644 (file)
@@ -214,6 +214,7 @@ EXTRA_DIST = \
        descr_belowsp.vgtest descr_belowsp.stderr.exp \
        doublefree.stderr.exp doublefree.vgtest \
        dw4.vgtest dw4.stderr.exp dw4.stderr.exp-solaris \
+               dw4.stderr.exp-darwin \
        err_disable1.vgtest err_disable1.stderr.exp \
        err_disable2.vgtest err_disable2.stderr.exp \
        err_disable3.vgtest err_disable3.stderr.exp \
index 7d981b69b90eb55f1a92ad575b17f41d6e6dfc8f..f560d7202aed764e90792ce92e35547f1a15b3a9 100644 (file)
@@ -82,6 +82,7 @@ int main ( void )
   croak( q);
   unlink(filename);
 
+#if !defined(__APPLE__)
   /* Describe memory in or past the heap end. */
   void *addr = sbrk(0);
   croak(addr); // in the first brk page, after brk_limit
@@ -91,6 +92,7 @@ int main ( void )
   croak(addr); // Must still be inside.
   sbrk(-3*1024);
   croak(addr); // Must now be after.
+#endif
   
   return 0;
 }
index 02c5955110e70c73e1c1e29313958c6cb8d5eca3..b6374a38502af1766c1f608bcab55e84ab775970 100644 (file)
@@ -29,21 +29,21 @@ Uninitialised byte(s) found during client check request
 
 Unaddressable byte(s) found during client check request
    at 0x........: croak (dw4.c:25)
-   by 0x........: main (dw4.c:87)
+   by 0x........: main (dw4.c:88)
  Address 0x........ is 0 bytes after the brk data segment limit 0x........
 
 Uninitialised byte(s) found during client check request
    at 0x........: croak (dw4.c:32)
-   by 0x........: main (dw4.c:89)
+   by 0x........: main (dw4.c:90)
  Address 0x........ is in a rw- mapped file DIRECTORY/dw4 segment
 
 Uninitialised byte(s) found during client check request
    at 0x........: croak (dw4.c:32)
-   by 0x........: main (dw4.c:91)
+   by 0x........: main (dw4.c:92)
  Address 0x........ is in a rw- mapped file DIRECTORY/dw4 segment
 
 Unaddressable byte(s) found during client check request
    at 0x........: croak (dw4.c:25)
-   by 0x........: main (dw4.c:93)
+   by 0x........: main (dw4.c:94)
  Address 0x........ is 1024 bytes after the brk data segment limit 0x........
 
diff --git a/memcheck/tests/dw4.stderr.exp-darwin b/memcheck/tests/dw4.stderr.exp-darwin
new file mode 100644 (file)
index 0000000..605d9bd
--- /dev/null
@@ -0,0 +1,29 @@
+Uninitialised byte(s) found during client check request
+   at 0x........: croak (dw4.c:32)
+   by 0x........: main (dw4.c:59)
+ Address 0x........ is 4 bytes inside a block of size ... alloc'd
+   at 0x........: malloc (vg_replace_malloc.c:...)
+   by 0x........: main (dw4.c:52)
+
+Uninitialised byte(s) found during client check request
+   at 0x........: croak (dw4.c:32)
+   by 0x........: main (dw4.c:61)
+ Location 0x........ is 0 bytes inside S2[0].i,
+ a global variable declared at dw4.c:47
+
+Uninitialised byte(s) found during client check request
+   at 0x........: croak (dw4.c:32)
+   by 0x........: main (dw4.c:62)
+ Location 0x........ is 0 bytes inside local.i,
+ declared at dw4.c:51, in frame #1 of thread 1
+
+Uninitialised byte(s) found during client check request
+   at 0x........: croak (dw4.c:32)
+   by 0x........: main (dw4.c:68)
+ Address 0x........ is in a rw- anonymous segment
+
+Uninitialised byte(s) found during client check request
+   at 0x........: croak (dw4.c:32)
+   by 0x........: main (dw4.c:82)
+ Address 0x........ is in a rw- mapped file valgrind-dw4-test.PID segment
+
index 917dcb57e3182e85dcd1e10cfd197037b0a47adf..155abd895cf9351250de40c346e5c47a6a141f31 100644 (file)
@@ -29,21 +29,21 @@ Uninitialised byte(s) found during client check request
 
 Unaddressable byte(s) found during client check request
    at 0x........: croak (dw4.c:25)
-   by 0x........: main (dw4.c:87)
+   by 0x........: main (dw4.c:88)
  Address 0x........ is 0 bytes after the brk data segment limit 0x........
 
 Uninitialised byte(s) found during client check request
    at 0x........: croak (dw4.c:32)
-   by 0x........: main (dw4.c:89)
+   by 0x........: main (dw4.c:90)
  Address 0x........ is in the brk data segment 0x........-0x........
 
 Uninitialised byte(s) found during client check request
    at 0x........: croak (dw4.c:32)
-   by 0x........: main (dw4.c:91)
+   by 0x........: main (dw4.c:92)
  Address 0x........ is in the brk data segment 0x........-0x........
 
 Unaddressable byte(s) found during client check request
    at 0x........: croak (dw4.c:25)
-   by 0x........: main (dw4.c:93)
+   by 0x........: main (dw4.c:94)
  Address 0x........ is 1024 bytes after the brk data segment limit 0x........