Discussion:
Bash-5.0-beta2 available for download
Chet Ramey
2018-11-27 18:24:38 UTC
Permalink
The second beta release of bash-5.0 is now available with the URL

ftp://ftp.cwru.edu/pub/bash/bash-5.0-beta2.tar.gz

and from the bash-5.0-testing branch in the bash git repository
(http://git.savannah.gnu.org/cgit/bash.git/log/?h=bash-5.0-testing).

This tar file includes the formatted documentation (you should be able to
generate updated versions yourself).

This release fixes several outstanding bugs in bash-4.4 and introduces several
new features. The most significant bug fixes are an overhaul of how
nameref variables resolve and a number of potential out-of-bounds memory
errors discovered via fuzzing. There are a number of changes to the
expansion of $@ and $* in various contexts where word splitting is not
performed to conform to a Posix standard interpretation, and additional
changes to resolve corner cases for Posix conformance.

The most notable new features are several new shell variables: BASH_ARGV0,
EPOCHSECONDS, and EPOCHREALTIME. The `history' builtin can remove ranges of
history entries and understands negative arguments as offsets from the end
of the history list. There is an option to allow local variables to inherit
the value of a variable with the same name at a preceding scope. There is
a new shell option that, when enabled, causes the shell to attempt to
expand associative array subscripts only once (this is an issue when they
are used in arithmetic expressions). The `globasciiranges' shell option
is now enabled by default; it can be set to off by default at configuration
time.

There are a few incompatible changes between bash-4.4 and bash-5.0. The
changes to how nameref variables are resolved means that some uses of
namerefs will behave differently, though I have tried to minimize the
compatibility issues. By default, the shell only sets BASH_ARGC and
BASH_ARGV at startup if extended debugging mode is enabled; it was an
oversight that it was set unconditionally and caused performance issues
when scripts were passed large numbers of arguments.

`bashbug' may be used to report bugs with this version. It will send
mail to ***@case.edu if the shell's `release status' is alpha or
beta.

As always, thanks for your help.

Chet

+========== CHANGES ==========+
This document details the changes between this version, bash-5.0-beta2, and
the previous version, bash-5.0-beta.

1. Changes to Bash

a. Fixed a bug that could cause a seg fault while parsing a subshell command
inside a command substitution.

b. Fixed several small memory leaks uncovered by coverity.

c. Fixed a problem with command substitution inside an interactive shell that
could cause the parent to receive a SIGHUP.

d. Fixed a problem with using `*' and `@' as subscripts when assigning values
to an associative array with assoc_expand_once enabled.

e. Fixed a bug that could cause a huge memory allocation when completing a
word beginning with an invalid tilde expansion.

f. Cleaned up some incompatiblities with bash-4.4 when expanding indexed array
subscripts used in arithmetic expansions when assoc_expand_once is enabled.

g. The ${***@a} expansion will display attributes even if `parameter' is
unset.

h. Fixed a bug that caused the output of `set' to cut off some variables before
printing the value.

i. Treat a failure to assign a variable when using the ${x:=value} expansion
as an expansion error, so non-interactive posix-mode shells exit

j. Fixed a problem when expanding $* in a context where word splitting is not
performed when IFS is NULL.

k. Temp files used to store here documents are forced readable, no matter what
the user's umask says.

l. Fixed a problem where an interrupted brace expansion could cause the shell
to attempt to free an invalid memory location.

m. Make sure to check for any terminating signals after running a trap
handler; don't wait until the next time we process traps.

n. Fixed a bug that caused "return" to act like a special builtin with respect
to variable assignments even when preceded by "command".

o. POSIX-mode shells now return failure if the cd builtin fails due to the
absolute directory name being longer than PATH_MAX, instead of trying
again with a relative pathname.

p. Fixed a problem with FUNCNAME occasionally being visible when not executing
a shell function.

q. Fixed a problem with the expansions performed on the WORD in the case
command.

r. Fixed a slight POSIX compatibility when removing "IFS whitespace" during
word splitting and the read builtin.

s. Fixed a problem with expanding an array with subscript `*' when all the
elements expand to the empty string, and making sure the expansion honors
the `:' specifier.

2. Changes to Readline

a. Fixed a bug with adding multibyte characters to an incremental search string.

b. Fixed a bug with redoing text insertions in vi mode.

c. Fixed a bug with pasting text into an incremental search string if bracketed
paste mode is enabled. ESC cannot be one of the incremental search
terminator characters for this to work.

d. Fixed a bug with anchored search patterns when performing searches in vi
mode.

3. New Features in Bash

a. Associative and indexed arrays now allow subscripts consisting solely of
whitespace.

b. `checkwinsize' is now enabled by default.

c. The `localvar_unset' shopt option is now visible and documented.

d. The `progcomp_alias' shopt option is now visible and documented.

e. The signal name processing code now understands `SIGRTMIN+n' all the way
up to SIGRTMAX.

f. There is a new `seq' loadable builtin.

g. Trap execution now honors the (internal) max invocations of `eval', since
traps are supposed to be executed as if using `eval'.

h. The $_ variable doesn't change when the shell executes a command that forks.

i. The `kill' builtin now supports -sSIGNAME and -nSIGNUM, even though
conforming applications aren't supposed to use them.

j. POSIX mode now enables the `shift_verbose' option.

4. New Features in Readline

a. Readline now allows application-defined keymap names; there is a new public
function, rl_set_keymap_name(), to do that.

b. The "Insert" keypad key, if available, now puts readline into overwrite
mode.
--
``The lyf so short, the craft so long to lerne.'' - Chaucer
``Ars longa, vita brevis'' - Hippocrates
Chet Ramey, UTech, CWRU ***@case.edu http://tiswww.cwru.edu/~chet/
Andreas Schwab
2018-11-27 22:55:48 UTC
Permalink
Index: bash-5.0-beta2/expr.c
===================================================================
--- bash-5.0-beta2.orig/expr.c
+++ bash-5.0-beta2/expr.c
@@ -342,7 +342,7 @@ expr_bind_variable (lhs, rhs)
#if defined (ARRAY_VARS)
/* This is similar to the logic in arrayfunc.c:valid_array_subscript when
you pass VA_NOEXPAND. */
-static char *
+static int
expr_skipsubscript (vp, cp)
char *vp, *cp;
{
--
Andreas Schwab, ***@linux-m68k.org
GPG Key fingerprint = 7578 EB47 D4E5 4D69 2510 2552 DF73 E780 A9DA AEC1
"And now for something completely different."
Chet Ramey
2018-11-27 23:14:01 UTC
Permalink
Post by Andreas Schwab
-static char *
+static int
expr_skipsubscript (vp, cp)
Thanks.
--
``The lyf so short, the craft so long to lerne.'' - Chaucer
``Ars longa, vita brevis'' - Hippocrates
Chet Ramey, UTech, CWRU ***@case.edu http://tiswww.cwru.edu/~chet/
G. Branden Robinson
2018-11-27 23:44:32 UTC
Permalink
gcc -c -DHAVE_CONFIG_H -DSHELL -I. -I.. -I.. -I../include -I../lib -I. -DDEBUG -g -O2 -Wno-parentheses -Wno-format-security evalstring.c
evalstring.c: In function ‘parse_and_execute_cleanup’:
evalstring.c:150:7: warning: implicit declaration of function ‘unfreeze_jobs_list’; did you mean ‘unfreeeze_jobs_list’? [-Wimplicit-function-declaration]
unfreeze_jobs_list ();
^~~~~~~~~~~~~~~~~~
unfreeeze_jobs_list

--- jobs.h.orig 2018-11-27 18:35:43.205649329 -0500
+++ jobs.h 2018-11-27 18:35:51.049574540 -0500
@@ -260,7 +260,7 @@
extern void run_sigchld_trap __P((int));

extern int freeze_jobs_list __P((void));
-extern void unfreeeze_jobs_list __P((void));
+extern void unfreeze_jobs_list __P((void));
extern void set_jobs_list_frozen __P((int));
extern int set_job_control __P((int));
extern void without_job_control __P((void));
--
Regards,
Branden
Chet Ramey
2018-11-28 03:43:35 UTC
Permalink
Post by G. Branden Robinson
gcc -c -DHAVE_CONFIG_H -DSHELL -I. -I.. -I.. -I../include -I../lib -I. -DDEBUG -g -O2 -Wno-parentheses -Wno-format-security evalstring.c
evalstring.c:150:7: warning: implicit declaration of function ‘unfreeze_jobs_list’; did you mean ‘unfreeeze_jobs_list’? [-Wimplicit-function-declaration]
unfreeze_jobs_list ();
^~~~~~~~~~~~~~~~~~
unfreeeze_jobs_list
I'm going to have to give up on clang; it didn't catch that.

Chet
--
``The lyf so short, the craft so long to lerne.'' - Chaucer
``Ars longa, vita brevis'' - Hippocrates
Chet Ramey, UTech, CWRU ***@case.edu http://tiswww.cwru.edu/~chet/
Dr. Werner Fink
2018-11-29 15:09:54 UTC
Permalink
Post by Chet Ramey
The second beta release of bash-5.0 is now available with the URL
ftp://ftp.cwru.edu/pub/bash/bash-5.0-beta2.tar.gz
I see this

[ 2709s] seq.c: In function 'long_double_format':
[ 2709s] seq.c:166:9: error: expected ';' before 'return'
[ 2709s] return ldfmt;
[ 2709s] ^~~~~~

with attached patcj this should go away
--
"Having a smoking section in a restaurant is like having
a peeing section in a swimming pool." -- Edward Burr
Chet Ramey
2018-11-29 16:52:58 UTC
Permalink
Post by Dr. Werner Fink
Post by Chet Ramey
The second beta release of bash-5.0 is now available with the URL
ftp://ftp.cwru.edu/pub/bash/bash-5.0-beta2.tar.gz
I see this
[ 2709s] seq.c:166:9: error: expected ';' before 'return'
[ 2709s] return ldfmt;
Thanks. What are you using that doesn't have long double?
--
``The lyf so short, the craft so long to lerne.'' - Chaucer
``Ars longa, vita brevis'' - Hippocrates
Chet Ramey, UTech, CWRU ***@case.edu http://tiswww.cwru.edu/~chet/
Dr. Werner Fink
2018-11-30 08:42:51 UTC
Permalink
Post by Chet Ramey
Post by Dr. Werner Fink
Post by Chet Ramey
The second beta release of bash-5.0 is now available with the URL
ftp://ftp.cwru.edu/pub/bash/bash-5.0-beta2.tar.gz
I see this
[ 2709s] seq.c:166:9: error: expected ';' before 'return'
[ 2709s] return ldfmt;
Thanks. What are you using that doesn't have long double?
Seen on armv7l only :)

Werner
--
"Having a smoking section in a restaurant is like having
a peeing section in a swimming pool." -- Edward Burr
Loading...