Skip site navigation (1)Skip section navigation (2)
Date:      Wed, 25 Nov 2009 00:35:05 +0900
From:      Hajimu UMEMOTO <ume@freebsd.org>
To:        Mikolaj Golub <to.my.trociny@gmail.com>
Cc:        FreeBSD Stable <freebsd-stable@freebsd.org>
Subject:   Re: pthread.h: typo in #define	pthread_cleanup_push/pthread_cleanup_pop
Message-ID:  <ygews1gkkba.wl%ume@mahoroba.org>
In-Reply-To: <8663907xyy.fsf@zhuzha.ua1>
References:  <86aayc7z4g.fsf@zhuzha.ua1> <8663907xyy.fsf@zhuzha.ua1>

next in thread | previous in thread | raw e-mail | index | archive | help
Hi,

>>>>> On Tue, 24 Nov 2009 17:18:29 +0200
>>>>> Mikolaj Golub <to.my.trociny@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@mahoroba.org  ume@{,jp.}FreeBSD.org
http://www.imasy.org/~ume/



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?ygews1gkkba.wl%ume>