Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations IamaSherpa on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Threaded program segfaults

Status
Not open for further replies.

mbaranski

Programmer
Nov 3, 2000
421
US
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.
 
Maybe you should at the first close and free every statements opened on this connection. John Fill
1c.bmp


ivfmd@mail.md
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top