badjump
badloop
buflen_check
+clientperm
+clientstackperm
dir
doublefree
errs1
badjump.stderr.exp badjump.vgtest \
badloop.stderr.exp badloop.vgtest \
buflen_check.stderr.exp buflen_check.stderr.exp.hd buflen_check.vgtest \
+ clientperm.stderr.exp clientperm.stderr.exp.hd \
+ clientperm.stdout.exp clientperm.vgtest \
+ clientstackperm.stderr.exp clientstackperm.stderr.exp.hd \
+ clientstackperm.stdout.exp clientstackperm.vgtest \
doublefree.stderr.exp doublefree.vgtest \
errs1.stderr.exp errs1.vgtest \
exitprog.stderr.exp exitprog.vgtest \
weirdioctl.stderr.exp weirdioctl.stdout.exp weirdioctl.vgtest
noinst_PROGRAMS = \
- badaddrvalue badfree badjump badloop buflen_check \
+ badaddrvalue badfree badjump badloop buflen_check clientperm \
+ clientstackperm \
doublefree errs1 exitprog fprw fwrite inits inline \
malloc1 malloc2 manuel1 manuel2 manuel3 \
memalign_test memcmptest mmaptest nanoleak pushfpopf \
trivialleak tronical weirdioctl \
mismatches new_override
-CFLAGS = $(WERROR) -Winline -Wall -Wshadow -g
+CFLAGS = $(WERROR) -Winline -Wall -Wshadow -g
CXXFLAGS = $(CFLAGS)
+INCLUDES = -I$(top_srcdir)/include
# C ones
badaddrvalue_SOURCES = badaddrvalue.c
badjump_SOURCES = badjump.c
badloop_SOURCES = badloop.c
buflen_check_SOURCES = buflen_check.c
+clientperm_SOURCES = clientperm.c
+clientstackperm_SOURCES = clientstackperm.c
doublefree_SOURCES = doublefree.c
errs1_SOURCES = errs1.c
exitprog_SOURCES = exitprog.c
#include <stdio.h>
#include <stdlib.h>
-#include "valgrind.h"
+#include "../memcheck.h"
int main1 ( void )
{
for (i = 0; i < 100; i++)
sum += aa[i];
- printf("sum is %d\n", sum);
+ printf("sum is %s\n", sum > 0 ? "positive" : "non-positive");
m = VALGRIND_DISCARD(m);
printf("m_rm: returned value is %d\n", m );
for (i = 0; i < 100; i++)
sum += aa[i];
- printf("sum is %d\n", sum);
+ printf("sum is %s\n", sum > 0 ? "positive" : "non-positive");
return 0;
}
--- /dev/null
+
+Conditional jump or move depends on uninitialised value(s)
+ at 0x........: main (clientperm.c:29)
+ by 0x........: __libc_start_main (...libc...)
+ by 0x........: calloc@@GLIBC_2.0 (in /.../tests/clientperm)
+
+Conditional jump or move depends on uninitialised value(s)
+ at 0x........: main (clientperm.c:36)
+ by 0x........: __libc_start_main (...libc...)
+ by 0x........: calloc@@GLIBC_2.0 (in /.../tests/clientperm)
+
+ERROR SUMMARY: 2 errors from 2 contexts (suppressed: 0 from 0)
+malloc/free: in use at exit: 100 bytes in 1 blocks.
+malloc/free: 1 allocs, 0 frees, 100 bytes allocated.
+For a detailed leak analysis, rerun with: --leak-check=yes
+For counts of detected errors, rerun with: -v
--- /dev/null
+
+discard 0 (0 -> 0) translations in range 0x........ .. 0x........
+discard 0 (0 -> 0) translations in range 0x........ .. 0x........
+discard 0 (0 -> 0) translations in range 0x........ .. 0x........
+discard 0 (0 -> 0) translations in range 0x........ .. 0x........
+
+ERROR SUMMARY: 0 errors from 0 contexts (suppressed: 0 from 0)
+malloc/free: in use at exit: 0 bytes in 0 blocks.
+malloc/free: 0 allocs, 0 frees, 0 bytes allocated.
+For a detailed leak analysis, rerun with: --leak-check=yes
+For counts of detected errors, rerun with: -v
--- /dev/null
+m_na: returned value is 0
+sum is non-positive
+m_rm: returned value is 0
+sum is non-positive
--- /dev/null
+prog: clientperm
#include <stdlib.h>
#include <stdio.h>
-#include "valgrind.h"
-
+#include "../memcheck.h"
int baaaad ( void )
{
- int i;
int spacer0[10];
- int aaa[10];
+ int aaa[10] __attribute__((unused));
int spacer1[10];
- int bbb[10];
+ int bbb[10] __attribute__((unused));
int spacer2[10];
- int ccc[10];
+ int ccc[10] __attribute__((unused));
int spacer3[10];
VALGRIND_MAKE_NOACCESS_STACK(spacer0, sizeof spacer0);
VALGRIND_MAKE_NOACCESS_STACK(spacer1, sizeof spacer1);
VALGRIND_MAKE_NOACCESS_STACK(spacer2, sizeof spacer2);
VALGRIND_MAKE_NOACCESS_STACK(spacer3, sizeof spacer3);
- printf("reading %p\n", &aaa[-3]);
+ printf("reading memory\n");
+ if ((int*)0xDEADBEEF == &aaa[-3]) { printf("DEAD BEEF!\n"); }
return aaa[-3];
- for (i = 0; i < 10; i++) {
- printf("poking addr %p\n", & spacer1[i]);
- spacer0[i] = spacer1[i] = spacer2[i] = spacer3[i] = 0;
- }
}
int main ( void )
{
int z = baaaad();
- return 0;
+ return z;
}
--- /dev/null
+
+Invalid read of size 4
+ at 0x........: baaaad (clientstackperm.c:23)
+ by 0x........: main (clientstackperm.c:29)
+ by 0x........: __libc_start_main (...libc...)
+ by 0x........: (within /.../tests/clientstackperm)
+ Address 0x........ is 36 bytes inside a 40-byte stack red-zone created
+ at 0x........: baaaad (clientstackperm.c:18)
+ by 0x........: main (clientstackperm.c:29)
+ by 0x........: __libc_start_main (...libc...)
+ by 0x........: (within /.../tests/clientstackperm)
+
+ERROR SUMMARY: 1 errors from 1 contexts (suppressed: 0 from 0)
+malloc/free: in use at exit: 0 bytes in 0 blocks.
+malloc/free: 0 allocs, 0 frees, 0 bytes allocated.
+For a detailed leak analysis, rerun with: --leak-check=yes
+For counts of detected errors, rerun with: -v
--- /dev/null
+
+discard 0 (0 -> 0) translations in range 0x........ .. 0x........
+discard 0 (0 -> 0) translations in range 0x........ .. 0x........
+discard 0 (0 -> 0) translations in range 0x........ .. 0x........
+discard 0 (0 -> 0) translations in range 0x........ .. 0x........
+
+ERROR SUMMARY: 0 errors from 0 contexts (suppressed: 0 from 0)
+malloc/free: in use at exit: 0 bytes in 0 blocks.
+malloc/free: 0 allocs, 0 frees, 0 bytes allocated.
+For a detailed leak analysis, rerun with: --leak-check=yes
+For counts of detected errors, rerun with: -v
--- /dev/null
+reading memory
--- /dev/null
+prog: clientstackperm
coolo_strlen
cpuid
dastest
+discard
floored
fork
fucomip
cpuid.stderr.exp cpuid.stderr.exp.hd cpuid.stdout.exp cpuid.vgtest \
dastest.stderr.exp dastest.stderr.exp.hd dastest.stdout.exp \
dastest.vgtest \
+ discard.stderr.exp discard.stderr.exp.hd discard.stdout.exp \
+ discard.vgtest \
floored.stderr.exp floored.stderr.exp.hd floored.stdout.exp \
floored.vgtest \
fork.stderr.exp fork.stderr.exp.hd fork.stdout.exp fork.vgtest \
noinst_PROGRAMS = \
bitfield1 bt_everything bt_literal coolo_strlen \
- cpuid dastest floored fork fucomip munmap_exe rcl_assert \
+ cpuid dastest discard floored fork fucomip munmap_exe rcl_assert \
rcrl readline1 resolv seg_override sha1_test shortpush shorts smc1 \
pth_blockedsig \
coolo_sigaction gxx304
cpuid_SOURCES = cpuid_c.c cpuid_s.s
coolo_strlen_SOURCES = coolo_strlen.c
dastest_SOURCES = dastest_c.c dastest_s.s
+discard_SOURCES = discard.c
fork_SOURCES = fork.c
floored_SOURCES = floored.c
floored_LDADD = -lm
#include <stdio.h>
-#include <valgrind.h>
+#include "../../include/valgrind.h"
int fooble ( void )
{
--- /dev/null
+
+discard ... (... -> ...) translations in range 0x........ .. 0x........
+
--- /dev/null
+
+
+ERROR SUMMARY: 0 errors from 0 contexts (suppressed: 0 from 0)
+malloc/free: in use at exit: 0 bytes in 0 blocks.
+malloc/free: 0 allocs, 0 frees, 0 bytes allocated.
+For a detailed leak analysis, rerun with: --leak-check=yes
+For counts of detected errors, rerun with: -v
--- /dev/null
+fooble-1() = 1749
+fooble-2() = 1749
--- /dev/null
+prog: discard
+stderr_filter: filter_none_discards