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

[csmith-bugs] Uninitialized member of union



Hello,

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 \initialized(&l_4.f9);
t.c:215:[kernel] warning: completely undefined value in {{ l_4 -> {0} }} (size:<16>).
...

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.

Pascal

Attachment: confirmation_patch
Description: Binary data