From 3eb0e1c6d6259c1d8db0859589a5ca67e3cac8e2 Mon Sep 17 00:00:00 2001 From: Ulrich Drepper Date: Wed, 12 Dec 2007 18:41:10 +0000 Subject: .. * tst-basic7.c: Allocate memory for the stack. --- nptl/ChangeLog | 2 ++ nptl/tst-basic7.c | 18 ++++++++++++++++++ 2 files changed, 20 insertions(+) (limited to 'nptl') diff --git a/nptl/ChangeLog b/nptl/ChangeLog index 4741cfc..3651d2e 100644 --- a/nptl/ChangeLog +++ b/nptl/ChangeLog @@ -1,5 +1,7 @@ 2007-12-12 Ulrich Drepper + * tst-basic7.c: Allocate memory for the stack. + [BZ #5465] * sysdeps/unix/sysv/linux/x86_64/pthread_cond_timedwait.S [!SHARED] (__pthread_cond_timedwait): Don't use VDSO. diff --git a/nptl/tst-basic7.c b/nptl/tst-basic7.c index da461e4..ff6b36b 100644 --- a/nptl/tst-basic7.c +++ b/nptl/tst-basic7.c @@ -7,6 +7,21 @@ #include #include +static void use_stack (size_t needed); + +void (*use_stack_ptr) (size_t) = use_stack; + +static void +use_stack (size_t needed) +{ + size_t sz = sysconf (_SC_PAGESIZE); + char *buf = alloca (sz); + memset (buf, '\0', sz); + + if (needed > sz) + use_stack_ptr (needed - sz); +} + static void use_up_memory (void) { @@ -38,6 +53,9 @@ do_test (void) int err; pthread_t tid; + /* Allocate the memory needed for the stack. */ + use_stack_ptr (PTHREAD_STACK_MIN); + use_up_memory (); err = pthread_create (&tid, NULL, child, NULL); -- cgit v1.1