Fix tst-pthread-getattr test case
commitb2ae49dab80bb00771dd4c29b518f1829690d55b
authorSiddhesh Poyarekar <siddhesh@redhat.com>
Fri, 20 Jul 2012 17:53:20 +0000 (20 23:23 +0530)
committerSiddhesh Poyarekar <siddhesh@redhat.com>
Fri, 20 Jul 2012 17:58:34 +0000 (20 23:28 +0530)
treec00539a38b053050c8d1417a78366361af9e33ae
parentd37cbdaa86f484dc5be58be391da739df862bf96
Fix tst-pthread-getattr test case

In some cases, the compiler would optimize out the call to
allocate_and_test and thus result in a false positive for the test
case. Another problem was the fact that the compiler could in some
cases generate additional shifting of the stack pointer, resulting in
alloca moving the stack pointer beyond what is allowed by the
rlimit. Hence, accessing the stackaddr returned by pthread_getattr_np
is safer than relying on the alloca'd result.

Another problem is when RLIMIT may be very large, which may result in
violation of other resource limits. Hence we cap the max stack size to
8M for this test.
nptl/ChangeLog
nptl/tst-pthread-getattr.c