From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:52177) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Ya2pV-0004GT-Ia for qemu-devel@nongnu.org; Mon, 23 Mar 2015 09:55:51 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1Ya2pQ-00013R-MZ for qemu-devel@nongnu.org; Mon, 23 Mar 2015 09:55:45 -0400 Received: from mail-lb0-f175.google.com ([209.85.217.175]:35248) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Ya2pQ-000136-De for qemu-devel@nongnu.org; Mon, 23 Mar 2015 09:55:40 -0400 Received: by lbcgn8 with SMTP id gn8so118707810lbc.2 for ; Mon, 23 Mar 2015 06:55:39 -0700 (PDT) From: riku.voipio@linaro.org Date: Mon, 23 Mar 2015 15:54:55 +0200 Message-Id: <61c7480fa36775cc2baa2f8141f0c64a15f827b5.1427118794.git.riku.voipio@linaro.org> In-Reply-To: References: MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Subject: [Qemu-devel] [PULL 3/3] linux-user: fix broken cpu_copy() List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: qemu-devel@nongnu.org Cc: Leon Alrae From: Leon Alrae New threads always point at the same env which is incorrect and usually leads to a crash. Signed-off-by: Leon Alrae Reviewed-by: Andreas Färber Signed-off-by: Riku Voipio --- 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 31eb60f..a8adb04 100644 --- a/linux-user/main.c +++ b/linux-user/main.c @@ -3451,7 +3451,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.4