Delete exp-sgcheck tests that are redundant following the removal of the

heap checking facilities.


git-svn-id: svn://svn.valgrind.org/valgrind/trunk@11749
This commit is contained in:
Julian Seward 2011-05-12 16:38:56 +00:00
parent 619a546991
commit f5fb84ba81
58 changed files with 11 additions and 1446 deletions

View File

@ -12,70 +12,45 @@ EXTRA_DIST = \
arith_include1.c arith_include2.c \
bad_percentify.vgtest bad_percentify.c \
bad_percentify.stdout.exp bad_percentify.stderr.exp-glibc28-amd64 \
base.vgtest \
base.stderr.exp-glibc25-amd64 base.stderr.exp-glibc25-x86 \
ccc.vgtest ccc.stderr.exp-glibc25-amd64 \
ccc.stderr.exp-glibc27-x86 ccc.stderr.exp-glibc28-amd64 \
cmp.vgtest-disabled cmp.stderr.exp \
globalerr.vgtest globalerr.stdout.exp \
globalerr.stderr.exp-glibc28-amd64 \
fp.vgtest fp.stderr.exp \
hackedbz2.vgtest hackedbz2.stdout.exp \
hackedbz2.stderr.exp-glibc28-amd64 \
hp_bounds.vgtest hp_bounds.stderr.exp \
hp_dangle.vgtest hp_dangle.stderr.exp \
hsg.vgtest hsg.stdout.exp hsg.stderr.exp \
idiv.vgtest-disabled idiv.stderr.exp \
imul.vgtest-disabled imul.stderr.exp \
justify.vgtest justify.stderr.exp \
mm.vgtest-disabled mm.stderr.exp \
neg.vgtest-disabled neg.stderr.exp \
not.vgtest-disabled not.stderr.exp \
or.vgtest-disabled or.stderr.exp \
partial_bad.vgtest \
partial_bad.stderr.exp-glibc25-x86 \
partial_bad.stderr.exp-glibc25-amd64 \
partial_good.vgtest \
partial_good.stderr.exp-glibc25-x86 \
partial_good.stderr.exp-glibc25-amd64 \
preen_invars.vgtest preen_invars.stdout.exp \
preen_invars.stderr.exp-glibc28-amd64 \
pth_create.vgtest pth_create.stderr.exp \
pth_specific.vgtest pth_specific.stderr.exp \
realloc.vgtest \
realloc.stderr.exp-glibc25-x86 realloc.stderr.exp-glibc25-amd64 \
sh_script.vgtest-disabled sh_script.stderr.exp \
stackerr.vgtest stackerr.stdout.exp \
stackerr.stderr.exp-glibc28-amd64 stackerr.stderr.exp-glibc27-x86 \
strcpy.vgtest strcpy.stderr.exp \
strlen_bad.vgtest-disabled strlen_bad.stderr.exp \
strlen_good.vgtest-disabled strlen_good.stderr.exp \
sub.vgtest-disabled sub.stderr.exp \
supp.vgtest supp.stderr.exp supp.supp \
suppgen.vgtest-disabled suppgen.stderr.exp suppgen.stdin \
syscall.vgtest-disabled syscall.stderr.exp \
tricky.vgtest tricky.stderr.exp \
unaligned.vgtest \
unaligned.stderr.exp-glibc25-x86 unaligned.stderr.exp-glibc25-amd64 \
xor.vgtest-disabled xor.stderr.exp \
zero.vgtest zero.stderr.exp
xor.vgtest-disabled xor.stderr.exp
check_PROGRAMS = \
add and arith bad_percentify base cmp fp \
add and arith bad_percentify cmp \
globalerr hackedbz2 \
hp_bounds hp_dangle hsg idiv imul \
justify mm not neg or partial \
hsg idiv imul \
mm not neg or \
preen_invars preen_invars_so.so \
pth_create pth_specific realloc \
stackerr \
strcpy strlen sub supp syscall tricky unaligned xor zero
strlen sub syscall xor
# DDD: not sure if these ones should work on Darwin or not... if not, should
# be moved into x86-linux/.
if ! VGCONF_OS_IS_DARWIN
check_PROGRAMS += \
ccc
endif
#if ! VGCONF_OS_IS_DARWIN
# check_PROGRAMS += \
# ccc
#endif
AM_CFLAGS += $(AM_FLAG_M3264_PRI)
@ -86,11 +61,10 @@ AM_CXXFLAGS += $(AM_FLAG_M3264_PRI)
hackedbz2_CFLAGS = $(AM_CFLAGS) -O -Wno-inline
# C ones
pth_create_LDADD = -lpthread
pth_specific_LDADD = -lpthread
#pth_create_LDADD = -lpthread
# C++ ones
ccc_SOURCES = ccc.cpp
#ccc_SOURCES = ccc.cpp
# Build shared object for preen_invars
preen_invars_DEPENDENCIES = preen_invars_so.so

View File

@ -1,25 +0,0 @@
#include <stdio.h>
#include <stdlib.h>
#include <signal.h>
#include <setjmp.h>
#include <assert.h>
#include "arith_include1.c"
int main(void)
{
#include "arith_include2.c"
// Base ========================================================
b(p, p); // ok
b(up, u); // ok
b(un, u); // undet
b(n, n); // det
b(nn, n); // det
return 0;
}

View File

@ -1,36 +0,0 @@
about to do 14 [0]
about to do 14 [-1]
Invalid read of size 8
at 0x........: main (base.c:14)
Address 0x........ is 8 bytes before the accessing pointer's
legitimate range, a block of size 80 alloc'd
at 0x........: malloc (vg_replace_malloc.c:...)
by 0x........: main (arith_include2.c:22)
about to do 16 [0]
about to do 16 [-1]
about to do 18 [0]
about to do 18 [-1]
about to do 20 [0]
Invalid read of size 8
at 0x........: main (base.c:20)
Address 0x........ is not derived from any known block
about to do 20 [-1]
Invalid read of size 8
at 0x........: main (base.c:20)
Address 0x........ is not derived from any known block
about to do 22 [0]
Invalid read of size 8
at 0x........: main (base.c:22)
Address 0x........ is not derived from any known block
about to do 22 [-1]
Invalid read of size 8
at 0x........: main (base.c:22)
Address 0x........ is not derived from any known block
ERROR SUMMARY: 5 errors from 5 contexts (suppressed: 0 from 0)

