[bug #67957] Syntax error messages permanently change after interrupting process/command substitution parsing

anonymous <[email protected]>
Newsgroups gmane.comp.shells.bash.bugs
Message-ID <[email protected]>
URL:
  <https://savannah.gnu.org/bugs/?67957>

                 Summary: Syntax error messages permanently change after
interrupting process/command substitution parsing
                   Group: The GNU Bourne-Again SHell
               Submitter: None
               Submitted: Sun 25 Jan 2026 01:19:57 AM UTC
                Category: None
                Severity: 3 - Normal
                Priority: 5 - Normal
              Item Group: None
                  Status: None
                 Privacy: Public
             Assigned to: None
             Open/Closed: Open
         Discussion Lock: Unlocked


    _______________________________________________________

Follow-up Comments:


-------------------------------------------------------
Date: Sun 25 Jan 2026 01:19:57 AM UTC By: Anonymous
When starting a process substitution (either ``<('' or ``>('') or a
bash-5.3-style command substitution (``${'' or ``${|'') and then accept the
line, it will ask for further input (the PS2 prompt shows).

If this prompt is then aborted using Ctrl-C, you return to the PS1 again, as
if you've never entered the initial substitution.

However, error reporting for syntax errors is now permanently changed as if
the syntax error occurred inside the process/command substitution and never
found a closing parenthesis/brace. Here's a simple interactive session
demonstrating the odd behavior:

```bash5.3
$ env -i bash --norc --noprofile
bash-5.3$ declare -p BASH_VERSINFO
declare -ar BASH_VERSINFO=([0]="5" [1]="3" [2]="0" [3]="1" [4]="release"
[5]="x86_64-redhat-linux-gnu")
bash-5.3$ ;
bash: syntax error near unexpected token `;'
bash-5.3$ <(
> ^C
bash-5.3$ # (Probably) All syntax error messages are now permanently
different.
bash-5.3$ ;
bash: syntax error near unexpected token `;' while looking for matching `)'
bash-5.3$ ${
> ^C
bash-5.3$ ;
bash: syntax error near unexpected token `;' while looking for matching `}'
bash-5.3$ <()
bash-5.3$ ;
bash: syntax error near unexpected token `;' while looking for matching `}'
bash-5.3$ ${ }
bash-5.3$ ;
bash: syntax error near unexpected token `;' while looking for matching `}'
bash-5.3$ }
bash: syntax error near unexpected token `}'
bash-5.3$ ;
bash: syntax error near unexpected token `;' while looking for matching `}'
bash-5.3$
```

Information from bashbug(1) (running on Fedora 43):
```
Machine: x86_64
OS: linux-gnu
Compiler: gcc
Compilation CFLAGS: -O2 -flto=auto -ffat-lto-objects -fexceptions -g
-grecord-gcc-switches -pipe -Wall -Werror=format-security
-Wp,-U_FORTIFY_SOURCE,-D_FORTIFY_SOURCE=3 -Wp,-D_GLIBCXX_ASSERTIONS
-specs=/usr/lib/rpm/redhat/redhat-hardened-cc1 -fstack-protector-strong
-specs=/usr/lib/rpm/redhat/redhat-annobin-cc1  -m64 -march=x86-64
-mtune=generic -fasynchronous-unwind-tables -fstack-clash-protection
-fcf-protection -mtls-dialect=gnu2 -fno-omit-frame-pointer
-mno-omit-leaf-frame-pointer -std=gnu17
uname output: Linux fedora 6.18.5-200.fc43.x86_64 #1 SMP PREEMPT_DYNAMIC Sun
Jan 11 17:09:32 UTC 2026 x86_64 GNU/Linux
Machine Type: x86_64-redhat-linux-gnu

Bash Version: 5.3
Patch Level: 0
Release Status: release
```

I also seems like you cannot close the unmatched parenthesis/brace, at least
not using trivial attempts.







    _______________________________________________________

Reply to this item at:

  <https://savannah.gnu.org/bugs/?67957>

_______________________________________________
Message sent via Savannah
https://savannah.gnu.org/
signature.asc (application/pgp-signature, 228 B)
-----BEGIN PGP SIGNATURE-----

iHUEABYIAB0WIQQk97aszIMMAvLLwm6qLAuaBUf3TgUCaXVvwAAKCRCqLAuaBUf3
TqL8AQCXTecdeHrMIC3m7oiAU89U4SX3/xFVLrTXZ78QvekCYwD/RHNjUeCP6p6X
fo5XGVMFbx7wA+XOSXDDrd/GvyGwBgE=
=DB0w
-----END PGP SIGNATURE-----
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.