From e6eb894e8d9736ea54f1f546c897fc959beefdfd Mon Sep 17 00:00:00 2001 From: Ulrich Drepper Date: Sun, 4 Apr 2004 10:52:27 +0000 Subject: [PATCH] Update. 2004-04-04 Ulrich Drepper * tst-context1.c (fct): Check whether correct stack is used. --- nptl/ChangeLog | 4 ++++ nptl/tst-context1.c | 16 +++++++++++++++- 2 files changed, 19 insertions(+), 1 deletion(-) diff --git a/nptl/ChangeLog b/nptl/ChangeLog index 2475f1b..c197dd4 100644 --- a/nptl/ChangeLog +++ b/nptl/ChangeLog @@ -1,3 +1,7 @@ +2004-04-04 Ulrich Drepper + + * tst-context1.c (fct): Check whether correct stack is used. + 2004-04-03 Ulrich Drepper * sysdeps/unix/sysv/linux/powerpc/lowlevellock.h: Never use diff --git a/nptl/tst-context1.c b/nptl/tst-context1.c index ff6e381..06e432b 100644 --- a/nptl/tst-context1.c +++ b/nptl/tst-context1.c @@ -36,9 +36,23 @@ static volatile int failures; static void fct (long int n) { + char on_stack[1]; + /* Just to use the thread local descriptor. */ - printf ("%ld: in %s now\n", n, __FUNCTION__); + printf ("%ld: in %s now, on_stack = %p\n", n, __FUNCTION__, on_stack); errno = 0; + + if (n < 0 || n >= N) + { + printf ("%ld out of range\n", n); + exit (1); + } + + if (on_stack < stacks[n] || on_stack >= stacks[n] + sizeof (stacks[0])) + { + printf ("%ld: on_stack not on appropriate stack\n", n); + exit (1); + } } -- 2.7.4