-
Notifications
You must be signed in to change notification settings - Fork 77
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
thread
analysis requires context-sensitive threadids
#1615
Comments
This is currently holding us back on some benchmarking for the PLDI project, so I will see if it can be easily fixed. |
// PARAM: --set ana.context.gas_value 0 --set ana.activated[+] thread --set ana.activated[+] threadid
#include <pthread.h>
#include <stdio.h>
int myglobal;
void *t_flurb(void *arg) {
myglobal=40; //RACE
return NULL;
}
void *t_fun(void *arg) {
unknown(t_flurb);
return NULL;
}
int main(void) {
pthread_t id;
pthread_create(&id, NULL, t_fun, NULL);
pthread_create(&id, NULL, t_fun, NULL);
return 0;
} Example to reproduce the issue. |
Looking at this, it does not seem to be really correct anyway. |
A bit of an unrelated question, but what's the reason for using the old thread analysis, not the newer threadJoins? If I understand correctly, this concerns direct non-unique thread creations (like |
I think we are using some kind of default configuration for Goblint, as the details are not too relevant and this way we need to do the least amount of arguing which configuration we chose.
Iirc
Yes, and the case where threads are spawned from unknown functions, which is the case for |
Maybe, although I don't immediately know why that would be (other than being more precise simply means more contexts, etc). Both use side effects for threads to indicate dirty/clean exit, but the threads analysis does more than that: there's side effects and dependencies for the entire thread creation hierarchy which otherwise is implicit in thread IDs now.
Oh indeed, then as well. It would probably be a good idea to add missing things to |
As discovered by @Red-Panda64, the old
thread
analysis assumes we have context-sensitive thread ids activated when doing athreadenter
which we know to be mutliple (c.f. #1187)analyzer/src/analyses/threadAnalysis.ml
Lines 97 to 101 in 750f1ee
Another call to
ThreadId.get_current_unlift
is inthread_spawn
for the spawned thread. However, this may be correct as we would still have a non-top thread id for the created thread at this point (?)https://github.com/goblint/analyzer/blame/750f1ee274a00d6614cd2141f302ce551b094d57/src/analyses/threadAnalysis.ml#L103-L113
The text was updated successfully, but these errors were encountered: