bug-bash
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Segmentation fault bash 4.3.022


From: Geir Hauge
Subject: Re: Segmentation fault bash 4.3.022
Date: Mon, 11 Aug 2014 21:05:39 +0200

2014-08-11 20:47 GMT+02:00 Greg Wooledge <address@hidden>:

> On Tue, Aug 12, 2014 at 02:21:18AM +0800, lolilolicon wrote:
> > The following code segfaults when run by bash 4.3.022
> >
> >   set -E
> >   shopt -s lastpipe
> >   trap -- 'true' ERR
> >   true | { true | false; }
>
> I could not reproduce this, on HP-UX or Linux.  I tried from an
> interactive shell, just typing these commands.  Did you use a script?
> Is your bash 4.3.22 from an OS distribution package, or did you compile
> it yourself?  If it's a script, is BASH_ENV set?  Can you still trigger
> the bug with an interactive shell, or with an interactive shell started
> with --norc?
>

I can reproduce this on linux for non-interactive bash (which makes
sense since lastpipe doesn't do much when set -m is in effect), but it's
not limited to 4.3.22, and set -E does not appear to affect the outcome.

$ bash42 -c 'echo "$BASH_VERSION";shopt -s lastpipe; trap -- "printf x"
ERR; true | { true | false; }'
4.2.47(2)-release
xxSegmentation fault

$ bash43 -c 'shopt -s lastpipe; trap -- "printf x" ERR; true | { true |
false; }'
4.3.22(1)-release
xxSegmentation fault

And lastly, in interactive mode
$ set +m; shopt -s lastpipe; trap -- "printf x" ERR; true | { true | false;
}
xxx

Can't quite understand why it would trigger the ERR trap thrice.

-- 
Geir Hauge


reply via email to

[Prev in Thread] Current Thread [Next in Thread]