From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from simark.ca by simark.ca with LMTP id mfHeDya98mpZcD0AWB0awg (envelope-from ) for ; Tue, 10 Nov 2026 01:43:50 -0500 Authentication-Results: simark.ca; dkim=pass (2048-bit key; unprotected) header.d=intel.com header.i=@intel.com header.a=rsa-sha256 header.s=Intel header.b=QQ1jZuex; dkim-atps=neutral Received: by simark.ca (Postfix, from userid 112) id 244171E043; Tue, 10 Nov 2026 01:43:50 -0500 (EST) X-Spam-Checker-Version: SpamAssassin 4.0.1 (2024-03-25) on simark.ca X-Spam-Level: X-Spam-Status: No, score=-6.4 required=5.0 tests=ARC_SIGNED,ARC_VALID,BAYES_00, DKIMWL_WL_HIGH,DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,MAILING_LIST_MULTI, RCVD_IN_DNSWL_MED autolearn=ham autolearn_force=no version=4.0.1 Received: from vm01.sourceware.org (vm01.sourceware.org [IPv6:2620:52:6:3111::32]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange x25519 server-signature ECDSA (prime256v1) server-digest SHA256) (No client certificate requested) by simark.ca (Postfix) with ESMTPS id 00F2C1E043 for ; Tue, 10 Nov 2026 01:43:48 -0500 (EST) Received: from vm01.sourceware.org (localhost [IPv6:::1]) by sourceware.org (Postfix) with ESMTP id 7117C4BA23F1 for ; Tue, 10 Nov 2026 06:43:48 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 7117C4BA23F1 Authentication-Results: sourceware.org; dkim=pass (2048-bit key, unprotected) header.d=intel.com header.i=@intel.com header.a=rsa-sha256 header.s=Intel header.b=QQ1jZuex Received: from mgamail.intel.com (mgamail.intel.com [198.175.65.14]) by sourceware.org (Postfix) with ESMTPS id D17884BA2E04 for ; Tue, 10 Nov 2026 06:43:21 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org D17884BA2E04 Authentication-Results: sourceware.org; dmarc=pass (p=none dis=none) header.from=intel.com Authentication-Results: sourceware.org; spf=pass smtp.mailfrom=intel.com ARC-Filter: OpenARC Filter v1.0.0 sourceware.org D17884BA2E04 Authentication-Results: sourceware.org; arc=none smtp.remote-ip=198.175.65.14 ARC-Seal: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1794293002; cv=none; b=SCLEUZv95bdx4gV/COreNTcgtoGzN3a3MalyX4QKVVSvgWnro8u4OqKZkyA/LXslEXJSQTJMd6HWXwZCIoP9lqa4Z0D7IuyB0vrTN8APxoEC1f1Yr2yDVWHeqWZIBH/lUCzwGgLEp6g1+5dbyWBbfskxfrzIiw4u91eXh6MCVn0= ARC-Message-Signature: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1794293002; c=relaxed/simple; bh=0ENXP78+8OpbIBPdAkLJOw71WzXZXXdNNC66eizgk1Y=; h=DKIM-Signature:From:To:Subject:Date:Message-ID:MIME-Version; b=oHE4ekYkMZkfm07nnBNZmZ83iDodY043hdDzXJzOw6Jsj7dsMz6Ekvhkjp9GkLDLHfqGepEyFBdIGM8E9uEIRbAtk9mq90/CiW1lSkRyH/OTmf56S/zcqQ/mkz3vjUPkcJtNpgGylsWWpRtSHYh7idwBBi4vY1n5pEai2aolYTE= ARC-Authentication-Results: i=1; sourceware.org; dkim=pass (2048-bit key, unprotected) header.d=intel.com header.i=@intel.com header.a=rsa-sha256 header.s=Intel header.b=QQ1jZuex DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org D17884BA2E04 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1794293002; x=1825829002; h=from:to:subject:date:message-id:mime-version: content-transfer-encoding; bh=0ENXP78+8OpbIBPdAkLJOw71WzXZXXdNNC66eizgk1Y=; b=QQ1jZuext/QdfIv04/UQTu/mSHj5LpQYRs73VD6GFJR3r/u8icjxHZz1 FeOrQfWIVzxPnpaRdtyipKUw8Z9qcoTfdpNZ8nPZkpiqHBsBEghJZ46ng z1boGBO+zFYRMAZmUo1f26mFrKHQCvISbsmf5qyXGAzxl8vrlDV5sJ9hQ efgReRx7hR5PbONoh4gCObaE+5qhpJf9Frhe2dGDm2m1q4FFtq8Uc3hhh uhi55pposEq4XIJSTYKbc6sJ1HwJl1y6k3spfUcGrV8WHKoic6YAfgKPs uWb/0tDnCYi5wRHuft/J3toO1sZuSv1sNo52MXDZLFHycJPAlcEFlNPnX Q==; X-CSE-ConnectionGUID: D/9g7I69SoCWnUiqepGPUg== X-CSE-MsgGUID: QUx1iNgUSFODar+rnHI/Fw== X-IronPort-AV: E=McAfee;i="6800,10657,11961"; a="2921389" X-IronPort-AV: E=Sophos;i="6.27,205,1787036400"; d="scan'208";a="2921389" Received: from fmviesa010.fm.intel.com ([10.60.135.150]) by orvoesa106.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 09 Nov 2026 22:43:20 -0800 X-CSE-ConnectionGUID: yDcVsbaiRKuh7qrgPUGANg== X-CSE-MsgGUID: P0oL6RCPQwa0j39SomowmA== X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="6.27,205,1787036400"; d="scan'208";a="8649313" Received: from gkldtt-dev-004.igk.intel.com (HELO localhost) ([10.123.221.202]) by smtpauth.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 09 Nov 2026 22:43:19 -0800 From: Markus Metzger To: gdb-patches@sourceware.org Subject: [PATCH v1 0/7] gdb, btrace: fix unexpected core file Date: Tue, 10 Nov 2026 07:43:09 +0100 Message-ID: <20261110064317.405487-1-markus.t.metzger@intel.com> X-Mailer: git-send-email 2.53.0 MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit X-BeenThere: gdb-patches@sourceware.org X-Mailman-Version: 2.1.30 Precedence: list List-Id: Gdb-patches mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: gdb-patches-bounces~public-inbox=simark.ca@sourceware.org When running gdb.btrace/multi-inferior.exp with extended-remote target, an unexpected core file appears in gdb.sum but not in gdb.log, due to an uncaught exception thrown by the dummy target when the remote connection is closed. The remote target iterates over all inferiors, unpushes all targets at or above the process stratum, then exits the inferior and all threads within it. This flow calls the teardown_btrace() target method, which ends up in the dummy target because the record-btrace target was unpushed. Unpushing the record-btrace target calls its close() target method when the last reference to the target is dropped. This flow also calls the teardown_btrace() target method for all non-exited threads in the current inferior. This time, however, we end up in the correct method because the record-btrace target has not been unpushed, yet. So, if there is only a single inferior, the close() target method handles the cleanup. But if there are more inferiors, it doesn't. This patch series changes the cleanup flow, thereby also simplifying it. Markus Metzger (7): gdb, btrace: add clear_btrace_resources() gdb, btrace: disable tracing in linux_btrace_target_info dtor gdb, btrace: do not use btrace_teardown() for an exited thread gdb, btrace: do not stop recording on close gdb, btrace: remove btrace_teardown() gdb, btrace: remove the teardown_btrace() target method gdb, btrace: remove the disconnect() record-btrace target method gdb/btrace.c | 13 ++++++------- gdb/btrace.h | 6 ++---- gdb/nat/linux-btrace.c | 33 ++++++++++++++------------------- gdb/nat/linux-btrace.h | 2 ++ gdb/record-btrace.c | 22 ---------------------- gdb/remote.c | 11 ----------- gdb/target-delegates-gen.c | 24 ------------------------ gdb/target.c | 8 -------- gdb/target.h | 10 ---------- gdb/thread.c | 2 +- gdb/x86-linux-nat.c | 9 --------- gdb/x86-linux-nat.h | 1 - 12 files changed, 25 insertions(+), 116 deletions(-) base-commit: 892d98146139de38662c1f5b7d48fc3a606ec3f6 -- 2.53.0 ________________________________________ Intel Deutschland GmbH Registered Address: Dornacher Strasse 1, 85622 Feldkirchen, Germany Tel: +49 (89) 99143-0 www.intel.de Managing Directors: Candice Moore, Jeffrey Schneiderman, Ramachandran Sitaraman Chairperson of the Supervisory Board: Sonja Pierer Registered Seat: Munich Commercial Register B: Amtsgericht Munich HRB 186928 This e-mail and any attachments may contain confidential material for the sole use of the intended recipient(s). Any review or distribution by others is strictly prohibited. If you are not the intended recipient, please contact the sender and delete all copies.