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

Re: [csmith-dev] csmith error



"Bill" == Bill Chan <billchan01@gmail.com> writes:

	Bill> I cleaned up my test setup, and I got rid of the gcc errors. I do
	Bill> get "comparison of distinct pointer types lacks a cast" warning
	Bill> though, but that's ok for now, because it doesn't stop gcc from
	Bill> creating executables.  When I run the exe, I get "checksum =
	Bill> xxxx" as the output. What does this checksum mean?

The checksum doesn't mean anything by itself.  But it is useful!

The checksum is useful for finding compiler bugs through differential testing.
In other words, you can compile your test program with several compilers --- or
one compiler with several different combinations of options --- to see if the
program always produces the same answer.

Because of the way that Csmith produces tests, the checksum output of a test
program should always be the same.  (Modulo a few details that I won't go into
here.)

For example, if you compile your test program with both "foobarcc -O1" and
"foobarcc -O2", and the two compiled test program output different checksums,
this is a very strong indicator that you have found a compiler bug.

For a longer explanation of these ideas, I'll refer you to our published
papers:
	http://www.cs.utah.edu/~regehr/papers/pldi11-preprint.pdf
	http://www.cs.utah.edu/~regehr/papers/emsoft08-preprint.pdf

The go into more detail about how the generated programs work.

	Bill> I still have troubles getting my compiler to compile the test
	Bill> codes. It crashed.

If your compiler crashes, congratulations :-).  You've found a bug!  Maybe not
the bug you were looking for, though :-(.

	Bill> I suspecting that typedefs are not correctly defined for my test
	Bill> setup. Can someone show me how to define types for my setup? The
	Bill> types for my system are: char 8 bits int 16 bits long 32 bits

This seems fine; I don't see anything wrong with those representations of the
standard types.

Eric.

-- 
-------------------------------------------------------------------------------
Eric Eide <eeide@cs.utah.edu>  .         University of Utah School of Computing
http://www.cs.utah.edu/~eeide/ . +1 (801) 585-5512 voice, +1 (801) 581-5843 FAX