Skip to content

CSmith test with random seed 1684847330 has dump-c checksum mismatch #7729

Open
@tautschnig

Description

@tautschnig

https://github.com/diffblue/cbmc/actions/runs/5057664809/jobs/9076711993?pr=6785 reported:

Checksum mismatch: GCC: 0xE09F7B20 dump-c: 0x16014CDF

It seems that the semantics of the original C source as generated by CSmith and the one produced by dump-c differ for the program generated with random seed 1684847330. Needs investigation to figure out whether the bug is in dump-c or goto-program conversion. We need to enable debug output in the test example to see where checksums start diverging.

Activity

tautschnig

tautschnig commented on May 23, 2023

@tautschnig
CollaboratorAuthor
self-assigned this
on Oct 13, 2023
tautschnig

tautschnig commented on Oct 13, 2023

@tautschnig
CollaboratorAuthor

The issue once again came up, now with random seed 1697191533 (https://github.com/diffblue/cbmc/actions/runs/6506767120/job/17672954027?pr=7933).

tautschnig

tautschnig commented on Feb 5, 2024

@tautschnig
CollaboratorAuthor

Another example is random seed 1707092271.

tautschnig

tautschnig commented on Apr 30, 2024

@tautschnig
CollaboratorAuthor

Another example is random seed 1714474363.

tautschnig

tautschnig commented on Jun 19, 2024

@tautschnig
CollaboratorAuthor

Another example is random seed 1718809244.

tautschnig

tautschnig commented on Sep 18, 2024

@tautschnig
CollaboratorAuthor

Here is a reduce example of the problem:

#include <assert.h>
#include <stdint.h>
struct S0 {
  int32_t f4 : 18;
};
int32_t g_93 = -2;
struct S0 g_164 ;
int32_t g_176 ;
int main () {
  g_176 = (g_164.f4 = g_93);
  assert(g_176 == -2);
}

The code introduced in dbe6455 fails to accurately represent the semantics of the above assignment through a bitfield in the output of dump-c (the GOTO program, however, is correct). Instead, we will need to create local declarations of structs-with-bitfield (or perhaps see whether we have an existing, matching type) to precisely model this.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions

    CSmith test with random seed 1684847330 has dump-c checksum mismatch · Issue #7729 · diffblue/cbmc