From patchwork Thu Oct 18 11:30:58 2012 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Riku Voipio X-Patchwork-Id: 192298 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from lists.gnu.org (lists.gnu.org [208.118.235.17]) (using TLSv1 with cipher AES256-SHA (256/256 bits)) (Client did not present a certificate) by ozlabs.org (Postfix) with ESMTPS id 0E0262C0092 for ; Thu, 18 Oct 2012 22:31:42 +1100 (EST) Received: from localhost ([::1]:40284 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1TOoKB-0000PA-UV for incoming@patchwork.ozlabs.org; Thu, 18 Oct 2012 07:31:39 -0400 Received: from eggs.gnu.org ([208.118.235.92]:45908) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1TOoJm-0008Mq-Su for qemu-devel@nongnu.org; Thu, 18 Oct 2012 07:31:23 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1TOoJi-0005Va-LK for qemu-devel@nongnu.org; Thu, 18 Oct 2012 07:31:14 -0400 Received: from afflict.kos.to ([92.243.29.197]:57388) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1TOoJi-0005V2-De for qemu-devel@nongnu.org; Thu, 18 Oct 2012 07:31:10 -0400 Received: by afflict.kos.to (Postfix, from userid 1000) id DCF2E264BE; Thu, 18 Oct 2012 13:31:07 +0200 (CEST) From: riku.voipio@linaro.org To: qemu-devel@nongnu.org Date: Thu, 18 Oct 2012 14:30:58 +0300 Message-Id: <1bdd7c7ea8a711efcb5141663865cc1f7e4e824d.1350559608.git.riku.voipio@linaro.org> X-Mailer: git-send-email 1.7.2.5 In-Reply-To: References: X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-Received-From: 92.243.29.197 Cc: Alexander Graf Subject: [Qemu-devel] [PATCH 02/11] linux-user: fix multi-threaded /proc/self/maps X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org Sender: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org From: Alexander Graf 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 Signed-off-by: Riku Voipio --- linux-user/syscall.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/linux-user/syscall.c b/linux-user/syscall.c index 1a38169..cf0b385 100644 --- a/linux-user/syscall.c +++ b/linux-user/syscall.c @@ -4962,8 +4962,8 @@ static int open_self_maps(void *cpu_env, int fd) #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