View File

@ -1,36 +0,0 @@
about to do 14 [0]
about to do 14 [-1]
Invalid read of size 4
at 0x........: main (base.c:14)
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)
about to do 16 [0]
about to do 16 [-1]
about to do 18 [0]
about to do 18 [-1]
about to do 20 [0]
Invalid read of size 4
at 0x........: main (base.c:20)
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)
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)
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)
Address 0x........ is not derived from any known block
ERROR SUMMARY: 5 errors from 5 contexts (suppressed: 0 from 0)

View File

@ -1,3 +0,0 @@
prereq: ./is_arch_supported
prog: base
stderr_filter: filter_add

View File

@ -1,41 +0,0 @@
#define _XOPEN_SOURCE 600 // to enable posix_memalign()
#include <assert.h>
#include <stdlib.h>
#include <malloc.h> // for memalign()
static __attribute__((noinline)) void bar ( int ); /* fwds */
int main(void) {
int 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; 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
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;
}
/* 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");
}

View File

@ -1,46 +0,0 @@
Invalid read of size 4
at 0x........: main (ccc.cpp:20)
Address 0x........ is 4 bytes before the accessing pointer's
legitimate range, a block of size 4 alloc'd
at 0x........: malloc (vg_replace_malloc.c:...)
by 0x........: main (ccc.cpp:8)
Invalid read of size 4
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........: ...operator new... (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........: ...operator new[]... (vg_replace_malloc.c:...)
by 0x........: main (ccc.cpp:10)
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 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: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: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:...)
by 0x........: posix_memalign (vg_replace_malloc.c:...)
by 0x........: main (ccc.cpp:14)
ERROR SUMMARY: 6 errors from 6 contexts (suppressed: 0 from 0)

View File

@ -1,46 +0,0 @@
Invalid read of size 4
at 0x........: main (ccc.cpp:20)
Address 0x........ is 4 bytes before the accessing pointer's
legitimate range, a block of size 4 alloc'd
at 0x........: malloc (vg_replace_malloc.c:...)
by 0x........: main (ccc.cpp:8)
Invalid read of size 4
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........: ...operator new... (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........: ...operator new[]... (vg_replace_malloc.c:...)
by 0x........: main (ccc.cpp:10)
Invalid read of size 4
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........: calloc (vg_replace_malloc.c:...)
by 0x........: main (ccc.cpp:11)
Invalid read of size 4
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:...)
by 0x........: main (ccc.cpp:12)
Invalid read of size 4
at 0x........: main (ccc.cpp:25)
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........: posix_memalign (vg_replace_malloc.c:...)
by 0x........: main (ccc.cpp:14)
ERROR SUMMARY: 6 errors from 6 contexts (suppressed: 0 from 0)

View File

@ -1,46 +0,0 @@
Invalid read of size 4
at 0x........: main (ccc.cpp:20)
Address 0x........ is 4 bytes before the accessing pointer's
legitimate range, a block of size 4 alloc'd
at 0x........: malloc (vg_replace_malloc.c:...)
by 0x........: main (ccc.cpp:8)
Invalid read of size 4
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........: ...operator new... (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........: ...operator new[]... (vg_replace_malloc.c:...)
by 0x........: main (ccc.cpp:10)
Invalid read of size 4
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........: calloc (vg_replace_malloc.c:...)
by 0x........: main (ccc.cpp:11)
Invalid read of size 4
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:...)
by 0x........: main (ccc.cpp:12)
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 4 alloc'd
at 0x........: memalign (vg_replace_malloc.c:...)
by 0x........: posix_memalign (vg_replace_malloc.c:...)
by 0x........: main (ccc.cpp:14)
ERROR SUMMARY: 6 errors from 6 contexts (suppressed: 0 from 0)

View File

@ -1,2 +0,0 @@
prereq: ./is_arch_supported
prog: ccc

View File

@ -1,17 +0,0 @@
#include <stdlib.h>
int main ( void )
{
double* dp = malloc(sizeof(double));
float* fp = malloc(sizeof(float));
*dp += 3.0; // ok
*fp += 30.0; // ok
free(dp);
free(fp);
*dp += 3.0; // bad, been freed
*fp += 30.0; // bad, been freed
return 0;
}

View File

@ -1,31 +0,0 @@
Invalid read of size 8
at 0x........: main (fp.c:13)
Address 0x........ is 0 bytes inside the accessing pointer's
once-legitimate range, a block of size 8 free'd
at 0x........: free (vg_replace_malloc.c:...)
by 0x........: main (fp.c:11)
Invalid write of size 8
at 0x........: main (fp.c:13)
Address 0x........ is 0 bytes inside the accessing pointer's
once-legitimate range, a block of size 8 free'd
at 0x........: free (vg_replace_malloc.c:...)
by 0x........: main (fp.c:11)
Invalid read of size 4
at 0x........: main (fp.c:14)
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 (fp.c:12)
Invalid write of size 4
at 0x........: main (fp.c:14)
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 (fp.c:12)
ERROR SUMMARY: 4 errors from 4 contexts (suppressed: 0 from 0)

View File

@ -1,2 +0,0 @@
prereq: ./is_arch_supported
prog: fp

View File

@ -1,13 +0,0 @@
#include <stdlib.h>
int main(void)
{
int y __attribute__((unused));
int* x = malloc(sizeof(int) * 100);
y = x[95]; // ok
y = x[100]; // overrun
y = x[-1]; // underrun
return 0;
}

View File

@ -1,17 +0,0 @@
Invalid read of size 4
at 0x........: main (hp_bounds.c:9)
Address 0x........ is 0 bytes after the accessing pointer's
legitimate range, a block of size 400 alloc'd
at 0x........: malloc (vg_replace_malloc.c:...)
by 0x........: main (hp_bounds.c:6)
Invalid read of size 4
at 0x........: main (hp_bounds.c:10)
Address 0x........ is 4 bytes before the accessing pointer's
legitimate range, a block of size 400 alloc'd
at 0x........: malloc (vg_replace_malloc.c:...)
by 0x........: main (hp_bounds.c:6)
ERROR SUMMARY: 2 errors from 2 contexts (suppressed: 0 from 0)

View File

@ -1,2 +0,0 @@
prereq: ./is_arch_supported
prog: hp_bounds

View File

@ -1,21 +0,0 @@
#include <stdlib.h>
int* mk_dangle(void)
{
int* x = malloc(400);
free(x);
return x;
}
int main(void)
{
int y __attribute__((unused));
int* x = mk_dangle();
y = x[5];
y = x[-1];
return 0;
}

View File

@ -1,19 +0,0 @@
Invalid read of size 4
at 0x........: main (hp_dangle.c:17)
Address 0x........ is 20 bytes inside the accessing pointer's
once-legitimate range, a block of size 400 free'd
at 0x........: free (vg_replace_malloc.c:...)
by 0x........: mk_dangle (hp_dangle.c:7)
by 0x........: main (hp_dangle.c:15)
Doubly-invalid read of size 4
at 0x........: main (hp_dangle.c:18)
Address 0x........ is 4 bytes before the accessing pointer's
once-legitimate range, a block of size 400 free'd
at 0x........: free (vg_replace_malloc.c:...)
by 0x........: mk_dangle (hp_dangle.c:7)
by 0x........: main (hp_dangle.c:15)
ERROR SUMMARY: 2 errors from 2 contexts (suppressed: 0 from 0)

View File

@ -1,2 +0,0 @@
prereq: ./is_arch_supported
prog: hp_dangle

View File

@ -1,23 +0,0 @@
#include <stdlib.h>
#include <assert.h>
// This is an example of an error found by Annelid, but not found by
// Memcheck -- because the wild read goes past the redzones of the pointer's
// block.
//
// Nb: for Memcheck to not spot this, relies on it putting the 2nd block in
// memory after the 1st block.
int main ( void )
{
char c __attribute__((unused));
char *c0, *c1;
c0 = malloc(10000);
c1 = malloc(10000);
assert(c0 && c1);
c = c0[15000];
return 0;
}

View File

@ -1,10 +0,0 @@
Invalid read of size 1
at 0x........: main (justify.c:20)
Address 0x........ is 5000 bytes after the accessing pointer's
legitimate range, a block of size 10000 alloc'd
at 0x........: malloc (vg_replace_malloc.c:...)
by 0x........: main (justify.c:16)
ERROR SUMMARY: 1 errors from 1 contexts (suppressed: 0 from 0)

View File

@ -1,2 +0,0 @@
prereq: ./is_arch_supported
prog: justify

View File

@ -1,108 +0,0 @@
Invalid read of size 4
at 0x........: main (partial.c:21)
Address 0x........ is 0 bytes inside the accessing pointer's
legitimate range, a block of size 3 alloc'd
at 0x........: malloc (vg_replace_malloc.c:...)
by 0x........: main (partial.c:6)
Invalid read of size 4
at 0x........: main (partial.c:22)
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 (partial.c:7)
Invalid read of size 4
at 0x........: main (partial.c:23)
Address 0x........ is 2 bytes inside the accessing pointer's
legitimate range, a block of size 5 alloc'd
at 0x........: malloc (vg_replace_malloc.c:...)
by 0x........: main (partial.c:8)
Invalid read of size 4
at 0x........: main (partial.c:24)
Address 0x........ is 3 bytes inside the accessing pointer's
legitimate range, a block of size 6 alloc'd
at 0x........: malloc (vg_replace_malloc.c:...)
by 0x........: main (partial.c:9)
Invalid read of size 4
at 0x........: main (partial.c:25)
Address 0x........ is 4 bytes inside the accessing pointer's
legitimate range, a block of size 7 alloc'd
at 0x........: malloc (vg_replace_malloc.c:...)
by 0x........: main (partial.c:10)
Invalid read of size 4
at 0x........: main (partial.c:34)
Address 0x........ is 1 bytes before the accessing pointer's
legitimate range, a block of size 3 alloc'd
at 0x........: malloc (vg_replace_malloc.c:...)
by 0x........: main (partial.c:6)
Invalid read of size 4
at 0x........: main (partial.c:35)
Address 0x........ is 0 bytes inside the accessing pointer's
legitimate range, a block of size 3 alloc'd
at 0x........: malloc (vg_replace_malloc.c:...)
by 0x........: main (partial.c:6)
Invalid read of size 4
at 0x........: main (partial.c:36)
Address 0x........ is 1 bytes inside the accessing pointer's
legitimate range, a block of size 3 alloc'd
at 0x........: malloc (vg_replace_malloc.c:...)
by 0x........: main (partial.c:6)
Invalid read of size 4
at 0x........: main (partial.c:37)
Address 0x........ is 2 bytes inside the accessing pointer's
legitimate range, a block of size 3 alloc'd
at 0x........: malloc (vg_replace_malloc.c:...)
by 0x........: main (partial.c:6)
Invalid read of size 4
at 0x........: main (partial.c:38)
Address 0x........ is 0 bytes after the accessing pointer's
legitimate range, a block of size 3 alloc'd
at 0x........: malloc (vg_replace_malloc.c:...)
by 0x........: main (partial.c:6)
Invalid read of size 4
at 0x........: main (partial.c:41)
Address 0x........ is 0 bytes inside the accessing pointer's
legitimate range, a block of size 3 alloc'd
at 0x........: malloc (vg_replace_malloc.c:...)
by 0x........: main (partial.c:6)
Invalid read of size 8
at 0x........: main (partial.c:42)
Address 0x........ is 0 bytes inside the accessing pointer's
legitimate range, a block of size 7 alloc'd
at 0x........: malloc (vg_replace_malloc.c:...)
by 0x........: main (partial.c:7)
Invalid read of size 8
at 0x........: main (partial.c:43)
Address 0x........ is 0 bytes inside the accessing pointer's
legitimate range, a block of size 7 alloc'd
at 0x........: malloc (vg_replace_malloc.c:...)
by 0x........: main (partial.c:8)
Invalid read of size 1
at 0x........: main (partial.c:44)
Address 0x........ is 0 bytes after the accessing pointer's
legitimate range, a block of size 0 alloc'd
at 0x........: malloc (vg_replace_malloc.c:...)
by 0x........: main (partial.c:9)
Invalid read of size 2
at 0x........: main (partial.c:45)
Address 0x........ is 0 bytes inside the accessing pointer's
legitimate range, a block of size 1 alloc'd
at 0x........: malloc (vg_replace_malloc.c:...)
by 0x........: main (partial.c:10)
ERROR SUMMARY: 15 errors from 15 contexts (suppressed: 0 from 0)

View File

@ -1,108 +0,0 @@
Invalid read of size 4
at 0x........: main (partial.c:21)
Address 0x........ is 0 bytes inside the accessing pointer's
legitimate range, a block of size 3 alloc'd
at 0x........: malloc (vg_replace_malloc.c:...)
by 0x........: main (partial.c:6)
Invalid read of size 4
at 0x........: main (partial.c:22)
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 (partial.c:7)
Invalid read of size 4
at 0x........: main (partial.c:23)
Address 0x........ is 2 bytes inside the accessing pointer's
legitimate range, a block of size 5 alloc'd
at 0x........: malloc (vg_replace_malloc.c:...)
by 0x........: main (partial.c:8)
Invalid read of size 4
at 0x........: main (partial.c:24)
Address 0x........ is 3 bytes inside the accessing pointer's
legitimate range, a block of size 6 alloc'd
at 0x........: malloc (vg_replace_malloc.c:...)
by 0x........: main (partial.c:9)
Invalid read of size 4
at 0x........: main (partial.c:25)
Address 0x........ is 4 bytes inside the accessing pointer's
legitimate range, a block of size 7 alloc'd
at 0x........: malloc (vg_replace_malloc.c:...)
by 0x........: main (partial.c:10)
Invalid read of size 4
at 0x........: main (partial.c:34)
Address 0x........ is 1 bytes before the accessing pointer's
legitimate range, a block of size 3 alloc'd
at 0x........: malloc (vg_replace_malloc.c:...)
by 0x........: main (partial.c:6)
Invalid read of size 4
at 0x........: main (partial.c:35)
Address 0x........ is 0 bytes inside the accessing pointer's
legitimate range, a block of size 3 alloc'd
at 0x........: malloc (vg_replace_malloc.c:...)
by 0x........: main (partial.c:6)
Invalid read of size 4
at 0x........: main (partial.c:36)
Address 0x........ is 1 bytes inside the accessing pointer's
legitimate range, a block of size 3 alloc'd
at 0x........: malloc (vg_replace_malloc.c:...)
by 0x........: main (partial.c:6)
Invalid read of size 4
at 0x........: main (partial.c:37)
Address 0x........ is 2 bytes inside the accessing pointer's
legitimate range, a block of size 3 alloc'd
at 0x........: malloc (vg_replace_malloc.c:...)
by 0x........: main (partial.c:6)
Invalid read of size 4
at 0x........: main (partial.c:38)
Address 0x........ is 0 bytes after the accessing pointer's
legitimate range, a block of size 3 alloc'd
at 0x........: malloc (vg_replace_malloc.c:...)
by 0x........: main (partial.c:6)
Invalid read of size 4
at 0x........: main (partial.c:41)
Address 0x........ is 0 bytes inside the accessing pointer's
legitimate range, a block of size 3 alloc'd
at 0x........: malloc (vg_replace_malloc.c:...)
by 0x........: main (partial.c:6)
Invalid read of size 8
at 0x........: main (partial.c:42)
Address 0x........ is 0 bytes inside the accessing pointer's
legitimate range, a block of size 7 alloc'd
at 0x........: malloc (vg_replace_malloc.c:...)
by 0x........: main (partial.c:7)
Invalid read of size 4
at 0x........: main (partial.c:43)
Address 0x........ is 4 bytes inside the accessing pointer's
legitimate range, a block of size 7 alloc'd
at 0x........: malloc (vg_replace_malloc.c:...)
by 0x........: main (partial.c:8)
Invalid read of size 1
at 0x........: main (partial.c:44)
Address 0x........ is 0 bytes after the accessing pointer's
legitimate range, a block of size 0 alloc'd
at 0x........: malloc (vg_replace_malloc.c:...)
by 0x........: main (partial.c:9)
Invalid read of size 2
at 0x........: main (partial.c:45)
Address 0x........ is 0 bytes inside the accessing pointer's
legitimate range, a block of size 1 alloc'd
at 0x........: malloc (vg_replace_malloc.c:...)
by 0x........: main (partial.c:10)
ERROR SUMMARY: 15 errors from 15 contexts (suppressed: 0 from 0)

View File

@ -1,3 +0,0 @@
prereq: ./is_arch_supported
prog: partial
vgopts: --partial-loads-ok=no

View File

@ -1,94 +0,0 @@
Invalid read of size 4
at 0x........: main (partial.c:21)
Address 0x........ is 0 bytes inside the accessing pointer's
legitimate range, a block of size 3 alloc'd
at 0x........: malloc (vg_replace_malloc.c:...)
by 0x........: main (partial.c:6)
Invalid read of size 4
at 0x........: main (partial.c:22)
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 (partial.c:7)
Invalid read of size 4
at 0x........: main (partial.c:23)
Address 0x........ is 2 bytes inside the accessing pointer's
legitimate range, a block of size 5 alloc'd
at 0x........: malloc (vg_replace_malloc.c:...)
by 0x........: main (partial.c:8)
Invalid read of size 4
at 0x........: main (partial.c:24)
Address 0x........ is 3 bytes inside the accessing pointer's
legitimate range, a block of size 6 alloc'd
at 0x........: malloc (vg_replace_malloc.c:...)
by 0x........: main (partial.c:9)
Invalid read of size 4
at 0x........: main (partial.c:25)
Address 0x........ is 4 bytes inside the accessing pointer's
legitimate range, a block of size 7 alloc'd
at 0x........: malloc (vg_replace_malloc.c:...)
by 0x........: main (partial.c:10)
Invalid read of size 4
at 0x........: main (partial.c:34)
Address 0x........ is 1 bytes before the accessing pointer's
legitimate range, a block of size 3 alloc'd
at 0x........: malloc (vg_replace_malloc.c:...)
by 0x........: main (partial.c:6)
Invalid read of size 4
at 0x........: main (partial.c:35)
Address 0x........ is 0 bytes inside the accessing pointer's
legitimate range, a block of size 3 alloc'd
at 0x........: malloc (vg_replace_malloc.c:...)
by 0x........: main (partial.c:6)
Invalid read of size 4
at 0x........: main (partial.c:36)
Address 0x........ is 1 bytes inside the accessing pointer's
legitimate range, a block of size 3 alloc'd
at 0x........: malloc (vg_replace_malloc.c:...)
by 0x........: main (partial.c:6)
Invalid read of size 4
at 0x........: main (partial.c:37)
Address 0x........ is 2 bytes inside the accessing pointer's
legitimate range, a block of size 3 alloc'd
at 0x........: malloc (vg_replace_malloc.c:...)
by 0x........: main (partial.c:6)
Invalid read of size 4
at 0x........: main (partial.c:38)
Address 0x........ is 0 bytes after the accessing pointer's
legitimate range, a block of size 3 alloc'd
at 0x........: malloc (vg_replace_malloc.c:...)
by 0x........: main (partial.c:6)
Invalid read of size 4
at 0x........: main (partial.c:41)
Address 0x........ is 0 bytes inside the accessing pointer's
legitimate range, a block of size 3 alloc'd
at 0x........: malloc (vg_replace_malloc.c:...)
by 0x........: main (partial.c:6)
Invalid read of size 1
at 0x........: main (partial.c:44)
Address 0x........ is 0 bytes after the accessing pointer's
legitimate range, a block of size 0 alloc'd
at 0x........: malloc (vg_replace_malloc.c:...)
by 0x........: main (partial.c:9)
Invalid read of size 2
at 0x........: main (partial.c:45)
Address 0x........ is 0 bytes inside the accessing pointer's
legitimate range, a block of size 1 alloc'd
at 0x........: malloc (vg_replace_malloc.c:...)
by 0x........: main (partial.c:10)
ERROR SUMMARY: 13 errors from 13 contexts (suppressed: 0 from 0)

View File

@ -1,73 +0,0 @@
Invalid read of size 4
at 0x........: main (partial.c:22)
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 (partial.c:7)
Invalid read of size 4
at 0x........: main (partial.c:23)
Address 0x........ is 2 bytes inside the accessing pointer's
legitimate range, a block of size 5 alloc'd
at 0x........: malloc (vg_replace_malloc.c:...)
by 0x........: main (partial.c:8)
Invalid read of size 4
at 0x........: main (partial.c:24)
Address 0x........ is 3 bytes inside the accessing pointer's
legitimate range, a block of size 6 alloc'd
at 0x........: malloc (vg_replace_malloc.c:...)
by 0x........: main (partial.c:9)
Invalid read of size 4
at 0x........: main (partial.c:34)
Address 0x........ is 1 bytes before the accessing pointer's
legitimate range, a block of size 3 alloc'd
at 0x........: malloc (vg_replace_malloc.c:...)
by 0x........: main (partial.c:6)
Invalid read of size 4
at 0x........: main (partial.c:36)
Address 0x........ is 1 bytes inside the accessing pointer's
legitimate range, a block of size 3 alloc'd
at 0x........: malloc (vg_replace_malloc.c:...)
by 0x........: main (partial.c:6)
Invalid read of size 4
at 0x........: main (partial.c:37)
Address 0x........ is 2 bytes inside the accessing pointer's
legitimate range, a block of size 3 alloc'd
at 0x........: malloc (vg_replace_malloc.c:...)
by 0x........: main (partial.c:6)
Invalid read of size 4
at 0x........: main (partial.c:38)
Address 0x........ is 0 bytes after the accessing pointer's
legitimate range, a block of size 3 alloc'd
at 0x........: malloc (vg_replace_malloc.c:...)
by 0x........: main (partial.c:6)
Invalid read of size 8
at 0x........: main (partial.c:42)
Address 0x........ is 0 bytes inside the accessing pointer's
legitimate range, a block of size 7 alloc'd
at 0x........: malloc (vg_replace_malloc.c:...)
by 0x........: main (partial.c:7)
Invalid read of size 1
at 0x........: main (partial.c:44)
Address 0x........ is 0 bytes after the accessing pointer's
legitimate range, a block of size 0 alloc'd
at 0x........: malloc (vg_replace_malloc.c:...)
by 0x........: main (partial.c:9)
Invalid read of size 2
at 0x........: main (partial.c:45)
Address 0x........ is 0 bytes inside the accessing pointer's
legitimate range, a block of size 1 alloc'd
at 0x........: malloc (vg_replace_malloc.c:...)
by 0x........: main (partial.c:10)
ERROR SUMMARY: 10 errors from 10 contexts (suppressed: 0 from 0)

View File

@ -1,3 +0,0 @@
prereq: ./is_arch_supported
prog: partial
vgopts: --partial-loads-ok=yes

View File

@ -1,22 +0,0 @@
#include <pthread.h>
#include <stdlib.h>
// This demonstrates an error for a pre_mem_{read,write} event that comes
// from the core, rather than a syscall (ie. part == Vg_CorePart instead of
// part == Vg_CoreSyscall).
int main(void)
{
pthread_key_t* key = malloc(sizeof(pthread_key_t));
pthread_key_t* key2 = malloc(sizeof(pthread_key_t));
pthread_key_create ( (pthread_key_t*)((long)key + 1), NULL );
free(key2);
pthread_key_create ( key2 , NULL );
return 0;
}

View File

@ -1,19 +0,0 @@
Invalid write of size 4
at 0x........: pthread_key_create (in /...libpthread...)
by 0x........: main (pth_create.c:17)
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)
Invalid write of size 4
at 0x........: pthread_key_create (in /...libpthread...)
by 0x........: main (pth_create.c:19)
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)
ERROR SUMMARY: 2 errors from 2 contexts (suppressed: 0 from 0)

View File

@ -1,2 +0,0 @@
prereq: ./is_arch_supported
prog: pth_create

View File

@ -1,34 +0,0 @@
#include <pthread.h>
#include <assert.h>
#include <stdlib.h>
// This shows that putting a segment pointer into a thread-specific data
// area and then getting it out again doesn't lose info -- even though the
// key allocation/getting is done on the real CPU where the skin can't see,
// the get/set of the info is done using that key on the simd CPU where it
// can see, so everything works out fine.
int main(void)
{
pthread_key_t key;
char *x, *z;
char y __attribute__((unused));
x = malloc(100);
y = x[-1]; // error
x[1] = 'z';
assert( 0 == pthread_key_create ( &key, NULL ) );
assert( 0 == pthread_setspecific( key, x ) );
z = (char*)pthread_getspecific( key );
assert( 0 != z );
y = z[-1]; // error
// ensure the key went in and out correctly
assert(z == x);
assert(z[1] == 'z');
return 0;
}

View File

@ -1,17 +0,0 @@
Invalid read of size 1
at 0x........: main (pth_specific.c:19)
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)
Invalid read of size 1
at 0x........: main (pth_specific.c:27)
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)
ERROR SUMMARY: 2 errors from 2 contexts (suppressed: 0 from 0)

View File

@ -1,2 +0,0 @@
prereq: ./is_arch_supported
prog: pth_specific

View File

@ -1,46 +0,0 @@
#include <stdlib.h>
int main(void)
{
int i __attribute__((unused));
int* y __attribute__((unused));
int** x = malloc(sizeof(int*) * 100);
int* x2 = malloc(sizeof(int) * 100);
void* sink __attribute__((unused));
x[0] = x2; // this is to check the pointerness is copied across ok
x[49] = x2; // this is to check the pointerness is copied across ok
i = *x[0];
i = *x[49];
x = realloc(x, sizeof(int*)*50); // smaller
y = x[0]; // ok
y = x[49]; // ok
y = x[-1]; // bad
y = x[50]; // bad
i = *x[0]; // ok
i = *x[49]; // ok
x = realloc(x, sizeof(int*)*50); // same size
y = x[0]; // ok
y = x[49]; // ok
y = x[-1]; // bad
y = x[50]; // bad
i = *x[0]; // ok
i = *x[49]; // ok
x = realloc(x, sizeof(int*)*100); // bigger
y = x[0]; // ok
y = x[49]; // ok
y = x[50]; // ok
y = x[99]; // ok
y = x[-1]; // bad
y = x[100]; // bad
i = *x[0]; // ok
i = *x[49]; // ok
sink = realloc((void*)0x99, 10); // fails
return 0;
}

View File

@ -1,45 +0,0 @@
Invalid read of size 8
at 0x........: main (realloc.c:20)
Address 0x........ is 8 bytes before the accessing pointer's
legitimate range, a block of size 400 alloc'd
at 0x........: realloc (vg_replace_malloc.c:...)
by 0x........: main (realloc.c:17)
Invalid read of size 8
at 0x........: main (realloc.c:21)
Address 0x........ is 0 bytes after the accessing pointer's
legitimate range, a block of size 400 alloc'd
at 0x........: realloc (vg_replace_malloc.c:...)
by 0x........: main (realloc.c:17)
Invalid read of size 8
at 0x........: main (realloc.c:28)
Address 0x........ is 8 bytes before the accessing pointer's
legitimate range, a block of size 400 alloc'd
at 0x........: realloc (vg_replace_malloc.c:...)
by 0x........: main (realloc.c:25)
Invalid read of size 8
at 0x........: main (realloc.c:29)
Address 0x........ is 0 bytes after the accessing pointer's
legitimate range, a block of size 400 alloc'd
at 0x........: realloc (vg_replace_malloc.c:...)
by 0x........: main (realloc.c:25)
Invalid read of size 8
at 0x........: main (realloc.c:38)
Address 0x........ is 8 bytes before the accessing pointer's
legitimate range, a block of size 800 alloc'd
at 0x........: realloc (vg_replace_malloc.c:...)
by 0x........: main (realloc.c:33)
Invalid read of size 8
at 0x........: main (realloc.c:39)
Address 0x........ is 0 bytes after the accessing pointer's
legitimate range, a block of size 800 alloc'd
at 0x........: realloc (vg_replace_malloc.c:...)
by 0x........: main (realloc.c:33)
ERROR SUMMARY: 6 errors from 6 contexts (suppressed: 0 from 0)

View File

@ -1,45 +0,0 @@
Invalid read of size 4
at 0x........: main (realloc.c:20)
Address 0x........ is 4 bytes before the accessing pointer's
legitimate range, a block of size 200 alloc'd
at 0x........: realloc (vg_replace_malloc.c:...)
by 0x........: main (realloc.c:17)
Invalid read of size 4
at 0x........: main (realloc.c:21)
Address 0x........ is 0 bytes after the accessing pointer's
legitimate range, a block of size 200 alloc'd
at 0x........: realloc (vg_replace_malloc.c:...)
by 0x........: main (realloc.c:17)
Invalid read of size 4
at 0x........: main (realloc.c:28)
Address 0x........ is 4 bytes before the accessing pointer's
legitimate range, a block of size 200 alloc'd
at 0x........: realloc (vg_replace_malloc.c:...)
by 0x........: main (realloc.c:25)
Invalid read of size 4
at 0x........: main (realloc.c:29)
Address 0x........ is 0 bytes after the accessing pointer's
legitimate range, a block of size 200 alloc'd
at 0x........: realloc (vg_replace_malloc.c:...)
by 0x........: main (realloc.c:25)
Invalid read of size 4
at 0x........: main (realloc.c:38)
Address 0x........ is 4 bytes before the accessing pointer's
legitimate range, a block of size 400 alloc'd
at 0x........: realloc (vg_replace_malloc.c:...)
by 0x........: main (realloc.c:33)
Invalid read of size 4
at 0x........: main (realloc.c:39)
Address 0x........ is 0 bytes after the accessing pointer's
legitimate range, a block of size 400 alloc'd
at 0x........: realloc (vg_replace_malloc.c:...)
by 0x........: main (realloc.c:33)
ERROR SUMMARY: 6 errors from 6 contexts (suppressed: 0 from 0)

View File

@ -1,2 +0,0 @@
prereq: ./is_arch_supported
prog: realloc

View File

@ -1,44 +0,0 @@
#include <stdlib.h>
#include <string.h>
// This shows the case whereby subtraction between two pointers from
// different segments can be used legitimately.
// dest: stack, src: heap
char* my_strcpy (char* dest, const char* src)
{
char c, *s = (char *) src;
long off = dest - s;
off = off - 1;
do {
c = *s++;
s[off] = c; // s + off == dest
} while (c != '\0');
return dest;
}
int main(void)
{
char* h = "hello, world";
char* p1 = strdup(h);
char* p2 = strdup(h);
char u1[13];
char u2[13];
// All these are legit
p1[p2-p1] = 0; // p-p (must be BADSEG'd) // ea is p2[0]
u1[p2-u1] = 0; // p-?
p1[u2-p1] = 0; // ?-p (must be BADSEG'd)
u1[u2-u1] = 0; // ?-?
// All these are a 1-byte underrun
p1[p2-p1-1] = 0; // p-p (must be BADSEG'd) // ea is p2[-1]
u1[p2-u1-1] = 0; // p-? (undet)
p1[u2-p1-1] = 0; // ?-p (must be BADSEG'd)
u1[u2-u1-1] = 0; // ?-? (undet)
my_strcpy(u1, p1);
my_strcpy(u2, u1);
return 0;
}

View File

@ -1,3 +0,0 @@
ERROR SUMMARY: 0 errors from 0 contexts (suppressed: 0 from 0)

View File

@ -1,2 +0,0 @@
prereq: ./is_arch_supported
prog: strcpy

View File

@ -1,19 +0,0 @@
#include <string.h>
#include <stdlib.h>
#include <unistd.h>
#include <sys/types.h>
#include <sys/stat.h>
#include <fcntl.h>
#include <sys/time.h>
int main(void)
{
int i = 11; int fd = open("/dev/null", O_WRONLY);
char* buf = malloc(sizeof(char) * 6);
char c = buf[-1]; // LoadStoreErr
char* x = buf + (long)buf; // ArithErr
char* y = (char*)((long)buf * i); // AsmErr
write(fd, buf+3, 5); // SysParamErr
close(fd);
return x-y+c;
}

View File

@ -1,11 +0,0 @@
Syscall param write(buf) is non-contiguous
at 0x........: write (in /...libc...)
by 0x........: main (supp.c:16)
First byte (0x........) is 3 bytes inside a 6-byte block alloc'd
at 0x........: malloc (vg_replace_malloc.c:...)
by 0x........: main (supp.c:12)
Last byte is not inside a known block
ERROR SUMMARY: 1 errors from 1 contexts (suppressed: 0 from 0)

View File

@ -1,18 +0,0 @@
{
first-in-supp.supp
exp-ptrcheck:Heap
fun:main
}
{
second-in-supp.supp
exp-ptrcheck:Arith
fun:main
}
{
third-in-supp.supp
exp-ptrcheck:SysParam
write(buf)
fun:__GI___libc_write
fun:__libc_start_main
obj:*/annelid/tests/supp
}

