pthread.h: typo in #define pthread_cleanup_push/pthread_cleanup_pop

Hajimu UMEMOTO ume at freebsd.org
Tue Nov 24 15:35:28 UTC 2009


Hi,

>>>>> On Tue, 24 Nov 2009 17:18:29 +0200
>>>>> Mikolaj Golub <to.my.trociny at gmail.com> said:

to.my.trociny> I was hurry when said that the patch fixed the problem. The application
to.my.trociny> compiled but later it crashed in pthread_cleanup_pop:

to.my.trociny> (gdb) bt
to.my.trociny> #0  0xbf4f9ee0 in ?? ()
to.my.trociny> #1  0x287d18c9 in __pthread_cleanup_pop_imp () from /lib/libthr.so.3
to.my.trociny> #2  0x287d18ed in pthread_cleanup_pop () from /lib/libthr.so.3
to.my.trociny> #3  0x287d123c in pthread_exit () from /lib/libthr.so.3
to.my.trociny> #4  0x287c7757 in pthread_getprio () from /lib/libthr.so.3
to.my.trociny> #5  0x00000000 in ?? ()

to.my.trociny> So, I don't know what these macros actually were supposed to be. They were
to.my.trociny> introduced in r179662:

Your modification to pthread.h is wrong.  You need to write your code
something like following:

	pthread_cleanup_push();
	. . .
	do something
	. . .
	pthread_cleanup_pop();

This is not FreeBSD alone.  pthread_cleanup_push() and
pthread_cleanup_pop() are macro on Linux as well.

Sincerely,

--
Hajimu UMEMOTO @ Internet Mutual Aid Society Yokohama, Japan
ume at mahoroba.org  ume@{,jp.}FreeBSD.org
http://www.imasy.org/~ume/


More information about the freebsd-stable mailing list