summaryrefslogtreecommitdiff
path: root/thread_pthread.c
diff options
context:
space:
mode:
Diffstat (limited to 'thread_pthread.c')
-rw-r--r--thread_pthread.c5
1 files changed, 4 insertions, 1 deletions
diff --git a/thread_pthread.c b/thread_pthread.c
index 968c644897..47e94156e1 100644
--- a/thread_pthread.c
+++ b/thread_pthread.c
@@ -608,7 +608,10 @@ get_stack(void **addr, size_t *size)
&thinfo, sizeof(thinfo),
&reg, &regsiz));
*addr = thinfo.__pi_stackaddr;
- *size = thinfo.__pi_stacksize;
+ /* Must not use thinfo.__pi_stacksize for size.
+ It is around 3KB smaller than the correct size
+ calculated by thinfo.__pi_stackend - thinfo.__pi_stackaddr. */
+ *size = thinfo.__pi_stackend - thinfo.__pi_stackaddr;
STACK_DIR_UPPER((void)0, (void)(*addr = (char *)*addr + *size));
#else
#error STACKADDR_AVAILABLE is defined but not implemented.