Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > gnu.bash.bug > #15284

syntax errors produced by interaction between process substitution and a SIGCHLD trap

From Travis Everett <travis.a.everett@gmail.com>
Newsgroups gnu.bash.bug
Subject syntax errors produced by interaction between process substitution and a SIGCHLD trap
Date 2019-07-31 13:35 -0500
Message-ID <mailman.373.1564598170.1985.bug-bash@gnu.org> (permalink)
References <CAC=jSUVMXPSD=oOhi=9ha=4FeUBsbci3SOVPq0VQAFxWXVzBwQ@mail.gmail.com>

Show all headers | View raw


Configuration Information [Automatically generated, do not change]:
Machine: x86_64
OS: darwin17.7.0
Compiler: clang
Compilation CFLAGS: -g -O2 -Wno-parentheses -Wno-format-security
uname output: Darwin 6841b968 18.6.0 Darwin Kernel Version 18.6.0: Thu Apr
25 23:16:27 PDT 2019; root:xnu-4903.261.4~2/RELEASE_X86_64 x86_64
Machine Type: x86_64-apple-darwin17.7.0

Bash Version: 5.0
Patch Level: 7
Release Status: release

Description:
       I stumbled into an odd interaction between process substitution and
a SIGCHLD trap that causes syntax errors in otherwise valid commands.

       I managed to pare this down to a very minimal reproduction. I also
included a more realistic command at the end just in case I'm mistaken
about the minimal reproduction showing exactly the same issue.

       I see the same behavior in bash 4.4.23(1)-release and do *not* see
it in the macos system bash 3.2.57(1)-release.

Repeat-By:
        $ bash5 --norc --noprofile
        bash-5.0$ trap '$()' SIGCHLD
        bash-5.0$ $(:) $(:)
        bash: command substitution: line 3: syntax error near unexpected
token `)'
        bash: command substitution: line 3: `:)'

        # Note that backticks don't cause the same trouble
        bash-5.0$ `:` `:`

        # in case there are multiple issues here
        # I found it while composing a command like this (to expand a set
of globs, one per line, saved in file "exclude")
        bash-5.0$ /usr/bin/env cat <(printf "%s\n" $(< exclude ));
        bash: command substitution: line 6: syntax error near unexpected
token `)'
        bash: command substitution: line 6: `< exclude ));'

Back to gnu.bash.bug | Previous | Next | Find similar | Unroll thread


Thread

syntax errors produced by interaction between process substitution and a SIGCHLD trap Travis Everett <travis.a.everett@gmail.com> - 2019-07-31 13:35 -0500

csiph-web