From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mx0b-001b2d01.pphosted.com (mx0b-001b2d01.pphosted.com [148.163.158.5]) by sourceware.org (Postfix) with ESMTPS id 749CC38518A4 for ; Wed, 23 Nov 2022 18:45:45 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.1 sourceware.org 749CC38518A4 Authentication-Results: sourceware.org; dmarc=pass (p=reject dis=none) header.from=ibm.com Authentication-Results: sourceware.org; spf=pass smtp.mailfrom=ibm.com Received: from pps.filterd (m0098417.ppops.net [127.0.0.1]) by mx0a-001b2d01.pphosted.com (8.17.1.19/8.17.1.19) with ESMTP id 2ANH6tg3030716; Wed, 23 Nov 2022 18:45:44 GMT DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=ibm.com; h=from : to : cc : subject : date : message-id : references : in-reply-to : content-type : mime-version; s=pp1; bh=x/Fv70jY6cL8O1OrpuA+9janJOp/6fNnDf7i5oIC3zw=; b=jOtCi/OZL2uvCTMHlnsix+70qPJIqztkSSaPrJckbsiOPtscL1vpmKB3xiJv+fZ71CO1 bRiVm6htRNBLmrtiQIWBEf9un7YhdTxakBRCOZF4RtETlmQCUtdSLzRANzZdNMMfQIVr k7FCA6VjtlGxTIXQMtizxcrLGXc/jymwmv/ggPctyL1O/wF376IL2OXNM6JGKE/Bz7aO 5kSBfq33EwuvANDvQD9e0X5RRfLsOQi6C5ZhtuCD/gebSLa23mcqoXYDO6pp9ZCduJPa tTFiHpD87CFt/cyBLHa77dHMxIMtfb+4qyP2Enw1YdEF2upe1mK76ko1q7UyZnwV5tSz 3w== Received: from nam04-mw2-obe.outbound.protection.outlook.com (mail-mw2nam04lp2173.outbound.protection.outlook.com [104.47.73.173]) by mx0a-001b2d01.pphosted.com (PPS) with ESMTPS id 3m0x81380d-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Wed, 23 Nov 2022 18:45:43 +0000 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=S2bvpFF/CKUi07Qm46D2ri/pIcgW+dfAG0J79onlrvSSXx7YNtxjawG7qduVWKJHjxCagfRBsJFHrmi981g90WkvrcCX9QMtTwDjH5Amgyw4rTZ8aNtTeCfkSoDxmXDkkj9XugJhQTjuH+hT0UoZrJaajM8HfoFC7zUo5d2nsaS1T4iP00uprSNmsbKB08asu9CjWwgnd4i1i8pYG7yA4nwuvq2H20DgoavDQ/yCpOfzvQR35uWUJBKquUHBOLHw9bYr9bPJEc8LU8BYvo4QWqsB4OyU7BTVWpiYLVkctWFuNtJDg/MZ+nv38Lxh7E7nA04MoJZImSEzFA8UEL5vOA== 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=x/Fv70jY6cL8O1OrpuA+9janJOp/6fNnDf7i5oIC3zw=; b=a+d+duSIdhravpJYglxQfZAZqAMJksfjVtn+jb/tPcgVFZSSLwn1wb4+NXY9w4GTohypsv57RfV6X4KKlePXQ3aqMedQtYlaPjrBQvyvgaRzKhU4baB6h20lIPtL/kF8Hw/kd6B7LDeFoDvBKiP/ZzkA+jxvegTx4zqNQ4l01BkzeOd/I7vlwLXD6YwTreMNCzs4pK7I7IHIwxq4Js7ZI37yobLAXCF9+cDBE6sWvfKaQ7ow0YStsRhUs7w35HN83+hczdI45R3TK6RpyTMq7whni6YQ4O/fbsgeBuaO2qiFKHLnk3nVyiDOZrHG3YTuYJiMjfzIu3LUNE2OOGjijQ== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=ibm.com; dmarc=pass action=none header.from=ibm.com; dkim=pass header.d=ibm.com; arc=none Received: from CH2PR15MB3544.namprd15.prod.outlook.com (2603:10b6:610:5::26) by SA1PR15MB4856.namprd15.prod.outlook.com (2603:10b6:806:1e3::6) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.5834.9; Wed, 23 Nov 2022 18:45:41 +0000 Received: from CH2PR15MB3544.namprd15.prod.outlook.com ([fe80::9c73:790a:1985:15d2]) by CH2PR15MB3544.namprd15.prod.outlook.com ([fe80::9c73:790a:1985:15d2%5]) with mapi id 15.20.5813.017; Wed, 23 Nov 2022 18:45:41 +0000 From: Aditya Kamath1 To: Ulrich Weigand , "simark@simark.ca" , "gdb-patches@sourceware.org" CC: Sangamesh Mallayya Subject: Re: [PATCH] 0001-Fix-multi-thread-debug-bug-in-AIX.patch Thread-Topic: [PATCH] 0001-Fix-multi-thread-debug-bug-in-AIX.patch Thread-Index: AQHY6DximDPpCqTL9kGyFvcEZokFBq4jlIiAgBFljYeAAA2HgIAIORaygAMrdQCACMPAdYADi8KAgAAbf+aAABUYgIAADhDt Date: Wed, 23 Nov 2022 18:45:41 +0000 Message-ID: References: <0866c91331b08f2870fad6e6a13fbcd1a9823b48.camel@de.ibm.com> <5df6ab523034d1997ffda5bb06c3bd87777dcccb.camel@de.ibm.com> <0dba07cfad3da44c0281c53702d73f807bca7d06.camel@de.ibm.com> <5956432ab1e0eedc8f65e01d3793a80ccf3a3a1f.camel@de.ibm.com> In-Reply-To: <5956432ab1e0eedc8f65e01d3793a80ccf3a3a1f.camel@de.ibm.com> Accept-Language: en-IN, en-US Content-Language: en-IN X-MS-Has-Attach: X-MS-TNEF-Correlator: msip_labels: x-ms-publictraffictype: Email x-ms-traffictypediagnostic: CH2PR15MB3544:EE_|SA1PR15MB4856:EE_ x-ms-office365-filtering-correlation-id: f8fc9d23-4d4b-4c42-1aa0-08dacd82ebf0 x-ms-exchange-senderadcheck: 1 x-ms-exchange-antispam-relay: 0 x-microsoft-antispam: BCL:0; x-microsoft-antispam-message-info: pIaXQPJRvcMkPDFZkxmpR5IGzGeepvKf5yf2fSf0hjjVv+2cfTZr3a9GaYUMXj8quRHNq+H50wSjHsm0EOMonE9cZjmhejYGFkgvcy4ylmC7x0FKp9JuGf3CgvEz4hzmARGJaNk4UslkhC3esUS9+gS9eVcHgPMvNdKe54BXxdKzOti1R6o5f3rK/ppj1vV3uPgWAR37PP95tzDU3jO00ST/0J7H3P9Q/URT6MULef4q5nlEudUmZnyNFyY7FA8/t7cPK/L0rnX0EegRHgzrUYtSWotdPoX5c9Jern7ISWzyf2odYDD677JsJJ6MjVzx/dGeeFlLgFjHfHzJCTv1S85I7olR5J6zKVH3nLkPGeGikgMQf2k+hF31LYJ+iNB9XEWnivNOfNepYEiFUUicO8GnnRgWRHRH+17DXdtr+iB90ZJQVczh9U6GnkO3LeQMRmplG1xGQ/TNK1FKd/Hu8+5JiTb0f8nllYrLH+txvKoPZQUZ2HIjt1D0/xUpvBqBsFWCvrSjtaYWyaqlvTbCzgcIkGFe+CJOcRtvevMERP1OPBTTxhV3qpYjkzdJBraYkRWTGwpG4wS7yzuYKEnd+bg4Xf2SFr4AWvdT2rHMhhdlP6cZ192Iv+8yAzpTfiYvq/BJSkye0+nedMoWXEt74b4q5isGtHgmGxagqJqHYn9O2dj4KRBNEnVX5/ptP3vOCvHQW31ldgulGaINwQurhg== x-forefront-antispam-report: CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:CH2PR15MB3544.namprd15.prod.outlook.com;PTR:;CAT:NONE;SFS:(13230022)(346002)(366004)(39860400002)(136003)(396003)(376002)(451199015)(19627405001)(86362001)(6506007)(7696005)(33656002)(38070700005)(53546011)(38100700002)(122000001)(71200400001)(66556008)(2906002)(83380400001)(8676002)(52536014)(55016003)(41300700001)(8936002)(66446008)(316002)(9686003)(186003)(66946007)(76116006)(5660300002)(4326008)(66476007)(478600001)(64756008)(110136005)(91956017);DIR:OUT;SFP:1101; x-ms-exchange-antispam-messagedata-chunkcount: 1 x-ms-exchange-antispam-messagedata-0: =?us-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QrUSLtq8NHzf6/U4vO/6s6XL4QaW0ULCy?= =?us-ascii?Q?TBTFx92lZGRlJqGZKfQiHRwVyMv52TBf79mCPgBNu6MIehBG/JOTnHDQKme1?= =?us-ascii?Q?P9SUzLfK0mOT97U6HzMYMMCWRvfrpYpk+Hp3sO8TKv9H6qc0nm+34EN8M21x?= =?us-ascii?Q?/8dqOWZ28WEoDkRRWjJsT2SuDKbRtVtnIQTGnmZRRPl6lhTnfksQrs7hYlxW?= =?us-ascii?Q?hI5OZ/4gFkrki9Pgn+EjuThRycA0IJCNJ9gStGpIJqFxsvjj7a2v7Ks5k9cC?= =?us-ascii?Q?vjXCyTfSu3sL66BoaleLnck2S1M/1q//NuzuisLLV19fMaFNAXpLN3dVI+rY?= =?us-ascii?Q?Q2bAe1xpsKQUcoyJnq66pqXosR682C7YDE1lBkGkdxr9L9+t98+RFIlKvp/H?= =?us-ascii?Q?6+H0+BSwDP15RJQEuQO3snV+IsW5TYv11VxZEHUt1+O/RNW8bhXUhucBFDNK?= =?us-ascii?Q?VNJS87pwxU6xVKRCu0jpmyb53ulc5S5Eq6nQiuURgU7Gz5Kp9/GJOAJ3Y+kd?= =?us-ascii?Q?kppCwkL3hbardX9xIZnBJECOxT6IoelqmxA2tGT9+YGczr//xuKvwz9Hw+nr?= =?us-ascii?Q?wcLjyuNXqYXDiKprelWPfeYAYtYArqj9BXhiBfM/DI+rRlCBJL1sNH8cLxEB?= =?us-ascii?Q?kZMFZ8LtIb0+V9n35GFc6wMsfDnn3r9/Y/V8mK63U6kT5Ni8MkjNBqdHBcF8?= =?us-ascii?Q?iY3H37vtWHFXYRUqEXVnR2KvJ3MMHKtPjVq8IirEpompNnGr4pBdE2CrwJZQ?= =?us-ascii?Q?uOnM2ECJGFTl9fKCHtf/dlSBCQmtWELMthj3q/2nXUOc?= Content-Type: multipart/alternative; boundary="_000_CH2PR15MB3544AB7CA50F834387522DB0D60C9CH2PR15MB3544namp_" MIME-Version: 1.0 X-OriginatorOrg: ibm.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-AuthSource: CH2PR15MB3544.namprd15.prod.outlook.com X-MS-Exchange-CrossTenant-Network-Message-Id: f8fc9d23-4d4b-4c42-1aa0-08dacd82ebf0 X-MS-Exchange-CrossTenant-originalarrivaltime: 23 Nov 2022 18:45:41.3857 (UTC) X-MS-Exchange-CrossTenant-fromentityheader: Hosted X-MS-Exchange-CrossTenant-id: fcf67057-50c9-4ad4-98f3-ffca64add9e9 X-MS-Exchange-CrossTenant-mailboxtype: HOSTED X-MS-Exchange-CrossTenant-userprincipalname: HqNA7pWqbQ8afTmZoX7mHa/+Asa9kUb3wH740qi/sZ18dGcsyUHVjJmoFydvsWy8LUhcNgkzfwtSiMbpKq/63Q== X-MS-Exchange-Transport-CrossTenantHeadersStamped: SA1PR15MB4856 X-Proofpoint-GUID: pneO0CKPeyhMZqA1wvSCeBHWLL1RPJOC X-Proofpoint-ORIG-GUID: pneO0CKPeyhMZqA1wvSCeBHWLL1RPJOC X-Proofpoint-Virus-Version: vendor=baseguard engine=ICAP:2.0.219,Aquarius:18.0.895,Hydra:6.0.545,FMLib:17.11.122.1 definitions=2022-11-23_10,2022-11-23_01,2022-06-22_01 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 impostorscore=0 adultscore=0 malwarescore=0 mlxscore=0 mlxlogscore=999 spamscore=0 phishscore=0 bulkscore=0 suspectscore=0 priorityscore=1501 clxscore=1015 lowpriorityscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.12.0-2210170000 definitions=main-2211230137 X-Spam-Status: No, score=-3.2 required=5.0 tests=BAYES_00,DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,HTML_MESSAGE,RCVD_IN_MSPIKE_H2,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 List-Id: --_000_CH2PR15MB3544AB7CA50F834387522DB0D60C9CH2PR15MB3544namp_ Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: quoted-printable Hi Ulrich, >static int >giter_count (struct thread_info *thread, void *countp) >{ > if (PD_TID (thread->ptid)) > (*(int *) countp)++; > return 0; >} >Maybe that comment is wrong about pthreaddebug not including >the main thread? Or maybe that changed between AIX versions? >In any case, something needs to be fixed here. Even if we fix it here [assuming we are succesful], in the delete_thread_1 = () in thread.c we will fail to hit thread->deletable as true while we attem= pt delete_thread (gbuf [gi]).. Because refcount will not be 0 when we attem= pt to delete main thread with ptid (pid, 0, 0). {see func below} bool thread_info::deletable () const { /* If this is the current thread, or there's code out there that relies on it existing (refcount > 0) we can't delete yet. */ return refcount () =3D=3D 0 && !is_current_thread (this); } I will be trying to replace the main thread instead like thread_change_pti= d (proc_target, gptid, pptid) subject to a condition check that gptid.tid (= ) =3D=3D 0.. Otherwise, if it is not a main thread [gptid.tid () !=3D 0], w= e can delete gbuf[gi].. We can apply this else where as well in sync_thread= lists (). Let me know if we have an alternate optimal option that can delete this thr= ead or why the solution in the above paragraph can fail.. Rest of the things I will handle. No problem. Thanks and regards, Aditya.. ________________________________ From: Ulrich Weigand Sent: 23 November 2022 22:39 To: simark@simark.ca ; Aditya Kamath1 ; gdb-patches@sourceware.org Cc: Sangamesh Mallayya Subject: Re: [PATCH] 0001-Fix-multi-thread-debug-bug-in-AIX.patch Aditya Kamath1 wrote: >Hmm. So, something is going wrong here.. >gcount =3D 0; > iterate_over_threads (giter_count, &gcount); > g =3D gbuf =3D XNEWVEC (struct thread_info *, gcount); > iterate_over_threads (giter_accum, &g); > qsort (gbuf, gcount, sizeof *gbuf, gcmp); Looks like this is deliberate: /* iterate_over_threads() callback for counting GDB threads. Do not count the main thread (whose tid is zero). This matches the list of threads provided by the pthreaddebug library, which does not include that main thread either, and thus allows us to compare the two lists. */ static int giter_count (struct thread_info *thread, void *countp) { if (PD_TID (thread->ptid)) (*(int *) countp)++; return 0; } Maybe that comment is wrong about pthreaddebug not including the main thread? Or maybe that changed between AIX versions? In any case, something needs to be fixed here. Bye, Ulrich --_000_CH2PR15MB3544AB7CA50F834387522DB0D60C9CH2PR15MB3544namp_--