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: Failure in tst-pthread-getattr.out.


On Sun, Jun 24, 2012 at 02:02:10PM +0530, Siddhesh Poyarekar wrote:
> On Thu, 21 Jun 2012 15:41:18 -0400, Carlos wrote:
> > Test output file:
> > ~~~
> > Verifying that stack top is accessible
> > Adjusting RLIMIT_STACK to 93554184359937
> > Adjusted rlimit: stacksize=93554184355840, stackaddr=0x2ae95be09000
> > ~~~
> 
> I was tinkering with this test case today and found something
> interesting I thought I'd share. I too got the massive rlimit above
> once, but the test case did not crash for me.
> 
> I copied the test case into a separate directory and built it and
> ran it with exactly the same commands that the 'make check' would. The
> resulting program crashed every single time, even when the RLIMIT_STACK
> was correct.
> 
> I compared the generated code for both the binary resulting from the
> make check run and the one generated outside of the tree and found that
> they are different. In fact, in the make check run, the
> call to allocate_and_test itself seems to be missing from the
> check_stack_top body and the allocate_and_test is simply this:
> 
> 0000000000401420 <allocate_and_test>:
>   401420:       55                      push   %rbp
>   401421:       48 89 e5                mov    %rsp,%rbp
>   401424:       48 83 ec 10             sub    $0x10,%rsp
>   401428:       48 89 e8                mov    %rbp,%rax
>   40142b:       48 29 f8                sub    %rdi,%rax
>   40142e:       48 83 c0 16             add    $0x16,%rax
>   401432:       48 83 e0 f0             and    $0xfffffffffffffff0,%rax
>   401436:       48 29 c4                sub    %rax,%rsp
>   401439:       c9                      leaveq 
>   40143a:       c3                      retq   
>   40143b:       0f 1f 44 00 00          nopl   0x0(%rax,%rax,1)
> 
> SO my first thought was that the bug is not fixed yet. I tweaked the
> test to access *stackaddr instead of the *mem to be sure and it did not
> crash, indicating that the bug is in fact fixed. So the alloca
> calculation in the test case is goofing up, with code generated by the
> compiler for local variables.
> 
> So while there is still something funny going on with the rlimit, there
> is a problem with the test case as well. I'll figure this out and post
> a tweak. It's just a test case fix, so I hope it is fine to push into
> 2.16 if it's ready in time.

Yes, please fix this in 2.16 so we don't have this test failing
randomly.

Thanks for looking into this!

Cheers,
Carlos.


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