Path: csiph.com!au2pb.net!usenet.blueworldhosting.com!feeder01.blueworldhosting.com!news.glorb.com!usenet.stanford.edu!not-for-mail From: Chet Ramey Newsgroups: gnu.bash.bug Subject: Re: posix handling of mapfile: SEGFAULT Date: Mon, 12 Oct 2015 16:23:09 -0400 Lines: 39 Approved: bug-bash@gnu.org Message-ID: References: <561ADB3D.5070302@tlinx.org> Reply-To: chet.ramey@case.edu NNTP-Posting-Host: lists.gnu.org Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit X-Trace: usenet.stanford.edu 1444681403 23139 208.118.235.17 (12 Oct 2015 20:23:23 GMT) X-Complaints-To: action@cs.stanford.edu Cc: chet.ramey@case.edu To: Linda Walsh , bug-bash Envelope-to: bug-bash@gnu.org User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.10; rv:38.0) Gecko/20100101 Thunderbird/38.2.0 In-Reply-To: <561ADB3D.5070302@tlinx.org> X-Junkmail-Status: score=10/60, host=mpv5.cwru.edu X-Junkmail-Whitelist: YES (by domain whitelist at mpv1.tis.cwru.edu) X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.4.x-2.6.x [generic] X-Received-From: 129.22.105.36 X-BeenThere: bug-bash@gnu.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: Bug reports for the GNU Bourne Again SHell List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Xref: csiph.com gnu.bash.bug:11633 On 10/11/15 5:57 PM, Linda Walsh wrote: > This was in the 2nd half of the note in the read&env+POSIX=>SEGFAULT, > but think it got missed by focus on the 1st part. > > # I was doing some syntax testing and decided to try posix mode > # (as it disallows various vague or unclear constructs) > # in the working cases yielded the same results, but > # in 2 cases it returned a SEGFAULT. > >> b= mapfile b <<< x; echo $? > 0 >> declare -p b > Segmentation fault (core dumped) Thanks for the report. I fixed this, and the fix is in the devel branch. > # another example of bash not returning consistent errno results > # ( |;>| ducking while smirking) ok, I vote for disallowing this > # type of result return. > > The 2nd flavor: > >> b= mapfile b a <<< x >> declare -p a b > bash: declare: a: not found > Segmentation fault (core dumped) > # odd, this time it dumped on printing 'b'; still not so great > # status returning there... `mapfile' only takes a single variable name argument, and ignores others. This is identical to the first example. Chet -- ``The lyf so short, the craft so long to lerne.'' - Chaucer ``Ars longa, vita brevis'' - Hippocrates Chet Ramey, ITS, CWRU chet@case.edu http://cnswww.cns.cwru.edu/~chet/