This is the mail archive of the libc-alpha@sourceware.org mailing list for the glibc project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: tst-pthread-getattr changes break sparc


On 07/27/2012 03: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.

Sparc isn't the only target that allocates OS stuff below the pointer
you get back from alloca.  It's just the only one that can use that
space at non-deterministic times.

Sparc, PPC64, HPPA, Tile, s390, all define STACK_POINTER_OFFSET in gcc.

You may well have to mirror that definition in your test and probe below
the pointer you get back from alloca.  Or probe the hard stack pointer
register instead (at which point you'll have to take sparc64 stack bias
into account too).


r~


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]