## One liner to reproduce the bug on fedora42:
$ f=~/f; echo color: red > $f; foo=$( awk '/^color: / {print $2}' ~/f );set
-x;cat
+ cat
cat: -: input file is output file
## host withe the issue
$ ( set -x;uname -a;rpm -qi bash|grep -E 'Version|Release' )
+ uname -a
Linux epjdn.zq3q.org 6.17.9-200.fc42.x86_64 #1 SMP PREEMPT_DYNAMIC Mon Nov 24
22:28:05 UTC 2025 x86_64 GNU/Linux
+ rpm -qi bash
+ grep -E 'Version|Release'
Version : 5.2.37
Release : 1.fc42
gls has mail
$ ( set -x;uname -a;(rpm -qi bash; rpm -qi gawk ) |grep -E
'Name|Version|Release' )
+ uname -a
Linux epjdn.zq3q.org 6.17.9-200.fc42.x86_64 #1 SMP PREEMPT_DYNAMIC Mon Nov 24
22:28:05 UTC 2025 x86_64 GNU/Linux
+ rpm -qi bash
+ grep -E 'Name|Version|Release'
Name : bash
Version : 5.2.37
Release : 1.fc42
+ rpm -qi gawk
Name : gawk
Version : 5.3.1
Release : 1.fc42
$
## my bug report | https://bugzilla.redhat.com/show_bug.cgi?id=2417885
Below is and edited snip from lynx
https://bugzilla.redhat.com/show_bug.cgi?id=2417885. I left out the link
reference section.
@@@ https://bugzilla.redhat.com/show_bug.cgi?id=2417885 @@@
:2025-12-11_Thu:Se6Wgvxa: op{
[34]Bug 2417885 - Regression: Bash command substitution (`$()`) running `gawk`
permanently corrupts shell file descriptors (FD 0/1), even with explicit `<
/dev/null` redirection.
[35]Summary: Regression: Bash command substitution (`$()`) running `gawk`
permanently corr...
[39]Product: Fedora
[40]Classification: Fedora
[41]Component: gawk
[42]Sub Component: [---]
[43]Version: 42
[44]Hardware: Unspecified
[45]OS: Linux
[46]Priority: unspecified
[47]Severity: medium
[48]Target Milestone: ---
[49]Assignee: Jakub Martisko
[50]QA Contact: Fedora Extras Quality Assurance
[58]Reported: 2025-11-30 17:19 UTC by Tom R
[59]Modified: 2025-11-30 17:20 UTC ([60]History)
[65]Description Tom R 2025-11-30 17:19:05 UTC
# Fedora Bug Report: gawk/Pipe Corruption (Fedora 42)
1. TITLE (One-Line Summary)
Regression: Bash command substitution (`$()`) running `gawk` permanently
corrupts shell file descriptors (FD 0/1), even with explicit `< /dev/null`
redirection.
2. ENVIRONMENT DETAILS
• OS: Fedora 42 (x86_64)
• Kernel: `6.17.8-200.fc42.x86_64`
• Package: `gawk-5.3.1-1.fc42.x86_64`
• Shell: `bash` (version 5.2 or similar)
• Behavior: When `gawk` is executed in a command substitution (`$()`), the
parent shell's I/O streams are permanently linked (`stdin` == `stdout`),
causing safety checks in other programs like `cat` to fail.
3. STEPS TO REPRODUCE
1. Start a fresh interactive terminal session.
2. Create a simple configuration file: ```bash $ echo "key value" >
test.cfg ```
3. Run the command substitution using `awk`, explicitly redirecting its
Standard Input (FD 0) to `/dev/null`: ```bash $ test_var=$(awk '/^key / {print
$2}' test.cfg < /dev/null) ```
4. Immediately try to run the standard, interactive `cat` command:
```bash $ cat ```
4. ACTUAL RESULTS
The `cat` command fails with the I/O safety error:
``` cat: -: input file is output file ```
5. EXPECTED RESULTS
The command substitution should run silently, and the `cat` command should wait
for keyboard input (the standard interactive behavior).
6. CRITICAL DIAGNOSTIC INFORMATION
The bug is not an `awk` default behavior issue. The corruption occurs despite
the explicit redirection of FD 0 using `< /dev/null`. This implies a deeper
issue in how the Bash pipe mechanism interacts with the `gawk` executable in
this specific Fedora environment.
A functionally similar command using `sed` does NOT cause the error, even when
run inside the same command substitution:
```bash $ test_var=$(sed -n '/^key /p;q' test.cfg) $ cat # This works fine and
does not trigger the error. ```
This suggests an internal conflict within the `gawk` binary itself or how the
operating system handles the file descriptors when `gawk` is initialized inside
a pipeline. The bug is a regression because this behavior did not occur in
previous Fedora versions.
Reproducible: Always
Steps to Reproduce:
3. STEPS TO REPRODUCE
1. Start a fresh interactive terminal session.
2. Create a simple configuration file: ```bash $ echo "key value" >
test.cfg ```
3. Run the command substitution using `awk`, explicitly redirecting its
Standard Input (FD 0) to `/dev/null`: ```bash $ test_var=$(awk '/^key / {print
$2}' test.cfg < /dev/null) ```
4. Immediately try to run the standard, interactive `cat` command:
```bash $ cat ```
4. ACTUAL RESULTS
The `cat` command fails with the I/O safety error:
``` cat: -: input file is output file ```
5. EXPECTED RESULTS
The command substitution should run silently, and the `cat` command should wait
for keyboard input (the standard interactive behavior).
6. CRITICAL DIAGNOSTIC INFORMATION
The bug is not an `awk` default behavior issue. The corruption occurs despite
the explicit redirection of FD 0 using `< /dev/null`. This implies a deeper
issue in how the Bash pipe mechanism interacts with the `gawk` executable in
this specific Fedora environment.
A functionally similar command using `sed` does NOT cause the error, even when
run inside the same command substitution:
3. STEPS TO REPRODUCE
1. Start a fresh interactive terminal session.
2. Create a simple configuration file: ```bash $ echo "key value" >
test.cfg ```
3. Run the command substitution using `awk`, explicitly redirecting its
Standard Input (FD 0) to `/dev/null`: ```bash $ test_var=$(awk '/^key / {print
$2}' test.cfg < /dev/null) ```
4. Immediately try to run the standard, interactive `cat` command:
```bash $ cat ```
4. ACTUAL RESULTS
The `cat` command fails with the I/O safety error:
``` cat: -: input file is output file ```
5. EXPECTED RESULTS
The command substitution should run silently, and the `cat` command should wait
for keyboard input (the standard interactive behavior).
6. CRITICAL DIAGNOSTIC INFORMATION
The bug is not an `awk` default behavior issue. The corruption occurs despite
the explicit redirection of FD 0 using `< /dev/null`. This implies a deeper
issue in how the Bash pipe mechanism interacts with the `gawk` executable in
this specific Fedora environment.
A functionally similar command using `sed` does NOT cause the error, even when
run inside the same command substitution:
-- @@@ https://bugzilla.redhat.com/show_bug.cgi?id=2417885 @@@
:2025-12-11_Thu:Se6Wgvxa: fin}