I'm running a threaded program that segfaults after the threads are joined and before it returns. The last few lines are:
pthread_create (&th_a, NULL, producer, 0);
pthread_create (&th_b, NULL, consumer, 0);
/* Wait until producer and consumer finish. */
pthread_join (th_b, &retval);
pthread_join (th_a, &retval);
free(sec);
free(mysql_connection);
return 0;
The program segfaults after
free(mysql_connection);
and before
return 0;
Any ideas?
It's RH Linux 7 with g++ 2.95.3.
Disclaimer:
Beware: Studies have shown that research causes cancer in lab rats.
pthread_create (&th_a, NULL, producer, 0);
pthread_create (&th_b, NULL, consumer, 0);
/* Wait until producer and consumer finish. */
pthread_join (th_b, &retval);
pthread_join (th_a, &retval);
free(sec);
free(mysql_connection);
return 0;
The program segfaults after
free(mysql_connection);
and before
return 0;
Any ideas?
It's RH Linux 7 with g++ 2.95.3.
Disclaimer:
Beware: Studies have shown that research causes cancer in lab rats.