smack
smack copied to clipboard
Model realloc
Memory reallocation is used by rust libraries (e.g., vec
). We need to model it properly.
Is it possible to write a C-language test case for this?
@Guoanshisb (Shaobo): Please write a simple C program that uses realloc, which we can use to debug this.
@michael-emmi : To model realloc, we most likely need $Size
to be present in all memory models. The pull request related to memory safety is supposed to do that. I just provided feedback to that pull request. I will stay on top of it this time around and try to merge it soon. Then we can take care of realloc.
Simple tests for correct realloc behavior. Attached as a .txt file since github rejects .c files. realloc_simple.txt
This issue has been resolved: we model realloc as free-then-malloc.
Has Mark's program been added to our regressions?
Has Mark's program been added to our regressions?
No, SMACK reports an error for Mark's program as we don't model copying in realloc.
Could we update the model to include copying as well?
Could we update the model to include copying as well?
This might be very tricky since we have to keep track of the memory associated with the base pointer.
@keram88 thoughts?