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


Groups > gnu.bash.bug > #11633

Re: posix handling of mapfile: SEGFAULT

From Chet Ramey <chet.ramey@case.edu>
Newsgroups gnu.bash.bug
Subject Re: posix handling of mapfile: SEGFAULT
Date 2015-10-12 16:23 -0400
Message-ID <mailman.168.1444681403.7904.bug-bash@gnu.org> (permalink)
References <561ADB3D.5070302@tlinx.org>

Show all headers | View raw


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/

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


Thread

Re: posix handling of mapfile: SEGFAULT Chet Ramey <chet.ramey@case.edu> - 2015-10-12 16:23 -0400

csiph-web