From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 14356 invoked by alias); 28 Nov 2011 15:40:22 -0000 Received: (qmail 14288 invoked by uid 22791); 28 Nov 2011 15:40:21 -0000 X-SWARE-Spam-Status: No, hits=4.1 required=5.0 tests=AWL,BAYES_00,BOTNET,FROM_12LTRDOM,RDNS_DYNAMIC X-Spam-Check-By: sourceware.org Received: from bl22-166-20.dsl.telepac.pt (HELO localhost6.localdomain6) (2.83.166.20) by sourceware.org (qpsmtpd/0.43rc1) with ESMTP; Mon, 28 Nov 2011 15:40:06 +0000 Received: from localhost6.localdomain6 (localhost.localdomain [127.0.0.1]) by localhost6.localdomain6 (8.14.4/8.14.4/Debian-2ubuntu1) with ESMTP id pASFdwgd018083 for ; Mon, 28 Nov 2011 15:40:04 GMT Subject: [RFC/WIP PATCH 12/14] Fix deref of stale pointer To: gdb-patches@sourceware.org From: Pedro Alves Date: Mon, 28 Nov 2011 15:40:00 -0000 Message-ID: <20111128153958.17761.70430.stgit@localhost6.localdomain6> In-Reply-To: <20111128153742.17761.21459.stgit@localhost6.localdomain6> References: <20111128153742.17761.21459.stgit@localhost6.localdomain6> User-Agent: StGit/0.15 MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: 7bit X-IsSubscribed: yes Mailing-List: contact gdb-patches-help@sourceware.org; run by ezmlm Precedence: bulk List-Id: List-Subscribe: List-Archive: List-Post: List-Help: , Sender: gdb-patches-owner@sourceware.org X-SW-Source: 2011-11/txt/msg00767.txt.bz2 ecs->event_thread was being referenced somewhere after target_mourn_inferior. I don't recall where now though... :-P In any case, I'm not sure this is the right fix, so I'll need to revert and revisit. Meanwhile, this is necessary to get things working. --- gdb/infrun.c | 2 ++ 1 files changed, 2 insertions(+), 0 deletions(-) diff --git a/gdb/infrun.c b/gdb/infrun.c index 6b16184..44fa074 100644 --- a/gdb/infrun.c +++ b/gdb/infrun.c @@ -4011,6 +4011,7 @@ handle_inferior_event (struct execution_control_state *ecs) current_inferior ()->exit_code = (LONGEST) ecs->ws.value.integer; gdb_flush (gdb_stdout); + ecs->event_thread = NULL; target_mourn_inferior (); singlestep_breakpoints_inserted_p = 0; cancel_single_step_breakpoints (); @@ -4033,6 +4034,7 @@ handle_inferior_event (struct execution_control_state *ecs) target_kill() was called here, which hints that fatal signals aren't really fatal on some systems. If that's true, then some changes may be needed. */ + ecs->event_thread = NULL; target_mourn_inferior (); print_signal_exited_reason (ecs->ws.value.sig);