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

Re: [csmith-dev] Zero Checksum

"Paulo" == Paulo J Matos <Paulo.Matos@csr.com> writes:

	Paulo> I am slightly concerned with this example:
	Paulo> $ csmith -v
	Paulo> csmith 2.1.0
	Paulo> Git version: e65d3c7
	Paulo> $ csmith -s 791373680 --no-argc --no-math64 --no-longlong --checksum > 
	Paulo> test.c
	Paulo> $ gcc -o test -I../../../../local/csmith-runtime/ test.c
	Paulo> $ ./test
	Paulo> checksum = 0
	Paulo> I have seen a couple of seeds with a checksum result equal to
	Paulo> zero.  This creates some concern about it. Either the checksum
	Paulo> is indeed zero and it is a bad checksum algorithm, or it is not
	Paulo> the checksum and there's a bug somewhere which might be
	Paulo> multiplying the checksum by zero.

I reproduced this.  When I run the generated program, the output checksum is

Looking at the generated program, one can see that it does almost nothing and
has no globals.  Given this, I'm not surprised that the checksum is zero.

I don't agree that a checksum algorithm that sometimes outputs zero is bad.
Especially when it is asked to checksum no data.

	Paulo> Also, I would expect the checksum to be always of the format:
	Paulo> checksum = [A-F0-9]{4}
	Paulo> Any other format hints at a bug. So if this checksum is indeed
	Paulo> zero. Can you please output it as
	Paulo> checksum = 0000
	Paulo> ?

Why do expect that the checksum would be output as a four-digit hex value?
Would doing this make it easier for some other tool to parse or store or...?

I don't agree that outputting the checksum in base 10 hints at a bug.  It may
be less convenient for some application, but I'm not sure what application you
might have in mind.

Thanks ---


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