|
From: <sv...@va...> - 2008-08-04 14:17:34
|
Author: sewardj
Date: 2008-08-04 15:17:42 +0100 (Mon, 04 Aug 2008)
New Revision: 8507
Log:
Fix some expected outputs.
Modified:
branches/PTRCHECK/exp-ptrcheck/tests/base.stderr.exp
branches/PTRCHECK/exp-ptrcheck/tests/ccc.cpp
branches/PTRCHECK/exp-ptrcheck/tests/ccc.stderr.exp
branches/PTRCHECK/exp-ptrcheck/tests/filter_stderr
branches/PTRCHECK/exp-ptrcheck/tests/pth_create.stderr.exp
branches/PTRCHECK/exp-ptrcheck/tests/pth_specific.stderr.exp
Modified: branches/PTRCHECK/exp-ptrcheck/tests/base.stderr.exp
===================================================================
--- branches/PTRCHECK/exp-ptrcheck/tests/base.stderr.exp 2008-08-04 13:20:14 UTC (rev 8506)
+++ branches/PTRCHECK/exp-ptrcheck/tests/base.stderr.exp 2008-08-04 14:17:42 UTC (rev 8507)
@@ -3,14 +3,10 @@
about to do 14 [-1]
Invalid read of size 4
at 0x........: main (base.c:14)
- by 0x........: __libc_start_main (...libc...)
- by 0x........: ...
-Address 0x........ is 4 bytes before the accessing pointer's
- legitimate range, the 40-byte block alloc'd
+ Address 0x........ is 4 bytes before the accessing pointer's
+ legitimate range, a block of size 40 alloc'd
at 0x........: malloc (vg_replace_malloc.c:...)
by 0x........: main (arith_include2.c:22)
- by 0x........: __libc_start_main (...libc...)
- by 0x........: ...
about to do 16 [0]
about to do 16 [-1]
about to do 18 [0]
@@ -19,29 +15,21 @@
Invalid read of size 4
at 0x........: main (base.c:20)
- by 0x........: __libc_start_main (...libc...)
- by 0x........: ...
-Address 0x........ is not derived from any known block
+ Address 0x........ is not derived from any known block
about to do 20 [-1]
Invalid read of size 4
at 0x........: main (base.c:20)
- by 0x........: __libc_start_main (...libc...)
- by 0x........: ...
-Address 0x........ is not derived from any known block
+ Address 0x........ is not derived from any known block
about to do 22 [0]
Invalid read of size 4
at 0x........: main (base.c:22)
- by 0x........: __libc_start_main (...libc...)
- by 0x........: ...
-Address 0x........ is not derived from any known block
+ Address 0x........ is not derived from any known block
about to do 22 [-1]
Invalid read of size 4
at 0x........: main (base.c:22)
- by 0x........: __libc_start_main (...libc...)
- by 0x........: ...
-Address 0x........ is not derived from any known block
+ Address 0x........ is not derived from any known block
ERROR SUMMARY: 5 errors from 5 contexts (suppressed: 0 from 0)
Modified: branches/PTRCHECK/exp-ptrcheck/tests/ccc.cpp
===================================================================
--- branches/PTRCHECK/exp-ptrcheck/tests/ccc.cpp 2008-08-04 13:20:14 UTC (rev 8506)
+++ branches/PTRCHECK/exp-ptrcheck/tests/ccc.cpp 2008-08-04 14:17:42 UTC (rev 8507)
@@ -1,28 +1,41 @@
#include <assert.h>
#include <stdlib.h>
#include <malloc.h> // for memalign()
-
+static __attribute__((noinline)) void bar ( int ); /* fwds */
int main(void)
{
- int y1, y2, y3, y4, y5, y6;
+ int y1, y2, y3, y4, y5, y6, sum = 0;
int* x1 = (int*)malloc(sizeof(int));
int* x2 = new int;
int* x3 = new int[10];
int* x4 = (int*)calloc(1, sizeof(int));
int* x5 = (int*)memalign(8, sizeof(int));
- int* x6;
- int res = posix_memalign((void**)&x6, 8, sizeof(int));
+ int* x6; void* v6;
+ int res = posix_memalign(&v6, 8, sizeof(int)); x6 = (int*)v6;
assert(NULL != x1 && NULL != x2 && NULL != x3 && NULL != x4 &&
NULL != x5 && 0 == res);
-
+ __asm__ __volatile__("":::"memory");
// all underruns
- y1 = x1[-1];
- y2 = x2[-1];
- y3 = x3[-1];
- y4 = x4[-1];
- y5 = x5[-1];
- y6 = x6[-1];
+ sum += x1[-1]; __asm__ __volatile__("":::"memory"); bar(1);
+ sum += x2[-1]; __asm__ __volatile__("":::"memory"); bar(2);
+ sum += x3[-1]; __asm__ __volatile__("":::"memory"); bar(3);
+ sum += x4[-1]; __asm__ __volatile__("":::"memory"); bar(4);
+ sum += x5[-1]; __asm__ __volatile__("":::"memory"); bar(5);
+ sum += x6[-1]; __asm__ __volatile__("":::"memory"); bar(6);
+ __asm__ __volatile__("":::"memory");
+ return sum;
+}
- return y1+y2+y3+y4+y5+y6;
+/* What's with all this __asm__ __volatile__ stuff? Well, it's an
+ attempt to get gcc-4.1.2 not to claim the memory references that
+ we're interested in -- x1[-1] through x6[-1] -- appear on different
+ lines than they really do. By its own rules, gcc can't move code
+ across an __asm__ __volatile__, and the "memory" item says each one
+ clobbers memory in some way which gcc can't know, so that probably
+ (!) persuades it not to carry memory CSEs around either. */
+
+static __attribute__((noinline)) void bar ( int x )
+{
+ __asm__ __volatile__("":::"memory");
}
Modified: branches/PTRCHECK/exp-ptrcheck/tests/ccc.stderr.exp
===================================================================
--- branches/PTRCHECK/exp-ptrcheck/tests/ccc.stderr.exp 2008-08-04 13:20:14 UTC (rev 8506)
+++ branches/PTRCHECK/exp-ptrcheck/tests/ccc.stderr.exp 2008-08-04 14:17:42 UTC (rev 8507)
@@ -10,34 +10,32 @@
at 0x........: main (ccc.cpp:21)
Address 0x........ is 4 bytes before the accessing pointer's
legitimate range, a block of size 4 alloc'd
- at 0x........: __builtin_new (vg_replace_malloc.c:...)
- by 0x........: operator new(unsigned) (vg_replace_malloc.c:...)
+ at 0x........: operator new(unsigned) (vg_replace_malloc.c:...)
by 0x........: main (ccc.cpp:9)
Invalid read of size 4
at 0x........: main (ccc.cpp:22)
Address 0x........ is 4 bytes before the accessing pointer's
legitimate range, a block of size 40 alloc'd
- at 0x........: __builtin_vec_new (vg_replace_malloc.c:...)
- by 0x........: operator new[](unsigned) (vg_replace_malloc.c:...)
+ at 0x........: operator new[](unsigned) (vg_replace_malloc.c:...)
by 0x........: main (ccc.cpp:10)
Invalid read of size 4
- at 0x........: main (ccc.cpp:23)
+ at 0x........: main (ccc.cpp:22)
Address 0x........ is 4 bytes before the accessing pointer's
legitimate range, a block of size 4 alloc'd
at 0x........: calloc (vg_replace_malloc.c:...)
by 0x........: main (ccc.cpp:11)
Invalid read of size 4
- at 0x........: main (ccc.cpp:24)
+ at 0x........: main (ccc.cpp:23)
Address 0x........ is 4 bytes before the accessing pointer's
legitimate range, a block of size 4 alloc'd
at 0x........: memalign (vg_replace_malloc.c:...)
by 0x........: main (ccc.cpp:12)
Invalid read of size 4
- at 0x........: main (ccc.cpp:25)
+ at 0x........: main (ccc.cpp:24)
Address 0x........ is 4 bytes before the accessing pointer's
legitimate range, a block of size 4 alloc'd
at 0x........: memalign (vg_replace_malloc.c:...)
Modified: branches/PTRCHECK/exp-ptrcheck/tests/filter_stderr
===================================================================
--- branches/PTRCHECK/exp-ptrcheck/tests/filter_stderr 2008-08-04 13:20:14 UTC (rev 8506)
+++ branches/PTRCHECK/exp-ptrcheck/tests/filter_stderr 2008-08-04 14:17:42 UTC (rev 8507)
@@ -11,6 +11,7 @@
# Anonymise paths like "(in /foo/bar/libc-baz.so)"
sed "s/(in \/.*libc.*)$/(in \/...libc...)/" |
+sed "s/(in \/.*libpthread.*)$/(in \/...libpthread...)/" |
# Anonymise paths like "__libc_start_main (../foo/bar/libc-quux.c:129)"
sed "s/__libc_\(.*\) (.*)$/__libc_\1 (...libc...)/" |
Modified: branches/PTRCHECK/exp-ptrcheck/tests/pth_create.stderr.exp
===================================================================
--- branches/PTRCHECK/exp-ptrcheck/tests/pth_create.stderr.exp 2008-08-04 13:20:14 UTC (rev 8506)
+++ branches/PTRCHECK/exp-ptrcheck/tests/pth_create.stderr.exp 2008-08-04 14:17:42 UTC (rev 8507)
@@ -1,49 +1,18 @@
-pthread_key_create: key is non-contiguous
- at 0x........: __pthread_key_create (vg_libpthread.c:...)
+Invalid write of size 4
+ at 0x........: pthread_key_create (in /...libpthread...)
by 0x........: main (pth_create.c:17)
- by 0x........: __libc_start_main (...libc...)
- by 0x........: ...
-First byte (0x........) is 1 bytes within a 4-byte block alloc'd
+ Address 0x........ is 1 bytes inside the accessing pointer's
+ legitimate range, a block of size 4 alloc'd
at 0x........: malloc (vg_replace_malloc.c:...)
by 0x........: main (pth_create.c:14)
- by 0x........: __libc_start_main (...libc...)
- by 0x........: ...
-Last byte is not within a known block
-Invalid read of size 4
- at 0x........: __pthread_key_create (vg_libpthread.c:...)
- by 0x........: main (pth_create.c:17)
- by 0x........: __libc_start_main (...libc...)
- by 0x........: ...
-Address 0x........ is 1 bytes inside the accessing pointer's
- legitimate range, the 4-byte block alloc'd
- at 0x........: malloc (vg_replace_malloc.c:...)
- by 0x........: main (pth_create.c:14)
- by 0x........: __libc_start_main (...libc...)
- by 0x........: ...
-
-pthread_key_create: key contains unaddressable byte(s)
- at 0x........: __pthread_key_create (vg_libpthread.c:...)
+Invalid write of size 4
+ at 0x........: pthread_key_create (in /...libpthread...)
by 0x........: main (pth_create.c:19)
- by 0x........: __libc_start_main (...libc...)
- by 0x........: ...
-Address 0x........ is 0 bytes within a 4-byte block free'd
+ Address 0x........ is 0 bytes inside the accessing pointer's
+ once-legitimate range, a block of size 4 free'd
at 0x........: free (vg_replace_malloc.c:...)
by 0x........: main (pth_create.c:18)
- by 0x........: __libc_start_main (...libc...)
- by 0x........: ...
-Invalid read of size 4
- at 0x........: __pthread_key_create (vg_libpthread.c:...)
- by 0x........: main (pth_create.c:19)
- by 0x........: __libc_start_main (...libc...)
- by 0x........: ...
-Address 0x........ is 0 bytes inside the accessing pointer's
- once-legitimate range, the 4-byte block free'd
- at 0x........: free (vg_replace_malloc.c:...)
- by 0x........: main (pth_create.c:18)
- by 0x........: __libc_start_main (...libc...)
- by 0x........: ...
-
-ERROR SUMMARY: 202 errors from 4 contexts (suppressed: 0 from 0)
+ERROR SUMMARY: 2 errors from 2 contexts (suppressed: 0 from 0)
Modified: branches/PTRCHECK/exp-ptrcheck/tests/pth_specific.stderr.exp
===================================================================
--- branches/PTRCHECK/exp-ptrcheck/tests/pth_specific.stderr.exp 2008-08-04 13:20:14 UTC (rev 8506)
+++ branches/PTRCHECK/exp-ptrcheck/tests/pth_specific.stderr.exp 2008-08-04 14:17:42 UTC (rev 8507)
@@ -1,24 +1,16 @@
Invalid read of size 1
at 0x........: main (pth_specific.c:19)
- by 0x........: __libc_start_main (...libc...)
- by 0x........: ...
-Address 0x........ is 1 bytes before the accessing pointer's
- legitimate range, the 100-byte block alloc'd
+ Address 0x........ is 1 bytes before the accessing pointer's
+ legitimate range, a block of size 100 alloc'd
at 0x........: malloc (vg_replace_malloc.c:...)
by 0x........: main (pth_specific.c:17)
- by 0x........: __libc_start_main (...libc...)
- by 0x........: ...
Invalid read of size 1
at 0x........: main (pth_specific.c:27)
- by 0x........: __libc_start_main (...libc...)
- by 0x........: ...
-Address 0x........ is 1 bytes before the accessing pointer's
- legitimate range, the 100-byte block alloc'd
+ Address 0x........ is 1 bytes before the accessing pointer's
+ legitimate range, a block of size 100 alloc'd
at 0x........: malloc (vg_replace_malloc.c:...)
by 0x........: main (pth_specific.c:17)
- by 0x........: __libc_start_main (...libc...)
- by 0x........: ...
ERROR SUMMARY: 2 errors from 2 contexts (suppressed: 0 from 0)
|