* Re: [PATCH RESEND] powerpc/tools: drop `-o pipefail` in gcc check scripts
2025-09-23 15:32 [PATCH RESEND] powerpc/tools: drop `-o pipefail` in gcc check scripts Jan Stancek
@ 2025-10-06 20:19 ` Justin Forbes
2025-10-30 18:09 ` Jan Stancek
2025-10-31 20:28 ` Josh Poimboeuf
` (3 subsequent siblings)
4 siblings, 1 reply; 12+ messages in thread
From: Justin Forbes @ 2025-10-06 20:19 UTC (permalink / raw)
To: Jan Stancek
Cc: maddy, mpe, linuxppc-dev, npiggin, christophe.leroy,
linux-kernel, joe.lawrence
On Tue, Sep 23, 2025 at 9:31 AM Jan Stancek <jstancek@redhat.com> wrote:
>
> We've been observing rare non-deterministic kconfig failures during
> olddefconfig, where ARCH_USING_PATCHABLE_FUNCTION_ENTRY was getting
> disabled and with it number of other config options that depend on it.
>
> The reason is that gcc-check-fpatchable-function-entry.sh can fail
> if `grep -q` (or scripts/dummy-tools/gcc) is fast enough to exit while
> there is still someone writing on other side of pipe. `pipefail`
> propagates that error up to kconfig.
>
> This can be seen for example with:
> # (set -e; set -o pipefail; yes | grep -q y); echo $?
> 141
>
> or by running the actual check script in loop extensively:
> ----------------------------- 8< -------------------------------
> function kconfig()
> {
> for i in `seq 1 100`; do
> arch/powerpc/tools/gcc-check-fpatchable-function-entry.sh \
> ./scripts/dummy-tools/gcc -mlittle-endian \
> || { echo "Oops"; exit 1; }
> done
> }
>
> for ((i=0; i<$(nproc); i++)); do kconfig & done
> wait; echo "Done"
> ----------------------------- >8 -------------------------------
>
> Fixes: 0f71dcfb4aef ("powerpc/ftrace: Add support for -fpatchable-function-entry")
> Fixes: b71c9ffb1405 ("powerpc: Add arch/powerpc/tools directory")
> Reported-by: Joe Lawrence <joe.lawrence@redhat.com>
> Acked-by: Joe Lawrence <joe.lawrence@redhat.com>
> Signed-off-by: Jan Stancek <jstancek@redhat.com>
> ---
> arch/powerpc/tools/gcc-check-fpatchable-function-entry.sh | 1 -
> arch/powerpc/tools/gcc-check-mprofile-kernel.sh | 1 -
> 2 files changed, 2 deletions(-)
>
> diff --git a/arch/powerpc/tools/gcc-check-fpatchable-function-entry.sh b/arch/powerpc/tools/gcc-check-fpatchable-function-entry.sh
> index 06706903503b..baed467a016b 100755
> --- a/arch/powerpc/tools/gcc-check-fpatchable-function-entry.sh
> +++ b/arch/powerpc/tools/gcc-check-fpatchable-function-entry.sh
> @@ -2,7 +2,6 @@
> # SPDX-License-Identifier: GPL-2.0
>
> set -e
> -set -o pipefail
>
> # To debug, uncomment the following line
> # set -x
> diff --git a/arch/powerpc/tools/gcc-check-mprofile-kernel.sh b/arch/powerpc/tools/gcc-check-mprofile-kernel.sh
> index 73e331e7660e..6193b0ed0c77 100755
> --- a/arch/powerpc/tools/gcc-check-mprofile-kernel.sh
> +++ b/arch/powerpc/tools/gcc-check-mprofile-kernel.sh
> @@ -2,7 +2,6 @@
> # SPDX-License-Identifier: GPL-2.0
>
> set -e
> -set -o pipefail
>
> # To debug, uncomment the following line
> # set -x
> --
> 2.47.1
Would love to see this picked up, it fixes a problem we have run into
with our CI.
Tested-by: Justin M. Forbes <jforbes@fedoraproject.org>
^ permalink raw reply [flat|nested] 12+ messages in thread* Re: [PATCH RESEND] powerpc/tools: drop `-o pipefail` in gcc check scripts
2025-10-06 20:19 ` Justin Forbes
@ 2025-10-30 18:09 ` Jan Stancek
2025-11-10 11:33 ` Christophe Leroy
0 siblings, 1 reply; 12+ messages in thread
From: Jan Stancek @ 2025-10-30 18:09 UTC (permalink / raw)
To: Justin Forbes
Cc: maddy, mpe, linuxppc-dev, npiggin, christophe.leroy,
linux-kernel, joe.lawrence
On Mon, Oct 6, 2025 at 10:19 PM Justin Forbes <jforbes@fedoraproject.org> wrote:
>
> On Tue, Sep 23, 2025 at 9:31 AM Jan Stancek <jstancek@redhat.com> wrote:
> >
> > We've been observing rare non-deterministic kconfig failures during
> > olddefconfig, where ARCH_USING_PATCHABLE_FUNCTION_ENTRY was getting
> > disabled and with it number of other config options that depend on it.
> >
> > The reason is that gcc-check-fpatchable-function-entry.sh can fail
> > if `grep -q` (or scripts/dummy-tools/gcc) is fast enough to exit while
> > there is still someone writing on other side of pipe. `pipefail`
> > propagates that error up to kconfig.
> >
> > This can be seen for example with:
> > # (set -e; set -o pipefail; yes | grep -q y); echo $?
> > 141
> >
> > or by running the actual check script in loop extensively:
> > ----------------------------- 8< -------------------------------
> > function kconfig()
> > {
> > for i in `seq 1 100`; do
> > arch/powerpc/tools/gcc-check-fpatchable-function-entry.sh \
> > ./scripts/dummy-tools/gcc -mlittle-endian \
> > || { echo "Oops"; exit 1; }
> > done
> > }
> >
> > for ((i=0; i<$(nproc); i++)); do kconfig & done
> > wait; echo "Done"
> > ----------------------------- >8 -------------------------------
> >
> > Fixes: 0f71dcfb4aef ("powerpc/ftrace: Add support for -fpatchable-function-entry")
> > Fixes: b71c9ffb1405 ("powerpc: Add arch/powerpc/tools directory")
> > Reported-by: Joe Lawrence <joe.lawrence@redhat.com>
> > Acked-by: Joe Lawrence <joe.lawrence@redhat.com>
> > Signed-off-by: Jan Stancek <jstancek@redhat.com>
> > ---
> > arch/powerpc/tools/gcc-check-fpatchable-function-entry.sh | 1 -
> > arch/powerpc/tools/gcc-check-mprofile-kernel.sh | 1 -
> > 2 files changed, 2 deletions(-)
> >
> > diff --git a/arch/powerpc/tools/gcc-check-fpatchable-function-entry.sh b/arch/powerpc/tools/gcc-check-fpatchable-function-entry.sh
> > index 06706903503b..baed467a016b 100755
> > --- a/arch/powerpc/tools/gcc-check-fpatchable-function-entry.sh
> > +++ b/arch/powerpc/tools/gcc-check-fpatchable-function-entry.sh
> > @@ -2,7 +2,6 @@
> > # SPDX-License-Identifier: GPL-2.0
> >
> > set -e
> > -set -o pipefail
> >
> > # To debug, uncomment the following line
> > # set -x
> > diff --git a/arch/powerpc/tools/gcc-check-mprofile-kernel.sh b/arch/powerpc/tools/gcc-check-mprofile-kernel.sh
> > index 73e331e7660e..6193b0ed0c77 100755
> > --- a/arch/powerpc/tools/gcc-check-mprofile-kernel.sh
> > +++ b/arch/powerpc/tools/gcc-check-mprofile-kernel.sh
> > @@ -2,7 +2,6 @@
> > # SPDX-License-Identifier: GPL-2.0
> >
> > set -e
> > -set -o pipefail
> >
> > # To debug, uncomment the following line
> > # set -x
> > --
> > 2.47.1
>
> Would love to see this picked up, it fixes a problem we have run into
> with our CI.
>
> Tested-by: Justin M. Forbes <jforbes@fedoraproject.org>
Thanks Justin.
Would any maintainers also care to review? Ty.
^ permalink raw reply [flat|nested] 12+ messages in thread* Re: [PATCH RESEND] powerpc/tools: drop `-o pipefail` in gcc check scripts
2025-10-30 18:09 ` Jan Stancek
@ 2025-11-10 11:33 ` Christophe Leroy
2025-11-11 7:13 ` Jan Stancek
0 siblings, 1 reply; 12+ messages in thread
From: Christophe Leroy @ 2025-11-10 11:33 UTC (permalink / raw)
To: Jan Stancek, Justin Forbes
Cc: maddy, mpe, linuxppc-dev, npiggin, linux-kernel, joe.lawrence
Le 30/10/2025 à 19:09, Jan Stancek a écrit :
> On Mon, Oct 6, 2025 at 10:19 PM Justin Forbes <jforbes@fedoraproject.org> wrote:
>>
>> On Tue, Sep 23, 2025 at 9:31 AM Jan Stancek <jstancek@redhat.com> wrote:
>>>
>>> We've been observing rare non-deterministic kconfig failures during
>>> olddefconfig, where ARCH_USING_PATCHABLE_FUNCTION_ENTRY was getting
>>> disabled and with it number of other config options that depend on it.
>>>
>>> The reason is that gcc-check-fpatchable-function-entry.sh can fail
>>> if `grep -q` (or scripts/dummy-tools/gcc) is fast enough to exit while
>>> there is still someone writing on other side of pipe. `pipefail`
>>> propagates that error up to kconfig.
>>>
>>> This can be seen for example with:
>>> # (set -e; set -o pipefail; yes | grep -q y); echo $?
>>> 141
>>>
>>> or by running the actual check script in loop extensively:
>>> ----------------------------- 8< -------------------------------
>>> function kconfig()
>>> {
>>> for i in `seq 1 100`; do
>>> arch/powerpc/tools/gcc-check-fpatchable-function-entry.sh \
>>> ./scripts/dummy-tools/gcc -mlittle-endian \
>>> || { echo "Oops"; exit 1; }
>>> done
>>> }
>>>
>>> for ((i=0; i<$(nproc); i++)); do kconfig & done
>>> wait; echo "Done"
>>> ----------------------------- >8 -------------------------------
>>>
>>> Fixes: 0f71dcfb4aef ("powerpc/ftrace: Add support for -fpatchable-function-entry")
>>> Fixes: b71c9ffb1405 ("powerpc: Add arch/powerpc/tools directory")
>>> Reported-by: Joe Lawrence <joe.lawrence@redhat.com>
>>> Acked-by: Joe Lawrence <joe.lawrence@redhat.com>
>>> Signed-off-by: Jan Stancek <jstancek@redhat.com>
>>> ---
>>> arch/powerpc/tools/gcc-check-fpatchable-function-entry.sh | 1 -
>>> arch/powerpc/tools/gcc-check-mprofile-kernel.sh | 1 -
>>> 2 files changed, 2 deletions(-)
>>>
>>> diff --git a/arch/powerpc/tools/gcc-check-fpatchable-function-entry.sh b/arch/powerpc/tools/gcc-check-fpatchable-function-entry.sh
>>> index 06706903503b..baed467a016b 100755
>>> --- a/arch/powerpc/tools/gcc-check-fpatchable-function-entry.sh
>>> +++ b/arch/powerpc/tools/gcc-check-fpatchable-function-entry.sh
>>> @@ -2,7 +2,6 @@
>>> # SPDX-License-Identifier: GPL-2.0
>>>
>>> set -e
>>> -set -o pipefail
>>>
>>> # To debug, uncomment the following line
>>> # set -x
>>> diff --git a/arch/powerpc/tools/gcc-check-mprofile-kernel.sh b/arch/powerpc/tools/gcc-check-mprofile-kernel.sh
>>> index 73e331e7660e..6193b0ed0c77 100755
>>> --- a/arch/powerpc/tools/gcc-check-mprofile-kernel.sh
>>> +++ b/arch/powerpc/tools/gcc-check-mprofile-kernel.sh
>>> @@ -2,7 +2,6 @@
>>> # SPDX-License-Identifier: GPL-2.0
>>>
>>> set -e
>>> -set -o pipefail
>>>
>>> # To debug, uncomment the following line
>>> # set -x
>>> --
>>> 2.47.1
>>
>> Would love to see this picked up, it fixes a problem we have run into
>> with our CI.
>>
>> Tested-by: Justin M. Forbes <jforbes@fedoraproject.org>
>
> Thanks Justin.
>
> Would any maintainers also care to review? Ty.
>
Is the problem only with those scripts ? I see other scripts using
pipefail in the kernel:
arch/powerpc/tools/gcc-check-fpatchable-function-entry.sh:set -o pipefail
arch/powerpc/tools/gcc-check-mprofile-kernel.sh:set -o pipefail
drivers/gpu/drm/ci/dt-binding-check.sh:set -euxo pipefail
drivers/gpu/drm/ci/dtbs-check.sh:set -euxo pipefail
drivers/gpu/drm/ci/kunit.sh:set -euxo pipefail
drivers/gpu/drm/ci/setup-llvm-links.sh:set -euo pipefail
scripts/check-uapi.sh:set -o pipefail
Christophe
^ permalink raw reply [flat|nested] 12+ messages in thread* Re: [PATCH RESEND] powerpc/tools: drop `-o pipefail` in gcc check scripts
2025-11-10 11:33 ` Christophe Leroy
@ 2025-11-11 7:13 ` Jan Stancek
0 siblings, 0 replies; 12+ messages in thread
From: Jan Stancek @ 2025-11-11 7:13 UTC (permalink / raw)
To: Christophe Leroy
Cc: Justin Forbes, maddy, mpe, linuxppc-dev, npiggin, linux-kernel,
joe.lawrence
On Mon, Nov 10, 2025 at 12:33 PM Christophe Leroy
<christophe.leroy@csgroup.eu> wrote:
>
>
>
> Le 30/10/2025 à 19:09, Jan Stancek a écrit :
> > On Mon, Oct 6, 2025 at 10:19 PM Justin Forbes <jforbes@fedoraproject.org> wrote:
> >>
> >> On Tue, Sep 23, 2025 at 9:31 AM Jan Stancek <jstancek@redhat.com> wrote:
> >>>
> >>> We've been observing rare non-deterministic kconfig failures during
> >>> olddefconfig, where ARCH_USING_PATCHABLE_FUNCTION_ENTRY was getting
> >>> disabled and with it number of other config options that depend on it.
> >>>
> >>> The reason is that gcc-check-fpatchable-function-entry.sh can fail
> >>> if `grep -q` (or scripts/dummy-tools/gcc) is fast enough to exit while
> >>> there is still someone writing on other side of pipe. `pipefail`
> >>> propagates that error up to kconfig.
> >>>
> >>> This can be seen for example with:
> >>> # (set -e; set -o pipefail; yes | grep -q y); echo $?
> >>> 141
> >>>
> >>> or by running the actual check script in loop extensively:
> >>> ----------------------------- 8< -------------------------------
> >>> function kconfig()
> >>> {
> >>> for i in `seq 1 100`; do
> >>> arch/powerpc/tools/gcc-check-fpatchable-function-entry.sh \
> >>> ./scripts/dummy-tools/gcc -mlittle-endian \
> >>> || { echo "Oops"; exit 1; }
> >>> done
> >>> }
> >>>
> >>> for ((i=0; i<$(nproc); i++)); do kconfig & done
> >>> wait; echo "Done"
> >>> ----------------------------- >8 -------------------------------
> >>>
> >>> Fixes: 0f71dcfb4aef ("powerpc/ftrace: Add support for -fpatchable-function-entry")
> >>> Fixes: b71c9ffb1405 ("powerpc: Add arch/powerpc/tools directory")
> >>> Reported-by: Joe Lawrence <joe.lawrence@redhat.com>
> >>> Acked-by: Joe Lawrence <joe.lawrence@redhat.com>
> >>> Signed-off-by: Jan Stancek <jstancek@redhat.com>
> >>> ---
> >>> arch/powerpc/tools/gcc-check-fpatchable-function-entry.sh | 1 -
> >>> arch/powerpc/tools/gcc-check-mprofile-kernel.sh | 1 -
> >>> 2 files changed, 2 deletions(-)
> >>>
> >>> diff --git a/arch/powerpc/tools/gcc-check-fpatchable-function-entry.sh b/arch/powerpc/tools/gcc-check-fpatchable-function-entry.sh
> >>> index 06706903503b..baed467a016b 100755
> >>> --- a/arch/powerpc/tools/gcc-check-fpatchable-function-entry.sh
> >>> +++ b/arch/powerpc/tools/gcc-check-fpatchable-function-entry.sh
> >>> @@ -2,7 +2,6 @@
> >>> # SPDX-License-Identifier: GPL-2.0
> >>>
> >>> set -e
> >>> -set -o pipefail
> >>>
> >>> # To debug, uncomment the following line
> >>> # set -x
> >>> diff --git a/arch/powerpc/tools/gcc-check-mprofile-kernel.sh b/arch/powerpc/tools/gcc-check-mprofile-kernel.sh
> >>> index 73e331e7660e..6193b0ed0c77 100755
> >>> --- a/arch/powerpc/tools/gcc-check-mprofile-kernel.sh
> >>> +++ b/arch/powerpc/tools/gcc-check-mprofile-kernel.sh
> >>> @@ -2,7 +2,6 @@
> >>> # SPDX-License-Identifier: GPL-2.0
> >>>
> >>> set -e
> >>> -set -o pipefail
> >>>
> >>> # To debug, uncomment the following line
> >>> # set -x
> >>> --
> >>> 2.47.1
> >>
> >> Would love to see this picked up, it fixes a problem we have run into
> >> with our CI.
> >>
> >> Tested-by: Justin M. Forbes <jforbes@fedoraproject.org>
> >
> > Thanks Justin.
> >
> > Would any maintainers also care to review? Ty.
> >
>
> Is the problem only with those scripts ? I see other scripts using
> pipefail in the kernel:
As far as kconfig goes, we've observed this issue only with the two
gcc-check scripts.
>
> arch/powerpc/tools/gcc-check-fpatchable-function-entry.sh:set -o pipefail
> arch/powerpc/tools/gcc-check-mprofile-kernel.sh:set -o pipefail
> drivers/gpu/drm/ci/dt-binding-check.sh:set -euxo pipefail
> drivers/gpu/drm/ci/dtbs-check.sh:set -euxo pipefail
> drivers/gpu/drm/ci/kunit.sh:set -euxo pipefail
> drivers/gpu/drm/ci/setup-llvm-links.sh:set -euo pipefail
> scripts/check-uapi.sh:set -o pipefail
>
> Christophe
>
^ permalink raw reply [flat|nested] 12+ messages in thread
* Re: [PATCH RESEND] powerpc/tools: drop `-o pipefail` in gcc check scripts
2025-09-23 15:32 [PATCH RESEND] powerpc/tools: drop `-o pipefail` in gcc check scripts Jan Stancek
2025-10-06 20:19 ` Justin Forbes
@ 2025-10-31 20:28 ` Josh Poimboeuf
2025-11-12 22:56 ` Josh Poimboeuf
` (2 subsequent siblings)
4 siblings, 0 replies; 12+ messages in thread
From: Josh Poimboeuf @ 2025-10-31 20:28 UTC (permalink / raw)
To: Jan Stancek
Cc: maddy, mpe, linuxppc-dev, npiggin, christophe.leroy,
linux-kernel, joe.lawrence
On Tue, Sep 23, 2025 at 05:32:16PM +0200, Jan Stancek wrote:
> We've been observing rare non-deterministic kconfig failures during
> olddefconfig, where ARCH_USING_PATCHABLE_FUNCTION_ENTRY was getting
> disabled and with it number of other config options that depend on it.
>
> The reason is that gcc-check-fpatchable-function-entry.sh can fail
> if `grep -q` (or scripts/dummy-tools/gcc) is fast enough to exit while
> there is still someone writing on other side of pipe. `pipefail`
> propagates that error up to kconfig.
>
> This can be seen for example with:
> # (set -e; set -o pipefail; yes | grep -q y); echo $?
> 141
>
> or by running the actual check script in loop extensively:
> ----------------------------- 8< -------------------------------
> function kconfig()
> {
> for i in `seq 1 100`; do
> arch/powerpc/tools/gcc-check-fpatchable-function-entry.sh \
> ./scripts/dummy-tools/gcc -mlittle-endian \
> || { echo "Oops"; exit 1; }
> done
> }
>
> for ((i=0; i<$(nproc); i++)); do kconfig & done
> wait; echo "Done"
> ----------------------------- >8 -------------------------------
>
> Fixes: 0f71dcfb4aef ("powerpc/ftrace: Add support for -fpatchable-function-entry")
> Fixes: b71c9ffb1405 ("powerpc: Add arch/powerpc/tools directory")
> Reported-by: Joe Lawrence <joe.lawrence@redhat.com>
> Acked-by: Joe Lawrence <joe.lawrence@redhat.com>
> Signed-off-by: Jan Stancek <jstancek@redhat.com>
Ooh, that is nasty...
The fix looks obviously correct: pipefail isn't needed in these cases
anyway since an earlier pipe failure (e.g., compile error) would result
in EOF getting piped to grep, causing it to returning an error
regardless.
Reviewed-by: Josh Poimboeuf <jpoimboe@kernel.org>
--
Josh
^ permalink raw reply [flat|nested] 12+ messages in thread* Re: [PATCH RESEND] powerpc/tools: drop `-o pipefail` in gcc check scripts
2025-09-23 15:32 [PATCH RESEND] powerpc/tools: drop `-o pipefail` in gcc check scripts Jan Stancek
2025-10-06 20:19 ` Justin Forbes
2025-10-31 20:28 ` Josh Poimboeuf
@ 2025-11-12 22:56 ` Josh Poimboeuf
2025-11-20 20:15 ` Josh Poimboeuf
2025-12-03 3:59 ` Naveen N Rao
2025-12-27 4:23 ` Madhavan Srinivasan
4 siblings, 1 reply; 12+ messages in thread
From: Josh Poimboeuf @ 2025-11-12 22:56 UTC (permalink / raw)
To: maddy, mpe, linuxppc-dev
Cc: npiggin, christophe.leroy, linux-kernel, joe.lawrence, Jan Stancek
On Tue, Sep 23, 2025 at 05:32:16PM +0200, Jan Stancek wrote:
> We've been observing rare non-deterministic kconfig failures during
> olddefconfig, where ARCH_USING_PATCHABLE_FUNCTION_ENTRY was getting
> disabled and with it number of other config options that depend on it.
>
> The reason is that gcc-check-fpatchable-function-entry.sh can fail
> if `grep -q` (or scripts/dummy-tools/gcc) is fast enough to exit while
> there is still someone writing on other side of pipe. `pipefail`
> propagates that error up to kconfig.
Ping? This fixes a nasty build bug, any objections to merging?
--
Josh
^ permalink raw reply [flat|nested] 12+ messages in thread
* Re: [PATCH RESEND] powerpc/tools: drop `-o pipefail` in gcc check scripts
2025-11-12 22:56 ` Josh Poimboeuf
@ 2025-11-20 20:15 ` Josh Poimboeuf
2025-12-02 18:25 ` Josh Poimboeuf
0 siblings, 1 reply; 12+ messages in thread
From: Josh Poimboeuf @ 2025-11-20 20:15 UTC (permalink / raw)
To: maddy, mpe, linuxppc-dev
Cc: npiggin, christophe.leroy, linux-kernel, joe.lawrence, Jan Stancek
On Wed, Nov 12, 2025 at 02:56:05PM -0800, Josh Poimboeuf wrote:
> On Tue, Sep 23, 2025 at 05:32:16PM +0200, Jan Stancek wrote:
> > We've been observing rare non-deterministic kconfig failures during
> > olddefconfig, where ARCH_USING_PATCHABLE_FUNCTION_ENTRY was getting
> > disabled and with it number of other config options that depend on it.
> >
> > The reason is that gcc-check-fpatchable-function-entry.sh can fail
> > if `grep -q` (or scripts/dummy-tools/gcc) is fast enough to exit while
> > there is still someone writing on other side of pipe. `pipefail`
> > propagates that error up to kconfig.
>
> Ping? This fixes a nasty build bug, any objections to merging?
Ping?
--
Josh
^ permalink raw reply [flat|nested] 12+ messages in thread
* Re: [PATCH RESEND] powerpc/tools: drop `-o pipefail` in gcc check scripts
2025-11-20 20:15 ` Josh Poimboeuf
@ 2025-12-02 18:25 ` Josh Poimboeuf
0 siblings, 0 replies; 12+ messages in thread
From: Josh Poimboeuf @ 2025-12-02 18:25 UTC (permalink / raw)
To: maddy, mpe, linuxppc-dev
Cc: npiggin, christophe.leroy, linux-kernel, joe.lawrence, Jan Stancek
On Thu, Nov 20, 2025 at 12:15:58PM -0800, Josh Poimboeuf wrote:
> On Wed, Nov 12, 2025 at 02:56:05PM -0800, Josh Poimboeuf wrote:
> > On Tue, Sep 23, 2025 at 05:32:16PM +0200, Jan Stancek wrote:
> > > We've been observing rare non-deterministic kconfig failures during
> > > olddefconfig, where ARCH_USING_PATCHABLE_FUNCTION_ENTRY was getting
> > > disabled and with it number of other config options that depend on it.
> > >
> > > The reason is that gcc-check-fpatchable-function-entry.sh can fail
> > > if `grep -q` (or scripts/dummy-tools/gcc) is fast enough to exit while
> > > there is still someone writing on other side of pipe. `pipefail`
> > > propagates that error up to kconfig.
> >
> > Ping? This fixes a nasty build bug, any objections to merging?
>
> Ping?
Madhavan, Michael,
Ping?
--
Josh
^ permalink raw reply [flat|nested] 12+ messages in thread
* Re: [PATCH RESEND] powerpc/tools: drop `-o pipefail` in gcc check scripts
2025-09-23 15:32 [PATCH RESEND] powerpc/tools: drop `-o pipefail` in gcc check scripts Jan Stancek
` (2 preceding siblings ...)
2025-11-12 22:56 ` Josh Poimboeuf
@ 2025-12-03 3:59 ` Naveen N Rao
2025-12-09 4:01 ` Madhavan Srinivasan
2025-12-27 4:23 ` Madhavan Srinivasan
4 siblings, 1 reply; 12+ messages in thread
From: Naveen N Rao @ 2025-12-03 3:59 UTC (permalink / raw)
To: Jan Stancek, Michael Ellerman, Madhavan Srinivasan
Cc: linuxppc-dev, npiggin, christophe.leroy, linux-kernel, joe.lawrence
On Tue, Sep 23, 2025 at 05:32:16PM +0200, Jan Stancek wrote:
> We've been observing rare non-deterministic kconfig failures during
> olddefconfig, where ARCH_USING_PATCHABLE_FUNCTION_ENTRY was getting
> disabled and with it number of other config options that depend on it.
>
> The reason is that gcc-check-fpatchable-function-entry.sh can fail
> if `grep -q` (or scripts/dummy-tools/gcc) is fast enough to exit while
> there is still someone writing on other side of pipe. `pipefail`
> propagates that error up to kconfig.
>
> This can be seen for example with:
> # (set -e; set -o pipefail; yes | grep -q y); echo $?
> 141
>
> or by running the actual check script in loop extensively:
> ----------------------------- 8< -------------------------------
> function kconfig()
> {
> for i in `seq 1 100`; do
> arch/powerpc/tools/gcc-check-fpatchable-function-entry.sh \
> ./scripts/dummy-tools/gcc -mlittle-endian \
> || { echo "Oops"; exit 1; }
> done
> }
>
> for ((i=0; i<$(nproc); i++)); do kconfig & done
> wait; echo "Done"
> ----------------------------- >8 -------------------------------
>
> Fixes: 0f71dcfb4aef ("powerpc/ftrace: Add support for -fpatchable-function-entry")
> Fixes: b71c9ffb1405 ("powerpc: Add arch/powerpc/tools directory")
The latter fixes tag should probably tag one of the below commits which
actually introduced pipefail, or introduced it in Kconfig:
Fixes: 8c50b72a3b4f ("powerpc/ftrace: Add Kconfig & Make glue for mprofile-kernel")
or:
Fixes: abba759796f9 ("powerpc/kbuild: move -mprofile-kernel check to Kconfig")
> Reported-by: Joe Lawrence <joe.lawrence@redhat.com>
> Acked-by: Joe Lawrence <joe.lawrence@redhat.com>
> Signed-off-by: Jan Stancek <jstancek@redhat.com>
> ---
> arch/powerpc/tools/gcc-check-fpatchable-function-entry.sh | 1 -
> arch/powerpc/tools/gcc-check-mprofile-kernel.sh | 1 -
> 2 files changed, 2 deletions(-)
Other than that, thanks for fixing this. This LGTM.
Reviewed-by: Naveen N Rao (AMD) <naveen@kernel.org>
Maddy/Michael,
Can you please pick this up?
Thanks,
Naveen
^ permalink raw reply [flat|nested] 12+ messages in thread* Re: [PATCH RESEND] powerpc/tools: drop `-o pipefail` in gcc check scripts
2025-12-03 3:59 ` Naveen N Rao
@ 2025-12-09 4:01 ` Madhavan Srinivasan
0 siblings, 0 replies; 12+ messages in thread
From: Madhavan Srinivasan @ 2025-12-09 4:01 UTC (permalink / raw)
To: Naveen N Rao, Jan Stancek, Michael Ellerman
Cc: linuxppc-dev, npiggin, christophe.leroy, linux-kernel, joe.lawrence
On 12/3/25 9:29 AM, Naveen N Rao wrote:
> On Tue, Sep 23, 2025 at 05:32:16PM +0200, Jan Stancek wrote:
>> We've been observing rare non-deterministic kconfig failures during
>> olddefconfig, where ARCH_USING_PATCHABLE_FUNCTION_ENTRY was getting
>> disabled and with it number of other config options that depend on it.
>>
>> The reason is that gcc-check-fpatchable-function-entry.sh can fail
>> if `grep -q` (or scripts/dummy-tools/gcc) is fast enough to exit while
>> there is still someone writing on other side of pipe. `pipefail`
>> propagates that error up to kconfig.
>>
>> This can be seen for example with:
>> # (set -e; set -o pipefail; yes | grep -q y); echo $?
>> 141
>>
>> or by running the actual check script in loop extensively:
>> ----------------------------- 8< -------------------------------
>> function kconfig()
>> {
>> for i in `seq 1 100`; do
>> arch/powerpc/tools/gcc-check-fpatchable-function-entry.sh \
>> ./scripts/dummy-tools/gcc -mlittle-endian \
>> || { echo "Oops"; exit 1; }
>> done
>> }
>>
>> for ((i=0; i<$(nproc); i++)); do kconfig & done
>> wait; echo "Done"
>> ----------------------------- >8 -------------------------------
>>
>> Fixes: 0f71dcfb4aef ("powerpc/ftrace: Add support for -fpatchable-function-entry")
>> Fixes: b71c9ffb1405 ("powerpc: Add arch/powerpc/tools directory")
> The latter fixes tag should probably tag one of the below commits which
> actually introduced pipefail, or introduced it in Kconfig:
> Fixes: 8c50b72a3b4f ("powerpc/ftrace: Add Kconfig & Make glue for mprofile-kernel")
> or:
> Fixes: abba759796f9 ("powerpc/kbuild: move -mprofile-kernel check to Kconfig")
>
>> Reported-by: Joe Lawrence <joe.lawrence@redhat.com>
>> Acked-by: Joe Lawrence <joe.lawrence@redhat.com>
>> Signed-off-by: Jan Stancek <jstancek@redhat.com>
>> ---
>> arch/powerpc/tools/gcc-check-fpatchable-function-entry.sh | 1 -
>> arch/powerpc/tools/gcc-check-mprofile-kernel.sh | 1 -
>> 2 files changed, 2 deletions(-)
> Other than that, thanks for fixing this. This LGTM.
> Reviewed-by: Naveen N Rao (AMD) <naveen@kernel.org>
>
> Maddy/Michael,
> Can you please pick this up?
Thanks naveen. Will put it in one of the -rc
Maddy
>
>
> Thanks,
> Naveen
>
^ permalink raw reply [flat|nested] 12+ messages in thread
* Re: [PATCH RESEND] powerpc/tools: drop `-o pipefail` in gcc check scripts
2025-09-23 15:32 [PATCH RESEND] powerpc/tools: drop `-o pipefail` in gcc check scripts Jan Stancek
` (3 preceding siblings ...)
2025-12-03 3:59 ` Naveen N Rao
@ 2025-12-27 4:23 ` Madhavan Srinivasan
4 siblings, 0 replies; 12+ messages in thread
From: Madhavan Srinivasan @ 2025-12-27 4:23 UTC (permalink / raw)
To: mpe, linuxppc-dev, Jan Stancek
Cc: npiggin, linux-kernel, joe.lawrence, Christophe Leroy
On Tue, 23 Sep 2025 17:32:16 +0200, Jan Stancek wrote:
>
Applied to powerpc/fixes.
[1/1] powerpc/tools: drop `-o pipefail` in gcc check scripts
https://git.kernel.org/powerpc/c/f1164534ad62f0cc247d99650b07bd59ad2a49fd
cheers
^ permalink raw reply [flat|nested] 12+ messages in thread