runtimeverification / rv-predict

Code for improved rv-predict and installer
BSD 3-Clause "New" or "Revised" License
2 stars 3 forks source link

Worst-case for predict trace #1044

Open maya-rv opened 5 years ago

maya-rv commented 5 years ago

This program doesn't seem to exit. It should after a second, but it doesn't probably because the trace blows up in size (with RVP_TRACE_ONLY=yes)

#include <stdlib.h>
#include <pthread.h>
#include <unistd.h>

int glob;

void *thread_func(void *param)
{

    for (;;) {
        glob = glob + 1;
    }

    return NULL;
}

int main()
{
    pthread_t thread[2];

    pthread_create(&thread[0], NULL, thread_func, NULL);
    pthread_create(&thread[1], NULL, thread_func, NULL);
    sleep(1);

    return 0;
}