View File

@ -1,3 +0,0 @@
prereq: ./is_arch_supported
vgopts: --suppressions=supp.supp
prog: supp

View File

@ -1,61 +0,0 @@
Invalid read of size 1
at 0x........: main (supp.c:13)
by 0x........: __libc_start_main (...libc...)
by 0x........: ...
Address 0x........ is 1 bytes before the accessing pointer's
legitimate range, the 6-byte block alloc'd
at 0x........: malloc (vg_replace_malloc.c:...)
by 0x........: main (supp.c:12)
by 0x........: __libc_start_main (...libc...)
by 0x........: ...
---- Print suppression ? --- [Return/N/n/Y/y/C/c] ---- {
<insert a suppression name here>
Annelid:LoadStore
fun:main
fun:__libc_start_main
obj:*/annelid/tests/supp
}
Invalid ADD
at 0x........: main (supp.c:14)
by 0x........: __libc_start_main (...libc...)
by 0x........: ...
Both args derived from address 0x........ of 6-byte block alloc'd
at 0x........: malloc (vg_replace_malloc.c:...)
by 0x........: main (supp.c:12)
by 0x........: __libc_start_main (...libc...)
by 0x........: ...
---- Print suppression ? --- [Return/N/n/Y/y/C/c] ---- {
<insert a suppression name here>
Annelid:Arith
fun:main
fun:__libc_start_main
obj:*/annelid/tests/supp
}
Warning: invalid file descriptor -1 in syscall write()
Syscall param write(buf) is non-contiguous
at 0x........: __libc_write (...libc...)
by 0x........: __libc_start_main (...libc...)
by 0x........: ...
First byte (0x........) is 3 bytes within a 6-byte block alloc'd
at 0x........: malloc (vg_replace_malloc.c:...)
by 0x........: main (supp.c:12)
by 0x........: __libc_start_main (...libc...)
by 0x........: ...
Last byte is not within a known block
---- Print suppression ? --- [Return/N/n/Y/y/C/c] ---- {
<insert a suppression name here>
Annelid:SysParam
write(buf)
fun:__GI___libc_write
fun:__libc_start_main
obj:*/annelid/tests/supp
}
ERROR SUMMARY: 3 errors from 3 contexts (suppressed: 0 from 0)

View File

@ -1,5 +0,0 @@
y
y
y
y

View File

@ -1,4 +0,0 @@
prog: supp
vgopts: --gen-suppressions=yes
args: < suppgen.stdin
stderr_filter: filter_suppgen

View File

@ -1,20 +0,0 @@
#include <stdlib.h>
int main(void)
{
// When I had n-u --> u, this gave a false positive... can happen because
// p+up can give n if you are (un)lucky, because the result is close enough
// to zero.
int u[20];
int* p = malloc(sizeof(int) * 100);
int* n;
int* x;
p[0] = 0; // ok
n = (int*)((long)p + (long)u); // result is n, because near zero!
x = (int*)((long)n - (long)u); // x == p
x[0] = 0; // ok, originally caused false pos.
return 0;
}

View File

@ -1,3 +0,0 @@
ERROR SUMMARY: 0 errors from 0 contexts (suppressed: 0 from 0)

View File

@ -1,2 +0,0 @@
prereq: ./is_arch_supported
prog: tricky

View File

@ -1,51 +0,0 @@
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
int main ( void )
{
char* x = strdup("hello");
char c __attribute__((unused));
char c0[8], c1[8], c2[8], c3[8], c4[8];
// Each of these pointers has a different alignment
char** p0 = (char**)&c0[0]; char** p1 = (char**)&c1[1];
char** p2 = (char**)&c2[2]; char** p3 = (char**)&c3[3];
char** p4 = (char**)&c4[4];
*p0 = x; *p1 = x; *p2 = x;
*p3 = x; *p4 = x;
// These 10 are ok
c = (*p0)[0];
c = (*p1)[0];
c = (*p2)[0];
c = (*p3)[0];
c = (*p4)[0];
c = (*p0)[5];
c = (*p1)[5];
c = (*p2)[5];
c = (*p3)[5];
c = (*p4)[5];
// These 10 are bad
c = (*p0)[-1]; // always word aligned, so det
c = (*p1)[-1]; // undet
c = (*p2)[-1]; // undet
c = (*p3)[-1]; // undet
c = (*p4)[-1]; // undet on 64-bit since not 64-bit aligned
c = (*p0)[6]; // always word aligned, so det
c = (*p1)[6]; // undet
c = (*p2)[6]; // undet
c = (*p3)[6]; // undet
c = (*p4)[6]; // undet on 64-bit since not 64-bit aligned
return 0;
}
/* What this program does: verifies that (unfortunately) if you store a
pointer misaligned, then the associated shadow value decays to Unknown,
and so when you retrieve the pointer later and dereference it, you
get no check :-( */

View File

@ -1,19 +0,0 @@
Invalid read of size 1
at 0x........: main (unaligned.c:33)
Address 0x........ is 1 bytes before the accessing pointer's
legitimate range, a block of size 6 alloc'd
at 0x........: malloc (vg_replace_malloc.c:...)
by 0x........: ...
by 0x........: main (unaligned.c:8)
Invalid read of size 1
at 0x........: main (unaligned.c:39)
Address 0x........ is 0 bytes after the accessing pointer's
legitimate range, a block of size 6 alloc'd
at 0x........: malloc (vg_replace_malloc.c:...)
by 0x........: ...
by 0x........: main (unaligned.c:8)
ERROR SUMMARY: 2 errors from 2 contexts (suppressed: 0 from 0)

View File

@ -1,35 +0,0 @@
Invalid read of size 1
at 0x........: main (unaligned.c:33)
Address 0x........ is 1 bytes before the accessing pointer's
legitimate range, a block of size 6 alloc'd
at 0x........: malloc (vg_replace_malloc.c:...)
by 0x........: ...
by 0x........: main (unaligned.c:8)
Invalid read of size 1
at 0x........: main (unaligned.c:37)
Address 0x........ is 1 bytes before the accessing pointer's
legitimate range, a block of size 6 alloc'd
at 0x........: malloc (vg_replace_malloc.c:...)
by 0x........: ...
by 0x........: main (unaligned.c:8)
Invalid read of size 1
at 0x........: main (unaligned.c:39)
Address 0x........ is 0 bytes after the accessing pointer's
legitimate range, a block of size 6 alloc'd
at 0x........: malloc (vg_replace_malloc.c:...)
by 0x........: ...
by 0x........: main (unaligned.c:8)
Invalid read of size 1
at 0x........: main (unaligned.c:43)
Address 0x........ is 0 bytes after the accessing pointer's
legitimate range, a block of size 6 alloc'd
at 0x........: malloc (vg_replace_malloc.c:...)
by 0x........: ...
by 0x........: main (unaligned.c:8)
ERROR SUMMARY: 4 errors from 4 contexts (suppressed: 0 from 0)

View File

@ -1,2 +0,0 @@
prereq: ./is_arch_supported
prog: unaligned

View File

@ -1,24 +0,0 @@
#include <stdlib.h>
#include <assert.h>
int main ( void )
{
char c __attribute__((unused)), *c0 = malloc(0), *c1;
c = *c0; // bad
c0 = realloc(c0, 10);
assert(c0);
c = *c0; // ok
c1 = c0;
c0 = realloc(c0, 0);
assert(!c0);
c = *c1; // bad, dangling
return 0;
}

View File

@ -1,18 +0,0 @@
Invalid read of size 1
at 0x........: main (zero.c:10)
Address 0x........ is 0 bytes after the accessing pointer's
legitimate range, a block of size 0 alloc'd
at 0x........: malloc (vg_replace_malloc.c:...)
by 0x........: main (zero.c:8)
Invalid read of size 1
at 0x........: main (zero.c:21)
Address 0x........ is 0 bytes inside the accessing pointer's
once-legitimate range, a block of size 10 free'd
at 0x........: free (vg_replace_malloc.c:...)
by 0x........: realloc (vg_replace_malloc.c:...)
by 0x........: main (zero.c:18)
ERROR SUMMARY: 2 errors from 2 contexts (suppressed: 0 from 0)

View File

@ -1,2 +0,0 @@
prereq: ./is_arch_supported
prog: zero