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


Groups > gnu.bash.bug > #16567

Re: Segfault in Bash

From Greg Wooledge <wooledg@eeg.ccf.org>
Newsgroups gnu.bash.bug
Subject Re: Segfault in Bash
Date 2020-07-14 08:23 -0400
Message-ID <mailman.189.1594729405.2306.bug-bash@gnu.org> (permalink)
References <CAH8yC8nB5fhvvdD1bCUsgNzNTni4ixkjDbfeKQLNVqZ71HpxBg@mail.gmail.com> <20200714114907.GZ22833@eeg.ccf.org> <20200714122320.GB22833@eeg.ccf.org>

Show all headers | View raw


> > IFS="" find "$dir" -name '*.so' -print | while read -r file
> > do
> >     if ! $(echo "$file" | grep -E "*.so$"); then continue; fi
> >     echo "library: $file"
> > 
> > done

Also, I forgot to point out: your "if" line is executing each of
the shared libraries that you find.  Every one of them matches the
grep check, and since you enclosed the check in a command substitution,
the output of grep (which is the pathname) is *executed* as a command.

That's probably where your segfault is happening.

Once you remove this completely unnecessary and incorrectly written
check, the segfaults from running random shared library files as
commands will stop happening.

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


Thread

Re: Segfault in Bash Greg Wooledge <wooledg@eeg.ccf.org> - 2020-07-14 08:23 -0400

csiph-web