2012-09-06 02:28:20 +02:00
|
|
|
From bd56605435341c14ff8fb6194961f3ab7d00cc79 Mon Sep 17 00:00:00 2001
|
2012-05-31 19:37:49 +02:00
|
|
|
From: Alexander Graf <agraf@suse.de>
|
|
|
|
Date: Wed, 30 May 2012 14:40:47 +0200
|
|
|
|
Subject: [PATCH] linux-user: fix multi-threaded /proc/self/maps
|
|
|
|
|
|
|
|
When reading our faked /proc/self/maps from a secondary thread,
|
|
|
|
we get an invalid stack entry. This is because ts->stack_base is not
|
|
|
|
initialized in non-primary threads.
|
|
|
|
|
|
|
|
However, ts->info is, and the stack layout information we're looking
|
|
|
|
for is there too. So let's use that one instead!
|
|
|
|
|
|
|
|
Signed-off-by: Alexander Graf <agraf@suse.de>
|
|
|
|
---
|
|
|
|
linux-user/syscall.c | 4 ++--
|
|
|
|
1 files changed, 2 insertions(+), 2 deletions(-)
|
|
|
|
|
|
|
|
diff --git a/linux-user/syscall.c b/linux-user/syscall.c
|
2012-09-05 13:51:25 +02:00
|
|
|
index 46331c7..946f5fb 100644
|
2012-05-31 19:37:49 +02:00
|
|
|
--- a/linux-user/syscall.c
|
|
|
|
+++ b/linux-user/syscall.c
|
2012-08-17 18:42:52 +02:00
|
|
|
@@ -4975,8 +4975,8 @@ static int open_self_maps(void *cpu_env, int fd)
|
2012-05-31 19:37:49 +02:00
|
|
|
#if defined(TARGET_ARM) || defined(TARGET_M68K) || defined(TARGET_UNICORE32)
|
|
|
|
dprintf(fd, "%08llx-%08llx rw-p %08llx 00:00 0 [stack]\n",
|
|
|
|
(unsigned long long)ts->info->stack_limit,
|
|
|
|
- (unsigned long long)(ts->stack_base + (TARGET_PAGE_SIZE - 1))
|
|
|
|
- & TARGET_PAGE_MASK,
|
|
|
|
+ (unsigned long long)(ts->info->start_stack +
|
|
|
|
+ (TARGET_PAGE_SIZE - 1)) & TARGET_PAGE_MASK,
|
|
|
|
(unsigned long long)0);
|
|
|
|
#endif
|
|
|
|
|