-
Notifications
You must be signed in to change notification settings - Fork 75
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
Crash on pthread_mutex_lock
with complicated argument
#1421
Comments
The easy workaround would be to just allow constant 0 index offset on a struct as a no-op. |
What do you mean by this? The points-to set for |
But it isn't OK because it's indexing a struct. That indexing should not be there at all, because really it just points to The indexing would be valid if there was a pointer to the first element of an array: struct a {
pthread_mutex_t b;
};
struct c {
struct a *conn;
} d();
int main() {
struct a str[1] = {0};
struct c axel = {0};
axel.conn = &str;
pthread_mutex_t* ptr = &((axel.conn + 0)->b);
pthread_mutex_lock(ptr);
pthread_mutex_unlock(ptr);
pthread_mutex_lock(&((axel.conn + 0)->b));
} Here Somewhere in the pointer arithmetic we're going wrong and assuming an array where there isn't one. This probably stems from the fact that arrays are the same as their first element pointer in such code. |
In 811c183, I made a hotfix to be able to continue benchmarking that catches this error and errors and returns a top of the corresponding type. |
Debugging revealed that this is caused by the line: Line 287 in a0309d1
|
For the following program (extracted from the
axel
benchmark of Concrat), Goblint crashes withwhereas
gcc -Wall
accepts the program without any issues.The text was updated successfully, but these errors were encountered: