Skip to content

CBMC crash during lowering of byte_update expression originating from memcpy() #5254

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
andreast271 opened this issue Mar 4, 2020 · 1 comment

Comments

@andreast271
Copy link
Contributor

CBMC version: 5.12 (cbmc-5.12-51-g051911e31)
Operating system: Linux x86_64
Exact command line resulting in the issue: cbmc memcopycrash.c
What behaviour did you expect: program finished successfully
What happened instead: Invariant check failed

Source file memcopycrash.c:

#include <assert.h>
void *memcpy();

struct offsetE
{
  char H;
  char V;
};

struct comp_t
{
  struct offsetE offsets[2];
  unsigned m_size[2];
};

int main(void)
{
  struct comp_t comp;
  struct offsetE T8[2] =
    {
      {((char)1),((char)1)},{((char)0),((char)1)}
    };
  (void)memcpy((char *)&(comp.offsets), (char *)&T8, 4);
  assert(comp.m_size[0] == 8);
  return 0;
}

Backtrace is attached.
backtrace.log

@tautschnig
Copy link
Collaborator

This was fixed by the changes in #5390.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants