This is the mail archive of the
libc-alpha@sourceware.org
mailing list for the glibc project.
Re: tst-pthread-getattr changes break sparc
On 7/27/2012 6:47 AM, Siddhesh Poyarekar wrote:
> On Fri, 27 Jul 2012 03:38:00 -0700 (PDT), David wrote:
>>> This means that I won't be checking the top of stack with the test,
>>> which basically misses the point of doing this test at all. Would
>>> it be a better idea instead to disable this test for sparc in the
>>> Makefile?
>> What's the test actually trying to verify?
> The test is trying to verify that the stackaddr that pthread_getattr_np
> returns is valid, i.e. the program can access the location pointed to
> by stackaddr. In the general case, stackaddr will be the edge of
> RLIMIT_STACK or just within, which is why it looks to me that it would
> be incompatible with the way sparc context switches work.
It might be simpler to just test that the page pointed to by "stackaddr" is
accessible. You could target your alloca() request to stackaddr plus half
of getpagesize(), and not worry about the precise details of alloca's
overhead. I don't think there's any need to worry about whether the bottom
of that bottom page is accessible or not, if we can show that the middle of
the bottom page is accessible. It feels like it would make the code a lot
less finicky.
--
Chris Metcalf, Tilera Corp.
http://www.tilera.com