On Jan 29, 2012, at 4:27 PM, Kalle Olavi Niemitalo wrote: > Amittai Aviram <amittai.aviram@xxxxxxxx> writes: > >> As you can see, instruction 0x4090e5 has "callq 0"! >> So the question is why GCC has generated this code. > > I think this will happen if you link with the static pthread > library and your program uses pthread_cancel but not > pthread_mutex_destroy. To work around the problem, add some kind > of reference to pthread_mutex_destroy so that the linker will > pull it in. If you are using GNU ld, try its -u (or --undefined) > option; e.g. -Wl,-upthread_mutex_destroy. This works! Thank you very much! Amittai Aviram PhD Student in Computer Science Yale University 646 483 2639 amittai.aviram@xxxxxxxx http://www.amittai.com