[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [csmith-bugs] Uninitialized member of union

It's depressing that Csmith is complex enough to have errors that take weeks to manifest, but excellent that you are persistent enough to find these :).


On 11/25/11 12:46 AM, Pascal Cuoq wrote:

it is my sad duty to report that 7 core.weeks of testing
appear to have revealed a bug in Csmith 2.1.0.

Manzana:csmith-2.1.0 pascal$ src/csmith --max-expr-complexity 10
--max-pointer-depth 3 --max-funcs 4 --max-array-dim 2
--max-array-len-per-dim 3 --max-struct-fields 12 --max-union-fields 12
--no-volatiles --bitfields --no-argc --unions -s 331253426 > t.c
Manzana:csmith-2.1.0 pascal$ ~/ppc/bin/toplevel.opt -val
-obviously-terminates t.c -cpp-command "gcc -C -E -Iruntime" -machdep x86_64
t.c:215:[kernel] warning: accessing uninitialized left-value: assert
t.c:215:[kernel] warning: completely undefined value in {{ l_4 -> {0} }}

The attached patch, initializing what would otherwise be an
uninitialized member, makes the program display two different numbers.
The program should always display the same number if it was defined in
the first place.
This is with 64-bit little-endian compilation.