From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail-qv1-xf31.google.com (mail-qv1-xf31.google.com [IPv6:2607:f8b0:4864:20::f31]) by sourceware.org (Postfix) with ESMTPS id 399D73857836 for ; Wed, 2 Jun 2021 22:20:02 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.1 sourceware.org 399D73857836 Received: by mail-qv1-xf31.google.com with SMTP id w9so2195788qvi.13 for ; Wed, 02 Jun 2021 15:20:02 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=aqYVQ7ia95I6yaXTT6HZ2kbAMnPu1pb3ePJIL9ssWDg=; b=g/HU80ZC5/bqMoVqsODCJwzoj4RBrwwANsi3pjJjBNVJ2erOquJnlOD2aHwg8QgXhw BPNMDQeUrv4vvQ8Sb7fXvm/pmFS2IMWpow7f2CvmOnvS6f7Yip09in2edYJS9alzsvFf otKFalsPj1z3/8ivk0nPOM1wytQrEokBwIjBVGXakT/q2R+vlpaRd4DxPDoxzZ7aR3Y5 S7Jbogw/aohW/SF6oICPg5pBUDBh+f2wdRqJsF/o8OqUMx9WNuuldPCLv4h6M1D4H+Ui Q5ox60DTnBaA4KUBVtVZJlD9FbAZ4cfm2djC7gFzqWDXWlDxzSw4v4v4HLbAuUlAzwJV F9DA== X-Gm-Message-State: AOAM530ixj4YHoSdeAx7ul4hc5GQepGXmzkLj+5Vo8Q6TNociv+90CaJ Feq0HLVPcQUR6U2UiO+kXB1PqVZLy1dQhJHD0nIj9g== X-Google-Smtp-Source: ABdhPJw9FvQPbFxYTLE/gGGBBEf5zp7U/fJkj1phsuLOkN0JWbQmeBR2SyQ+saR30jfHcnrmTPoPzMhvfE4h0Rj0fpU= X-Received: by 2002:a05:6214:1481:: with SMTP id bn1mr15078025qvb.1.1622672401616; Wed, 02 Jun 2021 15:20:01 -0700 (PDT) MIME-Version: 1.0 References: <87tumgp1ob.fsf@tromey.com> In-Reply-To: <87tumgp1ob.fsf@tromey.com> From: Christian Biesinger Date: Wed, 2 Jun 2021 17:19:23 -0500 Message-ID: Subject: Re: [PATCH] Fix gdb crash due to SIGPIPE when the compile command fails To: Tom Tromey Cc: Bernd Edlinger , "gdb-patches@sourceware.org" Content-Type: text/plain; charset="UTF-8" X-Spam-Status: No, score=-17.7 required=5.0 tests=BAYES_00, DKIMWL_WL_MED, DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, DKIM_VALID_EF, ENV_AND_HDR_SPF_MATCH, RCVD_IN_DNSWL_NONE, SPF_HELO_NONE, SPF_PASS, TXREP, USER_IN_DEF_DKIM_WL, USER_IN_DEF_SPF_WL 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 22:20:03 -0000 On Wed, Jun 2, 2021 at 1:22 PM Tom Tromey wrote: > > >>>>> "Bernd" == Bernd Edlinger writes: > > Bernd> Due to the SIGPIPE the gdb process is killed here, which is > Bernd> not helpful. > > Bernd> 2021-06-02 Bernd Edlinger > > Bernd> * compile/compile.c (compile_to_object): Ignore SIGPIPE before calling > Bernd> the plugin. > > I don't understand why gdb gets a SIGPIPE here. > Could you explain it a bit more? Also, if we determine that this is necessary, this does not seem like right way to do this. If gdb wants to globally ignore SIGPIPE, it should probably do that in general startup code, maybe in async_init_signals. If it should only be done for this specific call, it should reset it afterwards. Christian