From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from EUR06-VI1-obe.outbound.protection.outlook.com (mail-vi1eur06olkn2109.outbound.protection.outlook.com [40.92.17.109]) by sourceware.org (Postfix) with ESMTPS id 5A8C63844019 for ; Wed, 2 Jun 2021 17:31:39 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.1 sourceware.org 5A8C63844019 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=Z1xAJjQiueuRLSGPwA9Mk7az+6IjjmsoNOmTUlwRzR5JKalsJmi2AGbKs2CpCVFs71VQtd+HFQLs7lPTkhvxlrEVO5Gv2s/KPJR48VEtk2ygZPc2dWQlsPnAqObVq34sDTNm8VIO/HTSVJi1dOI57vr66OANeM/2T2RNdx4SeEdv4tZrYL7nTXrZlXxAwQDVhwmeJjSphocnE0zJ3991nxlIzOhDBica3DvOocR75nR8uz04bYqH6cFk23XNVgF23AVIAJu9ulcx5h0ppttXs/W0s9gByilGOZjG2GSWMIK6PaZZlC1AvnrB5mDkSXwlJuPEGfmCc8rGRU3AJS6mGA== 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=VNm4VyuWPmE4H11Ds2b1MTkdIb9zDJwzEY2pT0D067s=; b=P4krjhcj9wAQL3OTKy2rzltv+cYtEfGOR2gybxMYkEjv3T9kizVBB0s1yVEmlk5uxQov+QxtudE+EI5HiJ/0KUHTYPDD2wnXqmWDoqOPo5jrdhwDHca6n/1geIaIgGHflGP9krQ4B9HPW9WvymtbLzoA4ei4aXc1daxmhYHGROX45Z3MDc6RbO0QV0HIvt2qYo+D8O3ELUjH/2lh4VcSQTjlbsk93qbEsK//LapK4K/0xvBrymRYAQQAv8lM/4vlOiMi/AZV+JCIBOvTeCtgRaf1RZIquTErlaubLSbiABHwe8eWZzjNC0SN1pELZfD0p1fRpcCjx/SBKICIsqzOog== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=none; dmarc=none; dkim=none; arc=none Received: from DB8EUR06FT028.eop-eur06.prod.protection.outlook.com (2a01:111:e400:fc35::4e) by DB8EUR06HT200.eop-eur06.prod.protection.outlook.com (2a01:111:e400:fc35::353) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4150.30; Wed, 2 Jun 2021 17:31:37 +0000 Received: from AM8PR10MB4708.EURPRD10.PROD.OUTLOOK.COM (2a01:111:e400:fc35::4f) by DB8EUR06FT028.mail.protection.outlook.com (2a01:111:e400:fc35::253) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4195.18 via Frontend Transport; Wed, 2 Jun 2021 17:31:37 +0000 X-IncomingTopHeaderMarker: OriginalChecksum:668CC256AAAE0049897AD7EDD7805F3D227B89FE554015E74F99ABA0A63856BE; UpperCasedChecksum:2C2A8A585852B2C0B02416DDF803D99A4409259D641B722D27AB905BF44181B9; SizeAsReceived:7662; Count:45 Received: from AM8PR10MB4708.EURPRD10.PROD.OUTLOOK.COM ([fe80::ad12:6a2c:b949:f65d]) by AM8PR10MB4708.EURPRD10.PROD.OUTLOOK.COM ([fe80::ad12:6a2c:b949:f65d%5]) with mapi id 15.20.4195.020; Wed, 2 Jun 2021 17:31:37 +0000 To: "gdb-patches@sourceware.org" From: Bernd Edlinger Subject: [PATCH] Fix gdb crash due to SIGPIPE when the compile command fails Message-ID: Date: Wed, 2 Jun 2021 19:31:35 +0200 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:60.0) Gecko/20100101 Thunderbird/60.6.1 Content-Type: text/plain; charset=windows-1252 Content-Language: en-US Content-Transfer-Encoding: 7bit X-TMN: [+G+W8uUgo0egQAlELxuZLJui5XqGk9Hi] X-ClientProxiedBy: PR0P264CA0102.FRAP264.PROD.OUTLOOK.COM (2603:10a6:100:19::18) To AM8PR10MB4708.EURPRD10.PROD.OUTLOOK.COM (2603:10a6:20b:364::23) X-Microsoft-Original-Message-ID: MIME-Version: 1.0 X-MS-Exchange-MessageSentRepresentingType: 1 Received: from [192.168.1.101] (84.57.61.94) by PR0P264CA0102.FRAP264.PROD.OUTLOOK.COM (2603:10a6:100:19::18) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4195.15 via Frontend Transport; Wed, 2 Jun 2021 17:31:36 +0000 X-MS-PublicTrafficType: Email X-IncomingHeaderCount: 45 X-EOPAttributedMessage: 0 X-MS-Office365-Filtering-Correlation-Id: bf67b579-c900-4f10-d968-08d925ec4638 X-MS-TrafficTypeDiagnostic: DB8EUR06HT200: X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: 5eabXImqzlYWWWJlwV/28h2lt9nz+9JipT/0q9MkgrxBG7jo1xN0L0wrGQ5Te078H3z2y+hBcPLqdLABMBJuzC5mSZYtbfJNwE6EMJmBkOHUqdz77B04yLZnFAbTMSANq4NVXwJ3Ll5BhmdXaqBGq5tFIWfKFwfAk6AaONU4kEXkttaATwOF/o9nPevjQsBxLd6m6IAThVdftjGp9c+By0UbVpWo8KBGNZWkLzeNLuUt5LlkWMrlpjwwRr+FmbVPONWiuv7eut4oT6YyrwCWSa7YU/ykKW0vlywc1r6tjzhNLOIr4XODm02MgWNIUL+dNvESdVSzF/V9EJgn8C8ixQoh4fi6ZWhB5jOMneE0948aFx0IkkRMOVVROKxR9Pz2tqpD027H4mwNfs9KWYmPKw== X-MS-Exchange-AntiSpam-MessageData: TtCp1/UIXeGm+vVR7+VVgKS++9XmL4wpmlCzGIwZEb8aYfP/SqyHCJXHffbtqIrDu0LPvAaVlIQ/855AfoNUNwUaOjhD59182ul1WZUcd7+9chPmHYZO/LW+fTFPHa9XUFg/w8IwDcG4xzhcxZWLCg== X-OriginatorOrg: outlook.com X-MS-Exchange-CrossTenant-Network-Message-Id: bf67b579-c900-4f10-d968-08d925ec4638 X-MS-Exchange-CrossTenant-OriginalArrivalTime: 02 Jun 2021 17:31:37.3233 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: 84df9e7f-e9f6-40af-b435-aaaaaaaaaaaa X-MS-Exchange-CrossTenant-AuthSource: DB8EUR06FT028.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: DB8EUR06HT200 X-Spam-Status: No, score=-9.0 required=5.0 tests=BAYES_00, FORGED_MUA_MOZILLA, FREEMAIL_FROM, GIT_PATCH_0, KAM_DMARC_STATUS, MSGID_FROM_MTA_HEADER, RCVD_IN_DNSWL_NONE, RCVD_IN_MSPIKE_H2, SPF_HELO_PASS, SPF_PASS, TXREP autolearn=ham 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: Wed, 02 Jun 2021 17:31:40 -0000 Due to the SIGPIPE the gdb process is killed here, which is not helpful. 2021-06-02 Bernd Edlinger * compile/compile.c (compile_to_object): Ignore SIGPIPE before calling the plugin. --- gdb/compile/compile.c | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/gdb/compile/compile.c b/gdb/compile/compile.c index 8481d14..134a077 100644 --- a/gdb/compile/compile.c +++ b/gdb/compile/compile.c @@ -755,6 +755,12 @@ struct compile_options fprintf_unfiltered (gdb_stdlog, "source file produced: %s\n\n", fnames.source_file ()); +#ifdef SIGPIPE + /* If we don't do this, then GDB simply exits + when the remote side dies. */ + signal (SIGPIPE, SIG_IGN); +#endif + /* Call the compiler and start the compilation process. */ compiler->set_source_file (fnames.source_file ()); ok = compiler->compile (fnames.object_file (), compile_debug); -- 1.9.1