Skip to content
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

Bug: Ultimate Automizer missing an assertion violation when casting to pointer #661

Open
salvadorer opened this issue Feb 9, 2024 · 2 comments
Assignees
Labels

Comments

@salvadorer
Copy link

Hi,
I'm working with Ultimate Automizer (Version 0e0057c) and noticed that the assertion violation in the following code is missed:

extern unsigned long __VERIFIER_nondet_ulong(void);
extern void __VERIFIER_error(void);

void __ULTIMATE_assert(int cond) {
  if (!(cond)) {
  ERROR:
    __VERIFIER_error();
  }
}

int main(){
  const char* str_ptr = "";
  const char* inv_ptr = (char *) __VERIFIER_nondet_ulong();
  __ULTIMATE_assert(inv_ptr != str_ptr);
}

I invoked Ultimate with ~/UAutomizer-linux/Ultimate.py --architecture 64bit --spec unreach-call.prp --file test0.c
Ultimate outputs:

Execution finished normally
Writing output log to file Ultimate.log
Result:
TRUE

Notice that the same happens if you replace the call to __VERIFIER_nondet_ulong by a concrete address e.g. 0x55a8a2e6b007.

@salvadorer salvadorer added the bug label Feb 9, 2024
@salvadorer
Copy link
Author

By the way, I just noticed that Taipan and Kojak share this seemingly buggy behavior.

@Heizmann
Copy link
Member

Thanks for your bug report.
The standard says that the behavior for casts from integers to pointers is implementation-defined. We assume a certain implementation. However, we also think that this is a conceptual problem of our tools and we would like to change that. We are still discussing solutions.

Do you need a fix soon?

@Heizmann Heizmann self-assigned this Feb 16, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants