Received: from eggs.gnu.org ([2001:4830:134:3::10]:59966) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Ya1tu-0002qz-Im for qemu-devel@nongnu.org; Mon, 23 Mar 2015 08:56:15 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1Ya1tr-0000mf-Cc for qemu-devel@nongnu.org; Mon, 23 Mar 2015 08:56:14 -0400 Received: from mailapp01.imgtec.com ([195.59.15.196]:52485) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Ya1tr-0000mG-74 for qemu-devel@nongnu.org; Mon, 23 Mar 2015 08:56:11 -0400 From: Leon Alrae Date: Mon, 23 Mar 2015 12:55:52 +0000 Message-ID: <1427115352-4948-1-git-send-email-leon.alrae@imgtec.com> MIME-Version: 1.0 Content-Type: text/plain Subject: [Qemu-devel] [PATCH] linux-user: fix broken cpu_copy() List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: qemu-devel@nongnu.org Cc: riku.voipio@iki.fi, ehabkost@redhat.com, afaerber@suse.de New threads always point at the same env which is incorrect and usually leads to a crash. Signed-off-by: Leon Alrae --- Hi, This patch fixes the bug introduced in: commit 2994fd96d986578a342f2342501b4ad30f6d0a85 Author: Eduardo Habkost cpu: Make cpu_init() return QOM CPUState object Regards, Leon --- linux-user/main.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/linux-user/main.c b/linux-user/main.c index 6e446de..04668e8 100644 --- a/linux-user/main.c +++ b/linux-user/main.c @@ -3453,7 +3453,7 @@ CPUArchState *cpu_copy(CPUArchState *env) { CPUState *cpu = ENV_GET_CPU(env); CPUState *new_cpu = cpu_init(cpu_model); - CPUArchState *new_env = cpu->env_ptr; + CPUArchState *new_env = new_cpu->env_ptr; CPUBreakpoint *bp; CPUWatchpoint *wp; -- 2.1.0