From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from EUR06-DB8-obe.outbound.protection.outlook.com (mail-db8eur06olkn2034.outbound.protection.outlook.com [40.92.51.34]) by sourceware.org (Postfix) with ESMTPS id 6F07E3985837 for ; Tue, 15 Jun 2021 05:14:32 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.1 sourceware.org 6F07E3985837 Authentication-Results: sourceware.org; dmarc=none (p=none dis=none) header.from=hotmail.de Authentication-Results: sourceware.org; spf=pass smtp.mailfrom=hotmail.de ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=a6CJOTrqDtM+/DIN4yCeLU4by/G/WJaARDa6aZzQf+sJqjgvCGLOhejmriU8GMG8XgLkpjvEKUTwlQpfLd+ReTuLdqXeFsPRT0saJ8P0qK+qNfQ/t04440yjy77StJHTdOkTUcEgNuen4wxh7HRBaYmsKhgDiKR57SbanvSEV2+tGBOKPIjsx9AZbeSn549CTOeNMeJTIEcHzfdNQl9ft1MFgi2QsgyZGJz7RpTOTxmtbTcAA6cZgX/4SqxCJciy8d/zxnrMmSAWoJPRqB/5oZDuCn1ASasp2SeVE7E2ZxxDRc7OqqgWfx2dzNYnxW/msv59N4USVgKuSr7TFDPwDA== 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-SenderADCheck; bh=jIYA5fc/TZFz9eB8j8Fn15VtzSaUlvhGPIRjaJ7G7Xk=; b=g2m5pQQMtngKDwedzGo8xtQYLYMnZ8eYVb6ww8hOpmF74FT4rivzS3xgiHQlxT1NFdbwM6/48d7nrHM/eKuf+Exncpi2pdEUl8sd/DHVjxZBxWrF3BpEZV7Z6GnNTonNabgeyR473RFIw5l8LXxzdPemsyqx8dgsxtPr1OLYXTaw6QolUw3q+rk/iAGcFAxzIJZRYt2r8scXwx8G4wepO0hRWjFk/cvV6VRvigMA19c25/PPEgHU7xbXlUwRpKnoDfrmjIaOqfIL7zpern67nOQ+Lq6Twi3Wk05rnZfVgRpLIWtagmyPS+CcZ0UhsHat9BWqMIfGqX9JIrfRTI/neA== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=none; dmarc=none; dkim=none; arc=none Received: from DB8EUR06FT066.eop-eur06.prod.protection.outlook.com (2a01:111:e400:fc35::4e) by DB8EUR06HT170.eop-eur06.prod.protection.outlook.com (2a01:111:e400:fc35::63) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4219.21; Tue, 15 Jun 2021 05:14:31 +0000 Received: from AS8PR10MB4712.EURPRD10.PROD.OUTLOOK.COM (2a01:111:e400:fc35::4a) by DB8EUR06FT066.mail.protection.outlook.com (2a01:111:e400:fc35::476) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4219.21 via Frontend Transport; Tue, 15 Jun 2021 05:14:31 +0000 X-IncomingTopHeaderMarker: OriginalChecksum:F9194076CEDA0016C2EB60F51A7A1E2B409737A68235A4975EDDA676BED6EBE0; UpperCasedChecksum:56C7C616F6CB2DAD2F76C74D4B55163BC2C7334A7C0BCC04995C5142C2528086; SizeAsReceived:9014; Count:48 Received: from AS8PR10MB4712.EURPRD10.PROD.OUTLOOK.COM ([fe80::844c:ffa:7f96:bdc8]) by AS8PR10MB4712.EURPRD10.PROD.OUTLOOK.COM ([fe80::844c:ffa:7f96:bdc8%5]) with mapi id 15.20.4219.025; Tue, 15 Jun 2021 05:14:31 +0000 Subject: Re: [PATCH] Fix gdb crash due to SIGPIPE when the compile command fails To: Pedro Alves , Tom Tromey Cc: "gdb-patches@sourceware.org" References: <87tumgp1ob.fsf@tromey.com> <87zgw5oijf.fsf@tromey.com> <6256676d-b41a-02ef-22a4-e5150077c0e8@palves.net> From: Bernd Edlinger Message-ID: Date: Tue, 15 Jun 2021 07:14:29 +0200 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:60.0) Gecko/20100101 Thunderbird/60.6.1 In-Reply-To: <6256676d-b41a-02ef-22a4-e5150077c0e8@palves.net> Content-Type: text/plain; charset=utf-8 Content-Language: en-US Content-Transfer-Encoding: 7bit X-TMN: [RCdNRmnkD/qvXn3OZwH3RYM7pt95PFqO] X-ClientProxiedBy: FR2P281CA0011.DEUP281.PROD.OUTLOOK.COM (2603:10a6:d10:a::21) To AS8PR10MB4712.EURPRD10.PROD.OUTLOOK.COM (2603:10a6:20b:31d::16) X-Microsoft-Original-Message-ID: <54585a92-4c13-776a-7e7d-ba2c60f4cab5@hotmail.de> MIME-Version: 1.0 X-MS-Exchange-MessageSentRepresentingType: 1 Received: from [192.168.1.101] (92.211.178.34) by FR2P281CA0011.DEUP281.PROD.OUTLOOK.COM (2603:10a6:d10:a::21) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4242.9 via Frontend Transport; Tue, 15 Jun 2021 05:14:30 +0000 X-MS-PublicTrafficType: Email X-IncomingHeaderCount: 48 X-EOPAttributedMessage: 0 X-MS-Office365-Filtering-Correlation-Id: 36b553e4-0c43-4af7-0d96-08d92fbc74d8 X-MS-TrafficTypeDiagnostic: DB8EUR06HT170: X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: +SNtxuVBZV/e6YEv9YkK1xY9D/hyXh053Ryh5JGPajdSJyQuJqrZ8W4anf3W0qOZlQKkcnNKBEk0Mg+/JsbijwmXMLXZBN7Wc+9p/9igoLKnKe+/Ebr/LrjA24mg3VbBlRZlCw+k8b2J9dacGpyBcinaBPKdGez/pfs5VWrqtlH+Mwfb5FOltSsQ5h/EBNwIpUKxAL5zmo5PHL7uu3HBvn+Wl0aE8QRl1TdxZ2fK4t6ZRjg37Hnv2NvqgxspAO3lxnF16PTTDlPqn1eLVQ7Yi4ZKdk0GTnwM+NTA6rXBRcsby6MniEcNqjA7otYVCz6hQh7G0ItcRoN6TV5xRyubTrA9TgoOOEnjGZEwj002gGgr21Vb7cBJk+/YuKPM3OjqRvrmKufrzVswN1N+RAhOXg== X-MS-Exchange-AntiSpam-MessageData: cKgcZBPCNzkUZLPE07gF/7N319ISxao8ZwsQQsyexVt0QUqnu7GY3zOgXbt/KriElc9hBfHbNChKTAlvvi6g++4Ov6fmXxQFGfHts+i/YxS4U6dZNB7Z9d64SP+aV5RXfjU0kwsM7qWitwy90T5CnQ== X-OriginatorOrg: outlook.com X-MS-Exchange-CrossTenant-Network-Message-Id: 36b553e4-0c43-4af7-0d96-08d92fbc74d8 X-MS-Exchange-CrossTenant-OriginalArrivalTime: 15 Jun 2021 05:14:31.3385 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: 84df9e7f-e9f6-40af-b435-aaaaaaaaaaaa X-MS-Exchange-CrossTenant-AuthSource: DB8EUR06FT066.eop-eur06.prod.protection.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: Internet X-MS-Exchange-CrossTenant-RMS-PersistedConsumerOrg: 00000000-0000-0000-0000-000000000000 X-MS-Exchange-Transport-CrossTenantHeadersStamped: DB8EUR06HT170 X-Spam-Status: No, score=-2.6 required=5.0 tests=BAYES_00, FORGED_MUA_MOZILLA, FREEMAIL_FROM, KAM_DMARC_STATUS, MSGID_FROM_MTA_HEADER, NICE_REPLY_A, RCVD_IN_DNSWL_NONE, RCVD_IN_MSPIKE_H2, SPF_HELO_PASS, SPF_PASS, TXREP autolearn=no autolearn_force=no version=3.4.2 X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on server2.sourceware.org X-BeenThere: gdb-patches@sourceware.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Gdb-patches mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 15 Jun 2021 05:14:34 -0000 On 6/15/21 1:35 AM, Pedro Alves wrote: > On 2021-06-04 2:39 p.m., Tom Tromey wrote: >>>>>>> "Bernd" == Bernd Edlinger writes: >> >> Bernd> I believe it is right to avoid the SIGPIPE before calling the plugin, >> Bernd> instead of doing that in gcc-trunk, since we don't know which version >> Bernd> we will be calling, and all versions I tried have failed like this. >> >> That seems fine, but I think it would be better to install the handler >> just when working with the plugin, and then uninstall it afterward, sort >> of like what class scoped_ignore_sigttou does. > > One thing I dislike here (and also about scoped_ignore_sigttou), is that the > signal disposition is process-wide. > > If we happen to have multiple threads that need to ignore the signal changing the > disposition like that, then they may race. > > We can fix that by making the ignoring be per-thread instead by using > sigprocmask + sigtimedwait. > > We can also introduce a generic scoped_ignore_signal so that both scoped_ignore_sigttou > and scoped_ignore_pipe (and whatever other similar signal we may need to ignore) share > the same code. > > I gave it a quick try. See the 4 patches at the top of the > users/palves/scoped_ignore_signal branch. > > This was something that I've thought before about doing for SIGTTOU to be honest. > Seeing it being copied over to SIGPIPE was simply the trigger that made me > actually give it a try. > > WDYT? > +1 Thanks Bernd. > Pedro Alves >