From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from simark.ca by simark.ca with LMTP id uLaGGd2cAmZZrxYAWB0awg (envelope-from ) for ; Tue, 26 Mar 2024 06:01:01 -0400 Authentication-Results: simark.ca; dkim=pass (2048-bit key; unprotected) header.d=oracle.com header.i=@oracle.com header.a=rsa-sha256 header.s=corp-2023-11-20 header.b=fxNghUwY; dkim=pass (1024-bit key; unprotected) header.d=oracle.onmicrosoft.com header.i=@oracle.onmicrosoft.com header.a=rsa-sha256 header.s=selector2-oracle-onmicrosoft-com header.b=PNp3xe5s; dkim-atps=neutral Received: by simark.ca (Postfix, from userid 112) id 61B351E0C0; Tue, 26 Mar 2024 06:01:01 -0400 (EDT) Received: from server2.sourceware.org (server2.sourceware.org [8.43.85.97]) (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 399F61E030 for ; Tue, 26 Mar 2024 06:00:59 -0400 (EDT) Received: from server2.sourceware.org (localhost [IPv6:::1]) by sourceware.org (Postfix) with ESMTP id B39303858035 for ; Tue, 26 Mar 2024 10:00:58 +0000 (GMT) Received: from mx0a-00069f02.pphosted.com (mx0a-00069f02.pphosted.com [205.220.165.32]) by sourceware.org (Postfix) with ESMTPS id 934543858287 for ; Tue, 26 Mar 2024 09:59:48 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org 934543858287 Authentication-Results: sourceware.org; dmarc=pass (p=none dis=none) header.from=oracle.com Authentication-Results: sourceware.org; spf=pass smtp.mailfrom=oracle.com ARC-Filter: OpenARC Filter v1.0.0 sourceware.org 934543858287 Authentication-Results: server2.sourceware.org; arc=pass smtp.remote-ip=205.220.165.32 ARC-Seal: i=2; a=rsa-sha256; d=sourceware.org; s=key; t=1711447191; cv=pass; b=tv7pgiz8cqyHDra7p/Jj8CP9BXq2Qn8HG5irxc4XwFKXILNfgyDbVlFCQdX79uhiqVFYgqMH9HAPX1i9xAgfiVHGlppyvX4+sk310a7KBroh/RmFJaXMs4RoBPsM3VPeX6+c3tBQFXjM1iz9MuVI/MRVsmq6ZLYKvked62HpxOg= ARC-Message-Signature: i=2; a=rsa-sha256; d=sourceware.org; s=key; t=1711447191; c=relaxed/simple; bh=Es9LT9QZLbn0YYX0qxA2QOlqmZKrLkIcaO7IywYApCc=; h=DKIM-Signature:DKIM-Signature:Message-ID:Date:Subject:From:To: MIME-Version; b=k8p4fbWqzxOzeU3bj3+ByXlrLaeFva+T9X7HTq00qFd6KkUA5vMx+ZIVN+FJPizwMCJNYsu8XDBYfLzuFZuCzENH9M6neH1INSWU7aGW1gfk+TelJ4Uj1Sc7nW3QfLfxU6lVAZh9FKlIu9KKDCcqZovRKic2gMV85GlggQUwRkA= ARC-Authentication-Results: i=2; server2.sourceware.org Received: from pps.filterd (m0246627.ppops.net [127.0.0.1]) by mx0b-00069f02.pphosted.com (8.17.1.19/8.17.1.19) with ESMTP id 42Q8oGrs013237; Tue, 26 Mar 2024 09:59:45 GMT DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=oracle.com; h=message-id : date : subject : from : to : references : in-reply-to : content-type : content-transfer-encoding : mime-version; s=corp-2023-11-20; bh=FyjbRZGocDTufvRx+Xr1XPDha4DILkGAFL0gd6DQKiU=; b=fxNghUwYxsIzQuntEMQSO1TAU3wSeJhEL+pB8Nn/il9yE5IITcqKtN4qn/umRk8MA8pg Nm3vxthtyyHLzmUNgVpLXP78SeVzLrYF8yDFc6k4wfJXu2o2rT2v7A1Zdv/eQvdERWpD yIoARvkNkYwKkClrnX1mIvh3HYvdJeQZaNOtRip5QAsV5eDVy0JbIQUd0CDjpzruTrRB hIkUokTYjeMP3fee4R4dVLUmi9yaWhSeOsOo4HL3+7AcrDkOA9cVLuQvNHra4pOP4zjg rY+iDipuUsTdET/x5ValU2TS7yq4URfIXfrMqmKcNSTOlTa2lz1CsaVcA8WXBSyNqqAm 5Q== Received: from phxpaimrmta03.imrmtpd1.prodappphxaev1.oraclevcn.com (phxpaimrmta03.appoci.oracle.com [138.1.37.129]) by mx0b-00069f02.pphosted.com (PPS) with ESMTPS id 3x1np2cnru-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Tue, 26 Mar 2024 09:59:45 +0000 Received: from pps.filterd (phxpaimrmta03.imrmtpd1.prodappphxaev1.oraclevcn.com [127.0.0.1]) by phxpaimrmta03.imrmtpd1.prodappphxaev1.oraclevcn.com (8.17.1.19/8.17.1.19) with ESMTP id 42Q92KQP010609; Tue, 26 Mar 2024 09:59:44 GMT Received: from nam04-mw2-obe.outbound.protection.outlook.com (mail-mw2nam04lp2168.outbound.protection.outlook.com [104.47.73.168]) by phxpaimrmta03.imrmtpd1.prodappphxaev1.oraclevcn.com (PPS) with ESMTPS id 3x1nh6x6ys-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Tue, 26 Mar 2024 09:59:44 +0000 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=MdlN3DQE2P5nKSuBf76I5+ocXuqwJHZbWI4X9mPAZTzmMbt4XvJ38H/oYmZlXjKRTqeeZBWr/2gOSzjDaUSUtOruy435p+cBE7TaLtbZmk112olwsPRUIXNnLsZ8VJ6oEbDBAPPsP/zSjxwrGPTV2wvkikAtgRj41yXCdNzENWgU5AWjJdJXrnM7UyK/JwtMsf/bvH8SOIgoRXkgh12vJMSbKK1euPb9zhBFiBhuEFF2K8FbnfQUHFYoiJ5TlQicvYqLHzJiDHwgNUrzp+8V0JB6n1IAlvo9Ze2G0Af43LKl4YN/xpZR0kDss/rU9vCPWSHgmdyyZOnP6mSza5PvtA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1; bh=FyjbRZGocDTufvRx+Xr1XPDha4DILkGAFL0gd6DQKiU=; b=JrD3bhJyB8BZtCPotUjYiTL7V5dvrJT4VcHtI6RYpijRmQTGibJykken5lWrDZzcrWdGo66t4vi0l1Nplz5AYyAUp/giWteakh8+143QQ8Ob6fnRU5wF4wyq9/eHJtqhqWl+l43IbWQZHVorSYWlxU2tQgTklzGtJlMv3qBo+XOyuDIArFvnLmnDKWkrJevqUYmJYlF5ffDz1oiXT+j6XAbfwSPG2OdTUKi4F8Mw3n2epD1KIcuqD5l8zzvbs4gYP92h/fJSBTCG76zUs8Zt5jZtWVWkvoHKsC3TOqqV+l8Yzlh7pcobZXSg1HabIv77YhG97HwSQBBH6th9IZdvqg== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=oracle.com; dmarc=pass action=none header.from=oracle.com; dkim=pass header.d=oracle.com; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=oracle.onmicrosoft.com; s=selector2-oracle-onmicrosoft-com; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=FyjbRZGocDTufvRx+Xr1XPDha4DILkGAFL0gd6DQKiU=; b=PNp3xe5sLqxh8aM1r1Xg8xKrGDwUg40Encz0DulDj15ERjP4Frud5rvA+lVFHNMRmEvvxZ2qN38N+D9c1wxa0hJPduar4tjTfdxCZl1NnkROJ333lYJ2F6VXmJBik2H6trGqyt+K7XpMCf9bhebJSPSqYbxyPwXzNL3WQnyLV1E= Received: from DS7PR10MB4861.namprd10.prod.outlook.com (2603:10b6:5:3a7::15) by CH3PR10MB6833.namprd10.prod.outlook.com (2603:10b6:610:150::8) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7409.33; Tue, 26 Mar 2024 09:59:42 +0000 Received: from DS7PR10MB4861.namprd10.prod.outlook.com ([fe80::b9dd:a307:6417:4fa6]) by DS7PR10MB4861.namprd10.prod.outlook.com ([fe80::b9dd:a307:6417:4fa6%4]) with mapi id 15.20.7409.031; Tue, 26 Mar 2024 09:59:42 +0000 Message-ID: Date: Tue, 26 Mar 2024 15:29:37 +0530 User-Agent: Mozilla Thunderbird Subject: Re: [External] : Re: [PATCH v4] gdb : Signal to pstack/gdb kills the attached process. Content-Language: en-US From: Partha Satapathy To: Guinevere Larsen , gdb-patches@sourceware.org, bert.barbe@oracle.com, rajesh.sivaramasubramaniom@oracle.com References: <123ee8d6-e6da-4227-ac7a-27d22041c20e@oracle.com> <1018173c-5fff-4430-8db1-44b542a64cd2@redhat.com> <5dc1b891-943a-4f28-b75f-cc4a4f99ea0c@oracle.com> Organization: Oracle Corporation In-Reply-To: <5dc1b891-943a-4f28-b75f-cc4a4f99ea0c@oracle.com> Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 8bit X-ClientProxiedBy: SG2PR01CA0122.apcprd01.prod.exchangelabs.com (2603:1096:4:40::26) To DS7PR10MB4861.namprd10.prod.outlook.com (2603:10b6:5:3a7::15) MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: DS7PR10MB4861:EE_|CH3PR10MB6833:EE_ X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: 7Kv+3+B1gWPcuQRc+i/mPwkK/932Tr9vYyKeORnBPL816fZaWnkZu/BWFvF5u1PYZFn3W24MF4c9rekZhox84yMOTq9rxsPlgIlE5XI6nBNOZG8ZogUhZSMPSurH9QsGyNfHAPStLp53i84IFGcCFEO3xW2j/3BdyIAfjygQ0ZGyhkBfxq8QZV+I7uYnHHU7jCMXM23TgxcayWYmOmSNITrIAiGEunOxQly1KpNty8Vjkm//gNkMfJKfcEva7judwCvTiMrfsz8tXWRJEQesCFmRhjpjvcgngyXgkSJAOg4NTop0OVdZmKS5mJvIrFNgwkhtCaK7IMVidvsBF4QrY6Qle0k+mpf5Yp9bBYUqjQKzngyaC35IFK+06LSaIvVYO84l7PGiC2eLjLAgiSLRdMjYtkNSstDPau4124CYIYRYdDidAKnsQCEvPZ6VfVtBP71LBLua1FKk9FMOqvbaSQDtiPbnMBDdbdpXVdcF/16cy22ii0h+9hIUNRZM144iJh93+a8aHl/iuOU2iKVZZ2zM7yzsf+SJD0BHO4OK4jZFq2KUpI5VU2BaUzx4DKlsaey4KzwfXpvFFMPbU7LYk7YqjeiPm7UeTsCoZCM0noYS49OaJ6sbHp4eYx/EI0uz1vhTyJ0yvZfrLM429cKIS/d0Z3H7aa/6Xt16y1NIdpo= X-Forefront-Antispam-Report: CIP:255.255.255.255; CTRY:; LANG:en; SCL:1; SRV:; IPV:NLI; SFV:NSPM; H:DS7PR10MB4861.namprd10.prod.outlook.com; PTR:; CAT:NONE; SFS:(13230031)(366007)(1800799015)(376005); DIR:OUT; SFP:1102; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: =?utf-8?B?TkN5QVFFbGdydjl1bm9JSmVLRXdtUitocWxOUVVsSFh3eGhGQ3RCTEJ1ekhR?= =?utf-8?B?NlRxQ3Q0RUpkSkNQOHViMDhsZU13RlE3OEM5YXpaTWFWTmQ5bThLZkpVZW8r?= =?utf-8?B?UklqdHhrV2kwZmxwL2trT1htbmVjNGZKOEpzVy8rN2JEY3lCaW9RWndjWUlC?= =?utf-8?B?Z1h2dFZWSnpFK1ZjeVRhRFYxT093WXc5Tm12MWFtb2NDVUxjeHNqNS9EK1kx?= =?utf-8?B?Tm53MEkyc29nOTNPNi8xbk5SdkUreUluSmd3TU1xL0U2Z1QyQnF1SGhsUG9J?= =?utf-8?B?V2NxSU14Y28xUWZ1MEYxM0xUWEwxL3VldjlRQ2FFTEFtVU8rMVBRdTdYVmtQ?= =?utf-8?B?aXB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4OXlxMGZhYlhRWUlXeUduMElpVWgwZUJG?= =?utf-8?B?eWc9PQ==?= X-MS-Exchange-AntiSpam-ExternalHop-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-ExternalHop-MessageData-0: 75Rx0b825FU04ZfAJv2nqLwWKSmssHfvUUrBswNS+d1qJ+kk3WcBXHQJ4WDLu8OJLogTtY6Em9x7nSp5f5lwIgCiVTZhWiW7MmxXK66rju7tcjx+wVwm8C1BYezv+XPoiCulzc0Ut11PEWNeCtw4x//R6/CGTM6FXGNPk+CBhTYbkMGSQozkCbYrfHp7n9KUYZShZhisPWSPNmBKZ6xQ7ZePQjhaWRm7Vo7TnlSjxIJmYb14lw6Delhju0SGDcu66Akt+GqDjtyWzx0kFexyLPY7CmhJfflQfEkodxdkpn6QwtRzcdzf0rbR6wYYTZPXKFDEOb3gA02VB4s/pjd7goaDYpH/fQM3wt7y0Csce263hiVu4NHc6RglFg/xJWHXD6M+4GlDYeHkjtiPEJ4nyubGNUivYhUasAG7kkzIRTljBhxNQBr7Mz6q/ozxROEqqqGWxNAytTvAsa3d5cJ4aCO0lJ/oNdewjn4WRh6RKrXa1B26Pa6fndDw4GNzH45UsvRV8u/KfKuwRQb2sHn0vZHvxoZYKLC7RBmSWDJXlE1niVVX0HtWWL4n0TLbJyWu5EM8VgM4v7AvCUvj6yMr1xnrglOcxMz2lbNcHVcrAgg= X-OriginatorOrg: oracle.com X-MS-Exchange-CrossTenant-Network-Message-Id: 9de92475-5f20-4ed9-3465-08dc4d7b7538 X-MS-Exchange-CrossTenant-AuthSource: DS7PR10MB4861.namprd10.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 26 Mar 2024 09:59:42.5959 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: 4e2c6054-71cb-48f1-bd6c-3a9705aca71b X-MS-Exchange-CrossTenant-MailboxType: HOSTED X-MS-Exchange-CrossTenant-UserPrincipalName: iMnBaT4Q6C8aaldmVeLLSf7PDEJgUIOLqP13XVYHMaABxApNhhC1czomJEyNeJmnfv77WLtXPfIAlKGsBE7yk3hOUXCciW4gkhy6r+KJ1vk= X-MS-Exchange-Transport-CrossTenantHeadersStamped: CH3PR10MB6833 X-Proofpoint-Virus-Version: vendor=baseguard engine=ICAP:2.0.272,Aquarius:18.0.1011,Hydra:6.0.619,FMLib:17.11.176.26 definitions=2024-03-26_04,2024-03-21_02,2023-05-22_02 X-Proofpoint-Spam-Details: rule=notspam policy=default score=0 mlxlogscore=999 phishscore=0 bulkscore=0 spamscore=0 adultscore=0 mlxscore=0 suspectscore=0 malwarescore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.12.0-2403210000 definitions=main-2403260067 X-Proofpoint-GUID: 2S4OxGu2KtsE1NW1QlbZsnMLLA1XEQ0A X-Proofpoint-ORIG-GUID: 2S4OxGu2KtsE1NW1QlbZsnMLLA1XEQ0A X-Spam-Status: No, score=-12.3 required=5.0 tests=BAYES_00, BODY_8BITS, DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, DKIM_VALID_EF, GIT_PATCH_0, RCVD_IN_MSPIKE_H4, RCVD_IN_MSPIKE_WL, SPF_HELO_NONE, SPF_NONE, TXREP autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on server2.sourceware.org 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 On 3/7/2024 3:28 PM, Partha Satapathy wrote: > Author: Partha Sarathi Satapathy > Date:   Fri Nov 17 09:18:56 2023 +0000 > > gdb : Signal to pstack/gdb kills the attached process. > > Problem: While gdb is attaching an inferior, if ctrl-c is pressed in the > middle of the process attach,  the sigint is passed to the debugged > process. This triggers the exit of the inferior. For example in pstack, > printing a stack can take significant time, and ctrl-c is pressed to > abort the pstack/gdb application. This in turn kills the debugged > process, which can be critical for the system. In this case, the > intention of ctrl+c is to kill pstack/gdb, but not the inferior > application. > gdb -p <> > or gdb /proc/<>/exe pid > Attaching to process > << ctrl+c is pressed during attach > (gdb) q > <<<< inferior process exited >>>> > > A Ctrl-C/sigint received by gdb during the attachment of an inferior > passed to the debugged at some definite points during the window of > process attachment. The process of attaching an inferior is a multistep > process, and it takes time to get ready with the GDB prompt. As the > debugger and debugger are not fully attached during this period, the > sigint takes its default action to terminate the process. > > Solution: While GDB attaches processes, the inferior is not the current > session leader. Hence, until attach is complete and the GDB prompt is > available, the sigint should not be passed to the inferior. > The signal should be skipped if the process runs in the background. With > this approach, we can skip passing the signature if the process is > attached to the GDB and the process attach is not complete. > > Reviewed-By: Guinevere Larsen > --- >  gdb/infcmd.c   | 2 ++ >  gdb/inferior.h | 3 +++ >  gdb/target.c   | 3 +++ >  3 files changed, 8 insertions(+) > > diff --git a/gdb/infcmd.c b/gdb/infcmd.c > index c1fdbb300c67..8ab2d50477f4 100644 > --- a/gdb/infcmd.c > +++ b/gdb/infcmd.c > @@ -2528,6 +2528,8 @@ enum async_reply_reason >    target_post_attach (inferior_ptid.pid ()); > >    post_create_inferior (from_tty); > +  current_inferior ()->sync_flag = true; > +  check_quit_flag(); >  } > >  /* What to do after the first program stops after attaching.  */ > diff --git a/gdb/inferior.h b/gdb/inferior.h > index 7be28423aeb1..a6065da19a87 100644 > --- a/gdb/inferior.h > +++ b/gdb/inferior.h > @@ -600,6 +600,9 @@ class inferior : public refcounted_object, >    /* True if this child process was attached rather than forked.  */ >    bool attach_flag = false; > > +  /* True if inferior has been fully synced and prompt is no longer > blocked */ > +  bool sync_flag = false; > + >    /* If this inferior is a vfork child, then this is the pointer to >       its vfork parent, if GDB is still attached to it.  */ >    inferior *vfork_parent = NULL; > diff --git a/gdb/target.c b/gdb/target.c > index bbc1badc9e19..7c7df9c2ed87 100644 > --- a/gdb/target.c > +++ b/gdb/target.c > @@ -3794,6 +3794,9 @@ struct target_ops * >                  through the target_stack.  */ >               scoped_restore_current_inferior restore_inferior; >               set_current_inferior (inf); > +             if ((current_inferior ()->attach_flag) > +               && !(current_inferior ()->sync_flag)) > +                 return; >               current_inferior ()->top_target ()->pass_ctrlc (); >               return; >             } Hi Team, Can we have further proceedings on this. Thanks Partha