GNU bug report logs - #74788
Incorrect return value for SIGPIPE case

Please note: This is a static page, with minimal formatting, updated once a day.
Click here to see this page with the latest information and nicer formatting.

Package: grep; Reported by: Sachin T <sachintu47@HIDDEN>; dated Wed, 11 Dec 2024 14:01:01 UTC; Maintainer for grep is bug-grep@HIDDEN.

Message received at 74788 <at> debbugs.gnu.org:


Received: (at 74788) by debbugs.gnu.org; 12 Dec 2024 17:00:12 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Thu Dec 12 12:00:12 2024
Received: from localhost ([127.0.0.1]:40104 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1tLmXq-0004cN-MO
	for submit <at> debbugs.gnu.org; Thu, 12 Dec 2024 12:00:12 -0500
Received: from mail-ej1-f50.google.com ([209.85.218.50]:50223)
 by debbugs.gnu.org with esmtp (Exim 4.84_2)
 (envelope-from <sachintu47@HIDDEN>) id 1tLmXn-0004aA-UD
 for 74788 <at> debbugs.gnu.org; Thu, 12 Dec 2024 12:00:09 -0500
Received: by mail-ej1-f50.google.com with SMTP id
 a640c23a62f3a-aa69107179cso158193066b.0
 for <74788 <at> debbugs.gnu.org>; Thu, 12 Dec 2024 09:00:07 -0800 (PST)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
 d=gmail.com; s=20230601; t=1734022747; x=1734627547; darn=debbugs.gnu.org;
 h=cc:to:subject:message-id:date:from:in-reply-to:references
 :mime-version:from:to:cc:subject:date:message-id:reply-to;
 bh=ypE00CYOaZaqANMlSUV1hSvuiw7vQtTGM5TZ2dxISm4=;
 b=a2TwBqp7/vJ8Y7ITFYEa8TPYZKzXHQdanKM8yhiGrEOuDsWHngreXKMfYXZVqU2DyR
 ui9onF8+HfTG3u5KCXFuuyG4gP3IXTO+eJCM2Kr8SVFRrKeGVSdjlcueGMsd032LVJ8d
 pDXDNaLeZgBIFsPHlO5dIXGD/5qfB+HDVTvoFc+mz/9EgBuxOyw4hX3I1KGI2R+ElSyG
 7/oTvcZYODBKJ4Zb5sV7YHKM/nncKnoNXaehxX21NQHbgdFPJlugtPLJQP09wX2dxOtL
 NX2k6wgndgoCtpb/Swu/gkiyP3ddyVzukFhywIt0VqZQ+v7RuqPff8szhSTkQl6Mvc8u
 ignw==
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
 d=1e100.net; s=20230601; t=1734022747; x=1734627547;
 h=cc:to:subject:message-id:date:from:in-reply-to:references
 :mime-version:x-gm-message-state:from:to:cc:subject:date:message-id
 :reply-to;
 bh=ypE00CYOaZaqANMlSUV1hSvuiw7vQtTGM5TZ2dxISm4=;
 b=KW7f3mNenGH+Imi5la0mHU/JAcTFq4zcxRdODQau6Y87m/YnP5MMVwwIQ3sQgM21VR
 OxIVpWOALbjvUKarng7JSZk88gNns8y7cHsJJAh/dA3rlLDwCOn7FJJ5OXjXdMPtRqrC
 hfXSrFFJ6sZwWyeEZjq64vlD85VjuPKPu4ntWdEEN8Znjib1Mz6xBqbZv3Jn6hdtlBrB
 8ywFQKi+dCo5lGYDdwPiqaJfIoiMWBluXLSKl2Wvzye6HJqSBhZxgFvPNuFRSCUYDYDv
 0geaPIHgnvIOwtoM8FT21r8FjfYMfO6dWN1invylitnWV49zd5yLrpAhrmkhgNorTT4W
 jahQ==
X-Gm-Message-State: AOJu0Yyu5o6DBUWGYd1NZvvLz8+wG9Do79kst2iJgwIT24dlB+ZuTUs1
 +6+SumKUqiLMGR9gTBwJ85NefYLbUzUOpLZM2NzByBYE0YQEMgqnxtR8J1IdxUFaBr1tOr/pMX6
 3/o/s+2LpdOnI4AjoAzHKhKTSDf1qPzeZ
X-Gm-Gg: ASbGncu5JViOEFHigkcriGUtMomXElVRdEOa4jG8oZSl0/ZQVaxCC2AzeJ261rs2F7e
 7BxFyd1eWggWcY0KZ1W5ew+3CqPwz4C5Q66a0K/8=
X-Google-Smtp-Source: AGHT+IGb+pR79imMJnf7vmpKIRMjlvXR2fn3P613K1hIekTN9UaV0chRKz/VGPfgKoHYP7CWy8RyrnsFzHyDWrg2Da8=
X-Received: by 2002:a17:907:7803:b0:aa6:7855:ae52 with SMTP id
 a640c23a62f3a-aa6b10d678cmr757910466b.3.1734022746786; Thu, 12 Dec 2024
 08:59:06 -0800 (PST)
MIME-Version: 1.0
References: <CAEktRw2S8S-Cbzxon2Cyjbqkce0HTgC1G5W07cmKpBcUqY5sxw@HIDDEN>
 <3a2f92db-c21d-4ce2-97e5-640b2fcc9f15@HIDDEN>
In-Reply-To: <3a2f92db-c21d-4ce2-97e5-640b2fcc9f15@HIDDEN>
From: Sachin T <sachintu47@HIDDEN>
Date: Thu, 12 Dec 2024 22:28:55 +0530
Message-ID: <CAEktRw0pGqSzsLVwi_jJjXPjkcfey=WYMh_aJTrV1wSYyHcSTQ@HIDDEN>
Subject: Re: bug#74788: Incorrect return value for SIGPIPE case
To: Paul Eggert <eggert@HIDDEN>
Content-Type: multipart/alternative; boundary="000000000000dad33a062915a1e1"
X-Spam-Score: 0.3 (/)
X-Debbugs-Envelope-To: 74788
Cc: 74788 <at> debbugs.gnu.org
X-BeenThere: debbugs-submit <at> debbugs.gnu.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: <debbugs-submit.debbugs.gnu.org>
List-Unsubscribe: <https://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe>
List-Archive: <https://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/>
List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org>
List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help>
List-Subscribe: <https://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe>
Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org
Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org>
X-Spam-Score: -0.7 (/)

--000000000000dad33a062915a1e1
Content-Type: text/plain; charset="UTF-8"
Content-Transfer-Encoding: quoted-printable

Hi Paul,

Thank you for your response.

This issue has been observed in z/OS version 2.5 and later.

I am currently discussing it with the z/OS platform team.
As a workaround, we installed a signal handler for SIGPIPE that invokes
_exit(141).
Once the final changes are determined, I=E2=80=99ll propose a fix upstream.

Best regards,
Sachin



On Wed, Dec 11, 2024 at 11:24=E2=80=AFPM Paul Eggert <eggert@HIDDEN> w=
rote:

> On 2024-12-11 04:59, Sachin T wrote:
> > Could you suggest the preferred solution for handling this situation on
> the
> > z/OS platform?
>
> Since this problem afflicts many applications (not just grep), the
> preferred solution would be to fix z/OS so that a process terminated by
> a signal has the exit status corresponding to the signal, even if the
> signal arrives during calls by 'exit' to functions registered by
> 'atexit'. This is required by POSIX[1] and is what other systems do. Is
> that something you could start the ball rolling on? (I don't use z/OS
> and so cannot file bug reports for it.)
>
> I don't see any straightforward change to 'grep' that would work around
> the z/OS problem. However, if you can think of a change, please let us
> know.
>
> Also, could you please let us know the z/OS version so that I can
> document this portability problem in Gnulib? Thanks.
>
> [1]:
>
> https://pubs.opengroup.org/onlinepubs/9799919799/functions/V2_chap02.html=
#tag_16_04_03_01
>

--000000000000dad33a062915a1e1
Content-Type: text/html; charset="UTF-8"
Content-Transfer-Encoding: quoted-printable

<div dir=3D"ltr"><p>Hi Paul,</p><p>Thank you for your response.</p><p>This =
issue has been observed in z/OS version 2.5 and later.=C2=A0</p><p>I am cur=
rently discussing it with the z/OS platform team.<br>As a workaround, we in=
stalled a signal handler for SIGPIPE that invokes _exit(141).<br>Once the f=
inal changes are determined, I=E2=80=99ll propose a fix upstream.</p><p>Bes=
t regards,<br>Sachin</p><div><br></div><div><br></div><br><div class=3D"gma=
il_quote gmail_quote_container"><div dir=3D"ltr" class=3D"gmail_attr">On We=
d, Dec 11, 2024 at 11:24=E2=80=AFPM Paul Eggert &lt;<a href=3D"mailto:egger=
t@HIDDEN">eggert@HIDDEN</a>&gt; wrote:<br></div><blockquote class=
=3D"gmail_quote" style=3D"margin:0px 0px 0px 0.8ex;border-left:1px solid rg=
b(204,204,204);padding-left:1ex">On 2024-12-11 04:59, Sachin T wrote:<br>
&gt; Could you suggest the preferred solution for handling this situation o=
n the<br>
&gt; z/OS platform?<br>
<br>
Since this problem afflicts many applications (not just grep), the <br>
preferred solution would be to fix z/OS so that a process terminated by <br=
>
a signal has the exit status corresponding to the signal, even if the <br>
signal arrives during calls by &#39;exit&#39; to functions registered by <b=
r>
&#39;atexit&#39;. This is required by POSIX[1] and is what other systems do=
. Is <br>
that something you could start the ball rolling on? (I don&#39;t use z/OS <=
br>
and so cannot file bug reports for it.)<br>
<br>
I don&#39;t see any straightforward change to &#39;grep&#39; that would wor=
k around <br>
the z/OS problem. However, if you can think of a change, please let us know=
.<br>
<br>
Also, could you please let us know the z/OS version so that I can <br>
document this portability problem in Gnulib? Thanks.<br>
<br>
[1]: <br>
<a href=3D"https://pubs.opengroup.org/onlinepubs/9799919799/functions/V2_ch=
ap02.html#tag_16_04_03_01" rel=3D"noreferrer" target=3D"_blank">https://pub=
s.opengroup.org/onlinepubs/9799919799/functions/V2_chap02.html#tag_16_04_03=
_01</a><br>
</blockquote></div></div>

--000000000000dad33a062915a1e1--




Information forwarded to bug-grep@HIDDEN:
bug#74788; Package grep. Full text available.

Message received at 74788 <at> debbugs.gnu.org:


Received: (at 74788) by debbugs.gnu.org; 11 Dec 2024 17:54:57 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Wed Dec 11 12:54:57 2024
Received: from localhost ([127.0.0.1]:36165 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1tLQvI-0001Wu-Sd
	for submit <at> debbugs.gnu.org; Wed, 11 Dec 2024 12:54:57 -0500
Received: from mail.cs.ucla.edu ([131.179.128.66]:58774)
 by debbugs.gnu.org with esmtp (Exim 4.84_2)
 (envelope-from <eggert@HIDDEN>) id 1tLQvG-0001W6-Ul
 for 74788 <at> debbugs.gnu.org; Wed, 11 Dec 2024 12:54:56 -0500
Received: from localhost (localhost [127.0.0.1])
 by mail.cs.ucla.edu (Postfix) with ESMTP id 148673C00FAAF;
 Wed, 11 Dec 2024 09:54:48 -0800 (PST)
Received: from mail.cs.ucla.edu ([127.0.0.1])
 by localhost (mail.cs.ucla.edu [127.0.0.1]) (amavis, port 10032) with ESMTP
 id euw7xgOmQsin; Wed, 11 Dec 2024 09:54:47 -0800 (PST)
Received: from localhost (localhost [127.0.0.1])
 by mail.cs.ucla.edu (Postfix) with ESMTP id B32AC3C005176;
 Wed, 11 Dec 2024 09:54:47 -0800 (PST)
DKIM-Filter: OpenDKIM Filter v2.10.3 mail.cs.ucla.edu B32AC3C005176
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=cs.ucla.edu;
 s=9D0B346E-2AEB-11ED-9476-E14B719DCE6C; t=1733939687;
 bh=pMOlx362shyWPcY5bosbYEq9ElKTL5r+Yrm5MVF7KUM=;
 h=Message-ID:Date:MIME-Version:To:From;
 b=MLuA6tu8x8QqzwLZ/VhvHHQh8ggmY3gurGx1yB9eU2BUzo2nFn+GyQ9rIlxh6QaB8
 fA2Y1iTsN6QYlQh099F4iIM0hmRipWefsChcEDAPBI1aDwHs97oMJKTZKOxDCQRLCN
 kTYMmm4q6BlmC+ZVUW+qvDHngKTIcC9vHUkydiKcnmyX6sJLtf24RyBTJHu9lW8cFf
 mbyiLkIEpKoZJKJa8bmwd76FI3x/UtclBNgz0whOeF2/cLTa8MnewdCXelrMdFa57Y
 v2fUJvS1g3yWY7v9P62hdI5dVGv1QYhJ86HP/hLrdD2+4g9zvfZwnuImRG2s7qUrWO
 Ta5LZ06uwr3Pg==
X-Virus-Scanned: amavis at mail.cs.ucla.edu
Received: from mail.cs.ucla.edu ([127.0.0.1])
 by localhost (mail.cs.ucla.edu [127.0.0.1]) (amavis, port 10026) with ESMTP
 id LXzABlhYlvnx; Wed, 11 Dec 2024 09:54:47 -0800 (PST)
Received: from [192.168.254.12] (unknown [47.154.27.134])
 by mail.cs.ucla.edu (Postfix) with ESMTPSA id 95B2D3C00FAAF;
 Wed, 11 Dec 2024 09:54:47 -0800 (PST)
Message-ID: <3a2f92db-c21d-4ce2-97e5-640b2fcc9f15@HIDDEN>
Date: Wed, 11 Dec 2024 09:54:47 -0800
MIME-Version: 1.0
User-Agent: Mozilla Thunderbird
Subject: Re: bug#74788: Incorrect return value for SIGPIPE case
To: Sachin T <sachintu47@HIDDEN>
References: <CAEktRw2S8S-Cbzxon2Cyjbqkce0HTgC1G5W07cmKpBcUqY5sxw@HIDDEN>
Content-Language: en-US
From: Paul Eggert <eggert@HIDDEN>
Organization: UCLA Computer Science Department
In-Reply-To: <CAEktRw2S8S-Cbzxon2Cyjbqkce0HTgC1G5W07cmKpBcUqY5sxw@HIDDEN>
Content-Type: text/plain; charset=UTF-8; format=flowed
Content-Transfer-Encoding: 7bit
X-Spam-Score: 0.0 (/)
X-Debbugs-Envelope-To: 74788
Cc: 74788 <at> debbugs.gnu.org
X-BeenThere: debbugs-submit <at> debbugs.gnu.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: <debbugs-submit.debbugs.gnu.org>
List-Unsubscribe: <https://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe>
List-Archive: <https://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/>
List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org>
List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help>
List-Subscribe: <https://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe>
Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org
Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org>
X-Spam-Score: -1.0 (-)

On 2024-12-11 04:59, Sachin T wrote:
> Could you suggest the preferred solution for handling this situation on the
> z/OS platform?

Since this problem afflicts many applications (not just grep), the 
preferred solution would be to fix z/OS so that a process terminated by 
a signal has the exit status corresponding to the signal, even if the 
signal arrives during calls by 'exit' to functions registered by 
'atexit'. This is required by POSIX[1] and is what other systems do. Is 
that something you could start the ball rolling on? (I don't use z/OS 
and so cannot file bug reports for it.)

I don't see any straightforward change to 'grep' that would work around 
the z/OS problem. However, if you can think of a change, please let us know.

Also, could you please let us know the z/OS version so that I can 
document this portability problem in Gnulib? Thanks.

[1]: 
https://pubs.opengroup.org/onlinepubs/9799919799/functions/V2_chap02.html#tag_16_04_03_01




Information forwarded to bug-grep@HIDDEN:
bug#74788; Package grep. Full text available.

Message received at submit <at> debbugs.gnu.org:


Received: (at submit) by debbugs.gnu.org; 11 Dec 2024 14:00:44 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Wed Dec 11 09:00:44 2024
Received: from localhost ([127.0.0.1]:33548 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1tLNGc-0001Rh-Ki
	for submit <at> debbugs.gnu.org; Wed, 11 Dec 2024 09:00:44 -0500
Received: from lists.gnu.org ([209.51.188.17]:58430)
 by debbugs.gnu.org with esmtp (Exim 4.84_2)
 (envelope-from <sachintu47@HIDDEN>) id 1tLMJp-0005w3-2E
 for submit <at> debbugs.gnu.org; Wed, 11 Dec 2024 07:59:57 -0500
Received: from eggs.gnu.org ([2001:470:142:3::10])
 by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256)
 (Exim 4.90_1) (envelope-from <sachintu47@HIDDEN>)
 id 1tLMJo-00064H-P9
 for bug-grep@HIDDEN; Wed, 11 Dec 2024 07:59:56 -0500
Received: from mail-ej1-x635.google.com ([2a00:1450:4864:20::635])
 by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128)
 (Exim 4.90_1) (envelope-from <sachintu47@HIDDEN>)
 id 1tLMJm-0002ky-Sg
 for bug-grep@HIDDEN; Wed, 11 Dec 2024 07:59:56 -0500
Received: by mail-ej1-x635.google.com with SMTP id
 a640c23a62f3a-aa6a3c42400so127000266b.0
 for <bug-grep@HIDDEN>; Wed, 11 Dec 2024 04:59:54 -0800 (PST)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
 d=gmail.com; s=20230601; t=1733921992; x=1734526792; darn=gnu.org;
 h=to:subject:message-id:date:from:mime-version:from:to:cc:subject
 :date:message-id:reply-to;
 bh=4yAZwAOe9jBKttBN+a54UH2TVGNNKLB6s5hr6IFoGaI=;
 b=bk7KYnFY2In/rlBKHTnE4bpgWcVEpGrwm16H2u0q78cB2rmIXzLEOl/SU09PGc3OmX
 SvIaWwmtmznEENoepUDARXuugj6WssspdQaH+yoRGm2cdATaTnt9QhEFF1LIypnRzyWe
 R9maV5OPddHE8Acn7tXbHEOwmpv9R2EgJblBuv5brhjO8IbYHdXTYEFiW8qj1duCL+Hg
 zbx9lm2kanfUd0YSrphIyxBWk3PHl9Y1DCGSpXRABLnD5ALHP2tU1X4EgKRTYbHa0aud
 CcwXxEAMHWyFJOHcZtKVLN3290JhfvcBGHpBSuNWlX6WlQrV7UazIJh6SZlcVzaaxw8L
 me1g==
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
 d=1e100.net; s=20230601; t=1733921992; x=1734526792;
 h=to:subject:message-id:date:from:mime-version:x-gm-message-state
 :from:to:cc:subject:date:message-id:reply-to;
 bh=4yAZwAOe9jBKttBN+a54UH2TVGNNKLB6s5hr6IFoGaI=;
 b=AeOp7A0BVWtO2VHOLNEzatxwRXiBgMavrLC9Thp9bNIuuHitvlUJLJ/qsw/eRWd3bW
 1AIkq4j5GcmOs1TGN4xqczsX6roPcLQyDHUNFVtCpsBt5f77shvHeAsnsrEtbk44GBXJ
 yf/kE8pAkFoZIunY+NuB9vY52MCz+9/XEMYBMYv87QzWHtvaJVX3nZ6DUG5K4PR/O6Hk
 6Mt2SzHCWR4EPHbJdrECEL5+4YUZlI2MLAidEyq/2x3T3BSQZmmDvUAzng74ERLn3n2N
 6YdxrefVqtWRBu00mPjLJshijHic9k6Yraot+yzOsjf1kymaZk0JzKJvZ3fCM+PXvkLc
 fLOQ==
X-Gm-Message-State: AOJu0YxaQjHclP3B34X/t/lxbfe0U6H3Z3XGR/PhkQ6auu/jialGtt37
 F+2+n3KlFD0cZuFTPsHyc/SKJuCEuKtAO2NpmXQLCRLLxUwJg7+8pD7N+sBSb0GG1XKAlf54EDC
 LXTL9llR4F4Mkf++FXDTi1RPnmJaH4eSa
X-Gm-Gg: ASbGncvK+pJWORvXDgg+b1dA9ZTH8+M2MKbWyZzNTXtzZnbRxPQtU6t0E0J0x2GjUeZ
 +4vwTJsxcZo/yGjZ4xTrKZR+FxbvSXvK4Kw==
X-Google-Smtp-Source: AGHT+IFXW06NodzWl1QsXFZId+6Rw4s/TmO+byq5a2TIlhbwfb1+LxNpLaJsi0qa82CJhqCkvoQfS+NJmC6ClbXh63I=
X-Received: by 2002:a17:907:2d8d:b0:aa6:42d8:afac with SMTP id
 a640c23a62f3a-aa6b15df2e6mr234004966b.15.1733921992497; Wed, 11 Dec 2024
 04:59:52 -0800 (PST)
MIME-Version: 1.0
From: Sachin T <sachintu47@HIDDEN>
Date: Wed, 11 Dec 2024 18:29:41 +0530
Message-ID: <CAEktRw2S8S-Cbzxon2Cyjbqkce0HTgC1G5W07cmKpBcUqY5sxw@HIDDEN>
Subject: Incorrect return value for SIGPIPE case
To: bug-grep@HIDDEN
Content-Type: multipart/alternative; boundary="0000000000006e64610628fe2c67"
Received-SPF: pass client-ip=2a00:1450:4864:20::635;
 envelope-from=sachintu47@HIDDEN; helo=mail-ej1-x635.google.com
X-Spam_score_int: -17
X-Spam_score: -1.8
X-Spam_bar: -
X-Spam_report: (-1.8 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1,
 DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1,
 FREEMAIL_ENVFROM_END_DIGIT=0.25, FREEMAIL_FROM=0.001, HTML_MESSAGE=0.001,
 RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001,
 SPF_PASS=-0.001 autolearn=ham autolearn_force=no
X-Spam_action: no action
X-Spam-Score: -1.1 (-)
X-Debbugs-Envelope-To: submit
X-Mailman-Approved-At: Wed, 11 Dec 2024 09:00:41 -0500
X-BeenThere: debbugs-submit <at> debbugs.gnu.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: <debbugs-submit.debbugs.gnu.org>
List-Unsubscribe: <https://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe>
List-Archive: <https://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/>
List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org>
List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help>
List-Subscribe: <https://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe>
Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org
Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org>
X-Spam-Score: -2.1 (--)

--0000000000006e64610628fe2c67
Content-Type: text/plain; charset="UTF-8"

Hi Grep Team,

I am running version 3.11 of grep on the IBM z/OS platform.

I am testing a scenario where grep's output is redirected to a closed pipe.
This was expected to raise a SIGPIPE signal and return an exit status of
141.

Upon inspecting the code, I noticed that the signal is raised by fclose,
which is executed as part of the *clean_up_stdout* handler registered with
atexit. However, on the z/OS platform, when a signal is raised during the
execution of an atexit-registered function, the exit status of the program
is determined by the main program's return status rather than the signal's
exit code. In this case, the exit status is 0, which does not reflect the
SIGPIPE signal.

Could you suggest the preferred solution for handling this situation on the
z/OS platform? Additionally, would it be possible for this behavior to be
addressed as a bug fix specific to the z/OS platform in a future release?

Looking forward to your response.

Regards,
Sachin

--0000000000006e64610628fe2c67
Content-Type: text/html; charset="UTF-8"
Content-Transfer-Encoding: quoted-printable

<div dir=3D"ltr"><p>Hi Grep Team,</p><p>I am running version 3.11 of grep o=
n the IBM z/OS platform.</p><p>I am testing a scenario where grep&#39;s out=
put is redirected to a closed pipe. This was expected to raise a SIGPIPE si=
gnal and return an exit status of 141.</p><p>Upon inspecting the code, I no=
ticed that the signal is raised by <code>fclose</code>, which is executed a=
s part of the <b><code>clean_up_stdout</code></b> handler registered with <=
code>atexit</code>. However, on the z/OS platform, when a signal is raised =
during the execution of an <code>atexit</code>-registered function, the exi=
t status of the program is determined by the main program&#39;s return stat=
us rather than the signal&#39;s exit code. In this case, the exit status is=
 0, which does not reflect the SIGPIPE signal.</p><p>Could you suggest the =
preferred solution for handling this situation on the z/OS platform? Additi=
onally, would it be possible for this behavior to be addressed as a bug fix=
 specific to the z/OS platform in a future release?</p><p>Looking forward t=
o your response.</p><p>Regards,<br>Sachin</p></div>

--0000000000006e64610628fe2c67--




Acknowledgement sent to Sachin T <sachintu47@HIDDEN>:
New bug report received and forwarded. Copy sent to bug-grep@HIDDEN. Full text available.
Report forwarded to bug-grep@HIDDEN:
bug#74788; Package grep. Full text available.
Please note: This is a static page, with minimal formatting, updated once a day.
Click here to see this page with the latest information and nicer formatting.
Last modified: Sun, 12 Jan 2025 05:45:02 UTC

GNU bug tracking system
Copyright (C) 1999 Darren O. Benham, 1997 nCipher Corporation Ltd, 1994-97 Ian Jackson.