From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from EUR02-VE1-obe.outbound.protection.outlook.com (mail-oln040092069085.outbound.protection.outlook.com [40.92.69.85]) by sourceware.org (Postfix) with ESMTPS id 1059D3851C17 for ; Mon, 14 Jun 2021 12:57:08 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.1 sourceware.org 1059D3851C17 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=EXdV8BqHQDbhxyPmRXzf2+VJU0CBhhlyJBDdD/UqstymHAbYwrPd9zWsmVFvVLn9w2c/hl0C+nZBkPN8huWXLWL9EhLWX+d1vbMnt84QXIvtD1dyKWG3VHORFPdp24U+qhCDDPLytasGH8aiRdlzQYOgy2sTtRrFa7jJkZNJGyq9uLsNshrs2Q9hzg+Lnroiob/uFdyTNKiIHC9jX1M3MsTZxv9ihH28uGf7gkrxsGT9XKgTJL7A0dduqEnPMrl+tzUIvvEDlb/k2Dfj5+ZDfUF9WH+06PAOnIf6Pr8XhQGy08Jw5tiXc7jzUd4GV+i+uMX+5EUIkK1JuTGRIXx6vg== 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=/NoetzH1s2ZNRsSbsy+KFducinqIN+Zl7hhDykd4O6M=; b=NmgZE6zjq8W6k6MTQs+e6oT67jolzJD42aSul8h0ORZ+FbO3+TVOUjmrKpwlTLcm3Q1nY2LNgwpDd0T18iaj0EYNxvhGo/9JstOXXQBtH5tB/PW0LorlEol/htw/PAYfw7s7DqpnHI2OSU/fbPWV/cWTC6LX7fExahiY2GAuPsbRtsD6xnfg24NkGo1XN4Ejyq0JPLNzkirFQ1LgUbXItZ/7G2fkA22XYVmAfS6Mf6my5ekXGEK1Q9zQ6g0OwdGNarSgCFIkmdQL/0Q3Gj8ksn77+nbzs0JVYvrssxFZUdeMsNewOi+p60KsRpP5jBEDBnD5NKMEp3GZ6W+RfynoNQ== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=none; dmarc=none; dkim=none; arc=none Received: from VE1EUR02FT061.eop-EUR02.prod.protection.outlook.com (2a01:111:e400:7e1e::46) by VE1EUR02HT110.eop-EUR02.prod.protection.outlook.com (2a01:111:e400:7e1e::445) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4219.21; Mon, 14 Jun 2021 12:57:03 +0000 Received: from AS8PR10MB4712.EURPRD10.PROD.OUTLOOK.COM (2a01:111:e400:7e1e::48) by VE1EUR02FT061.mail.protection.outlook.com (2a01:111:e400:7e1e::494) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4219.21 via Frontend Transport; Mon, 14 Jun 2021 12:57:03 +0000 X-IncomingTopHeaderMarker: OriginalChecksum:B4B2F1BD1B77BB570E3C25DF2A7EBC1AEB91880B59296D535010FCEF616A2EA4; UpperCasedChecksum:3093A261669BCDD79637912B59AD05CA0EC6D1E4FCBE52E627F1B171E533A431; SizeAsReceived:9108; 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; Mon, 14 Jun 2021 12:57:03 +0000 Subject: Re: [PATCH] Fix gdb crash due to SIGPIPE when the compile command fails To: Rainer Orth Cc: Tom Tromey , "gdb-patches@sourceware.org" References: <87tumgp1ob.fsf@tromey.com> <87zgw5oijf.fsf@tromey.com> From: Bernd Edlinger Message-ID: Date: Mon, 14 Jun 2021 14:57:00 +0200 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:60.0) Gecko/20100101 Thunderbird/60.6.1 In-Reply-To: Content-Type: text/plain; charset=utf-8 Content-Language: en-US Content-Transfer-Encoding: 8bit X-TMN: [2H9/gyrJvLGwyz+Kv0x7sAFks2YkfbJ6] X-ClientProxiedBy: AM4PR0701CA0006.eurprd07.prod.outlook.com (2603:10a6:200:42::16) To AS8PR10MB4712.EURPRD10.PROD.OUTLOOK.COM (2603:10a6:20b:31d::16) X-Microsoft-Original-Message-ID: MIME-Version: 1.0 X-MS-Exchange-MessageSentRepresentingType: 1 Received: from [192.168.1.101] (92.211.178.34) by AM4PR0701CA0006.eurprd07.prod.outlook.com (2603:10a6:200:42::16) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4242.10 via Frontend Transport; Mon, 14 Jun 2021 12:57:01 +0000 X-MS-PublicTrafficType: Email X-IncomingHeaderCount: 48 X-EOPAttributedMessage: 0 X-MS-Office365-Filtering-Correlation-Id: 3f9b8292-2fab-4044-1171-08d92f33e730 X-MS-TrafficTypeDiagnostic: VE1EUR02HT110: X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: rGSuIPNxYcrWriT0byM4ecEvZzK+8Vuni5PjCUa6eNncHHEVLFiN3SUrjWQGBlIOW4lPqVYju9NYYBF+koGzzPuJpDYmhujro4BJQydc8uMjE8yplgKNsPYgPYhOZ4QiS9zgmJ5XQ0ZE83e8IIOmf5zvp7qTSLHogIQoHWsEy9Il+dEh/K/7kqnOqNLNfMqAjzkMv09r14MC41CgpTWDsjWYeD7HMLcAlJVDC/7PntH9mjkavpD2M1oQKgzPiRrwxHhngcRs6Umv7Mfxlg/EZ4b4uYJ+JCLHPkuSMpR3pHEvna4p9h44kFmn3sTdI4MX+y6G+oL8eSJiJi1Pj5V5fUG7PSKZeBGzq7nxGiv+wUmMZhuCux32WY8edIEuk9VT8GC6pcoQv5WrR6en07qPLA== X-MS-Exchange-AntiSpam-MessageData: dykziTfusqIYEkA1Tkh1RWLQtC8yDuMw/Rz5V5XhNru5LC40QDaG+h4Q7V9CccZUT2PqqX84739eN+Lq3LIJ3a6dDXTMDahB24uK2NgdKUSa3EqKfIWpEziHhMrhkRzoLKXQr/e+8D8Duvcd0OnEyg== X-OriginatorOrg: outlook.com X-MS-Exchange-CrossTenant-Network-Message-Id: 3f9b8292-2fab-4044-1171-08d92f33e730 X-MS-Exchange-CrossTenant-OriginalArrivalTime: 14 Jun 2021 12:57:03.5424 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: 84df9e7f-e9f6-40af-b435-aaaaaaaaaaaa X-MS-Exchange-CrossTenant-AuthSource: VE1EUR02FT061.eop-EUR02.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: VE1EUR02HT110 X-Spam-Status: No, score=-9.8 required=5.0 tests=BAYES_00, FORGED_MUA_MOZILLA, FREEMAIL_FROM, GIT_PATCH_0, 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=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: Mon, 14 Jun 2021 12:57:09 -0000 Hi Rainer, On 6/14/21 1:41 PM, Rainer Orth wrote: > Hi Bernd, > >> On 6/4/21 3:39 PM, 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. >>> >> >> Okay, done, that works for me. >> >> Is this OK? > > this patch broke the Solaris build: > > /vol/src/gnu/gdb/hg/master/dist/gdb/compile/compile.c:659:3: error: ‘sighandler_t’ does not name a type; did you mean ‘sa_handler’? > 659 | sighandler_t m_osigpipe = NULL; > | ^~~~~~~~~~~~ > | sa_handler > /vol/src/gnu/gdb/hg/master/dist/gdb/compile/compile.c: In constructor ‘scoped_ignore_sigpipe::scoped_ignore_sigpipe()’: > /vol/src/gnu/gdb/hg/master/dist/gdb/compile/compile.c:644:5: error: ‘m_osigpipe’ was not declared in this scope > 644 | m_osigpipe = signal (SIGPIPE, SIG_IGN); > | ^~~~~~~~~~ > /vol/src/gnu/gdb/hg/master/dist/gdb/compile/compile.c:644:18: error: ‘signal’ was not declared in this scope; did you mean ‘sigval’? > 644 | m_osigpipe = signal (SIGPIPE, SIG_IGN); > | ^~~~~~ > | sigval > /vol/src/gnu/gdb/hg/master/dist/gdb/compile/compile.c: In destructor ‘scoped_ignore_sigpipe::~scoped_ignore_sigpipe()’: > /vol/src/gnu/gdb/hg/master/dist/gdb/compile/compile.c:651:22: error: ‘m_osigpipe’ was not declared in this scope > 651 | signal (SIGPIPE, m_osigpipe); > | ^~~~~~~~~~ > /vol/src/gnu/gdb/hg/master/dist/gdb/compile/compile.c:651:5: error: ‘signal’ was not declared in this scope; did you mean ‘sigval’? > 651 | signal (SIGPIPE, m_osigpipe); > | ^~~~~~ > | sigval > > and I have a very hard time deciding where needs to be > included given the enormous range of headers included by compile.c. > Oh, I see, looks like it did only work by chance. Maybe just include it after all other headers: >From 6c6d25339460df2ad6eade17cc47a5e472208cc0 Mon Sep 17 00:00:00 2001 From: Bernd Edlinger Date: Mon, 14 Jun 2021 14:49:21 +0200 Subject: [PATCH] Include missing header signal.h 2021-06-14 Bernd Edlinger * compile/compile.c: Include missing header signal.h. --- gdb/compile/compile.c | 1 + 1 file changed, 1 insertion(+) diff --git a/gdb/compile/compile.c b/gdb/compile/compile.c index 8247fc4..abbb72a 100644 --- a/gdb/compile/compile.c +++ b/gdb/compile/compile.c @@ -43,6 +43,7 @@ #include "gdbsupport/gdb_optional.h" #include "gdbsupport/gdb_unlinker.h" #include "gdbsupport/pathstuff.h" +#include ^L -- 1.9.1 I guess, I'll commit it as obvious, unless someone objects. Thanks Bernd.