Description
Looking at some tasks @vesalvojdani's CoOperRace could do but Goblint can't, I realized Goblint can't handle dynamically allocated mutexes even in the most simple of cases:
#include <pthread.h>
pthread_mutex_t *data1Lock;
int g;
void *funcA(void *param) {
pthread_mutex_lock(data1Lock);
g = 1; //NORACE
pthread_mutex_unlock(data1Lock);
}
int main(int argc, char *argv[]) {
data1Lock = (pthread_mutex_t *) malloc(sizeof(pthread_mutex_t));
pthread_mutex_init(data1Lock, ((void *)0));
pthread_t one, two;
pthread_create(&one, ((void *)0), &funcA, ((void *)0));
pthread_create(&two, ((void *)0), &funcA, ((void *)0));
}
Here, we even do the initialization before even going multi-threaded, and all allocs happen from the main thread, outside any loops.
One may even say it's a bit embarrassing that this trivial program is enough to defeat Goblint.