From: Florian Krohm Date: Sun, 29 Jan 2012 02:23:07 +0000 (+0000) Subject: Add testcase for bugzilla #287260. Testcase by M.Welinder X-Git-Tag: svn/VALGRIND_3_8_0~494 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=83845abd22f257d2046b1d21114f09277c0b27f8;p=thirdparty%2Fvalgrind.git Add testcase for bugzilla #287260. Testcase by M.Welinder (mwelinder@gmail.com). Announce bug fix. git-svn-id: svn://svn.valgrind.org/valgrind/trunk@12359 --- diff --git a/NEWS b/NEWS index 79fd6cb1c4..b46679758c 100644 --- a/NEWS +++ b/NEWS @@ -46,6 +46,7 @@ where XXXXXX is the bug number as listed below. 283413 Fix wrong sanity check 286270 vgpreload is not friendly to 64->32 bit execs, gives ld.so warnings 286374 Running cachegrind with --branch-sim=yes on 64-bit PowerPC program fails +287260 Incorrect conditional jump or move depends on uninitialised value(s) 287858 VG_(strerror): unknown error 289699 vgdb connection in relay mode erroneously closed due to buffer overrun 289939 wish: complete monitor cmd 'leak_check' with details about leaked or reachable blocks diff --git a/memcheck/tests/Makefile.am b/memcheck/tests/Makefile.am index 25e8f1a630..55ba531e99 100644 --- a/memcheck/tests/Makefile.am +++ b/memcheck/tests/Makefile.am @@ -66,6 +66,7 @@ EXTRA_DIST = \ big_blocks_freed_list.stderr.exp big_blocks_freed_list.vgtest \ brk2.stderr.exp brk2.vgtest \ buflen_check.stderr.exp buflen_check.vgtest buflen_check.stderr.exp-kfail \ + bug287260.stderr.exp bug287260.vgtest \ calloc-overflow.stderr.exp calloc-overflow.vgtest\ clientperm.stderr.exp \ clientperm.stdout.exp clientperm.vgtest \ @@ -222,6 +223,7 @@ check_PROGRAMS = \ big_blocks_freed_list \ brk2 \ buflen_check \ + bug287260 \ calloc-overflow \ clientperm \ custom_alloc \ diff --git a/memcheck/tests/bug287260.c b/memcheck/tests/bug287260.c new file mode 100644 index 0000000000..79574f86d3 --- /dev/null +++ b/memcheck/tests/bug287260.c @@ -0,0 +1,16 @@ +#include + +typedef struct { + unsigned int stuff : 21; + signed int rotation : 10; +} Oink; + +int +main (int argc, char **argv) +{ + volatile Oink r; + + r.rotation = 45; + fprintf (stderr, "%d\n", r.rotation); + return 0; +} diff --git a/memcheck/tests/bug287260.stderr.exp b/memcheck/tests/bug287260.stderr.exp new file mode 100644 index 0000000000..a9d58bf4af --- /dev/null +++ b/memcheck/tests/bug287260.stderr.exp @@ -0,0 +1,11 @@ + +45 + +HEAP SUMMARY: + in use at exit: 0 bytes in 0 blocks + total heap usage: 0 allocs, 0 frees, 0 bytes allocated + +For a detailed leak analysis, rerun with: --leak-check=full + +For counts of detected and suppressed errors, rerun with: -v +ERROR SUMMARY: 0 errors from 0 contexts (suppressed: 0 from 0) diff --git a/memcheck/tests/bug287260.vgtest b/memcheck/tests/bug287260.vgtest new file mode 100644 index 0000000000..928ef80788 --- /dev/null +++ b/memcheck/tests/bug287260.vgtest @@ -0,0 +1 @@ +prog: bug287260