The following is one minimal example to reproduce the problem. To me, the code looks quite innocent. I suspect there's some magic behind struct timespc
; however, I can't find anything that could explain why it crashes.
#include <stdio.h>
#include <stdlib.h>
#include <pthread.h>
#include <time.h>
typedef struct _task
{
int id;
int deadline;
struct timespec processed_at;
int process_time;
} task;
int main(int argc, char *argv[])
{
task *t = malloc(sizeof t);
t->process_time = 3;
free(t);
return 0;
}