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

Initializing arrays yields sat with sentinel frontend #546

Open
Novak756 opened this issue Jan 29, 2024 · 1 comment
Open

Initializing arrays yields sat with sentinel frontend #546

Novak756 opened this issue Jan 29, 2024 · 1 comment

Comments

@Novak756
Copy link

Describe the bug
Including sentinel in the frontend (sea spf,fpf,fcpf) yields sat when trying to intitialize multiple arrays like this:

extern void __VERIFIER_error(void);
extern long __VERIFIER_nondet_long(void);

#define ARRAY_SIZE 32
void init(long* array,int size){
    for(int i = 0; i < size; i++){
    	array[i] = __VERIFIER_nondet_long();
    }
}

int main(){
	long arr_val_87[ARRAY_SIZE];
	init(arr_val_87,ARRAY_SIZE);
	long arr_val_88[ARRAY_SIZE];
	init(arr_val_88,ARRAY_SIZE);
    return 0;
}

To Reproduce
Steps to reproduce the behavior:

  1. bug.c = code above
  2. sea -m64 spf/fpf/fpcf bug.c

Expected behavior
The program has no assertions so I would expect unsat, not sure what tests sentinel might add that cause this to fail.

Logs, Stacktraces, and Screenshots
Output from running spf with v2 flag

Desktop (please complete the following information):

  • OS: Nigthly Docker on Ubuntu 20.14
  • LLVM: llvm14
  • Z3: 4.8.9 - 64bit

Additional context
Initialising one array is fine, the problem occurs when calling init() on multiple arrays. sea pf and bpf frontends are also ok.
I was trying to explicitly initialize nondet arrays, as unitialized reads are undefined.

@Novak756 Novak756 changed the title Initializing arrays with sentinel gives sat Initializing arrays with sentinel yields sat Jan 29, 2024
@Novak756 Novak756 changed the title Initializing arrays with sentinel yields sat Initializing arrays yields sat with sentinel frontend Jan 29, 2024
@Novak756
Copy link
Author

Novak756 commented Mar 5, 2024

Just realized that adding --inline fixes the issue, so there is probably an issue in the interprocedural analysis.

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

1 participant