From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from smtp.CeBiTec.Uni-Bielefeld.DE (smtp.CeBiTec.Uni-Bielefeld.DE [129.70.160.84]) by sourceware.org (Postfix) with ESMTPS id 5D65F3857C66 for ; Mon, 14 Jun 2021 11:41:21 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.1 sourceware.org 5D65F3857C66 Authentication-Results: sourceware.org; dmarc=none (p=none dis=none) header.from=CeBiTec.Uni-Bielefeld.DE Authentication-Results: sourceware.org; spf=none smtp.mailfrom=cebitec.uni-bielefeld.de Received: from localhost (localhost [127.0.0.1]) by smtp.CeBiTec.Uni-Bielefeld.DE (Postfix) with ESMTP id 297A9B3B7B; Mon, 14 Jun 2021 13:41:20 +0200 (CEST) X-Virus-Scanned: amavisd-new at CeBiTec.Uni-Bielefeld.DE Received: from smtp.CeBiTec.Uni-Bielefeld.DE ([127.0.0.1]) by localhost (smtp.cebitec.uni-bielefeld.de [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id mkIvJmtQTE_q; Mon, 14 Jun 2021 13:41:19 +0200 (CEST) Received: from manam.CeBiTec.Uni-Bielefeld.DE (p50854661.dip0.t-ipconnect.de [80.133.70.97]) by smtp.CeBiTec.Uni-Bielefeld.DE (Postfix) with ESMTPSA id 50298B3E49; Mon, 14 Jun 2021 13:41:19 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=CeBiTec.Uni-Bielefeld.DE; s=20200306; t=1623670879; bh=A9AWa3GTf1RgJQB/pfDwHtklRxwz+TqcS3jQrRMVckM=; h=From:To:Cc:Subject:References:Date:In-Reply-To:From; b=LK78/CbjNRDpgYsePOZx5ehfA9ista9UTfkZQdyqzbwvRz962aSbel9ZtRnZsPLef noj2EWBcVsZjAwgJM6MlCG4lldpVmW61/VmgvYZ+udeoORYn7jrwXeEfy5ToI89QW5 wJxnqoPx6d5P3BfdRuuXukK3i2pCVUnGuRBmnYGB8N0AsVQrPVH1OBv4nSheFFp2iz ZrPgMNTHLNG+2NZTHCABQktFoYBgapkwrNb2uW1fjjU3Q7pU6PmfEUfVrU2g/OE1pd v140Wr0iPiAinWz4fqq35YrqWOJ+5/YnqmmoBOypmt6KIq1JU+zUeUrb/JZxBb+Ksw Y6BxGT0CAHYtw== From: Rainer Orth To: Bernd Edlinger Cc: Tom Tromey , "gdb-patches@sourceware.org" Subject: Re: [PATCH] Fix gdb crash due to SIGPIPE when the compile command fails References: <87tumgp1ob.fsf@tromey.com> <87zgw5oijf.fsf@tromey.com> Date: Mon, 14 Jun 2021 13:41:18 +0200 In-Reply-To: (Bernd Edlinger's message of "Sat, 5 Jun 2021 13:44:03 +0200") Message-ID: User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/27.1.90 (usg-unix-v) MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable X-Spam-Status: No, score=-3787.0 required=5.0 tests=BAYES_00, DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, RCVD_IN_BARRACUDACENTRAL, SPF_HELO_NONE, SPF_NONE, 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: Mon, 14 Jun 2021 11:41:23 -0000 Hi Bernd, > On 6/4/21 3:39 PM, Tom Tromey wrote: >>>>>>> "Bernd" =3D=3D Bernd Edlinger writes: >>=20 >> Bernd> I believe it is right to avoid the SIGPIPE before calling the plu= gin, >> Bernd> instead of doing that in gcc-trunk, since we don't know which ver= sion >> Bernd> we will be calling, and all versions I tried have failed like thi= s. >>=20 >> 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. >>=20 > > 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: =E2=80= =98sighandler_t=E2=80=99 does not name a type; did you mean =E2=80=98sa_han= dler=E2=80=99? 659 | sighandler_t m_osigpipe =3D NULL; | ^~~~~~~~~~~~ | sa_handler /vol/src/gnu/gdb/hg/master/dist/gdb/compile/compile.c: In constructor =E2= =80=98scoped_ignore_sigpipe::scoped_ignore_sigpipe()=E2=80=99: /vol/src/gnu/gdb/hg/master/dist/gdb/compile/compile.c:644:5: error: =E2=80= =98m_osigpipe=E2=80=99 was not declared in this scope 644 | m_osigpipe =3D signal (SIGPIPE, SIG_IGN); | ^~~~~~~~~~ /vol/src/gnu/gdb/hg/master/dist/gdb/compile/compile.c:644:18: error: =E2=80= =98signal=E2=80=99 was not declared in this scope; did you mean =E2=80=98si= gval=E2=80=99? 644 | m_osigpipe =3D signal (SIGPIPE, SIG_IGN); | ^~~~~~ | sigval /vol/src/gnu/gdb/hg/master/dist/gdb/compile/compile.c: In destructor =E2=80= =98scoped_ignore_sigpipe::~scoped_ignore_sigpipe()=E2=80=99: /vol/src/gnu/gdb/hg/master/dist/gdb/compile/compile.c:651:22: error: =E2=80= =98m_osigpipe=E2=80=99 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: =E2=80= =98signal=E2=80=99 was not declared in this scope; did you mean =E2=80=98si= gval=E2=80=99? 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. Rainer --=20 ---------------------------------------------------------------------------= -- Rainer Orth, Center for Biotechnology, Bielefeld University