1 From https://ftp.gnu.org/gnu/bash/bash-4.4-patches/bash44-001
3 Signed-off-by: Peter Korsgaard <peter@korsgaard.com>
11 Bug-Reported-by: Sean Zha <freeman_cha@hotmail.com>
12 Bug-Reference-ID: <BN3PR01MB13657D9303EB94BF6E54216E8CCA0@BN3PR01MB1365.prod.exchangelabs.com>
13 Bug-Reference-URL: http://lists.gnu.org/archive/html/bug-bash/2016-09/msg00107.html
17 Bash-4.4 changed the way the history list is initially allocated to reduce
18 the number of reallocations and copies. Users who set HISTSIZE to a very
19 large number to essentially unlimit the size of the history list will get
20 memory allocation errors
22 Patch (apply with `patch -p0'):
24 *** a/bash-4.4/lib/readline/history.c 2015-12-28 13:50:31.000000000 -0500
25 --- b/lib/readline/history.c 2016-09-30 14:28:40.000000000 -0400
29 #define DEFAULT_HISTORY_INITIAL_SIZE 502
31 + #define MAX_HISTORY_INITIAL_SIZE 8192
33 /* The number of slots to increase the_history by. */
34 #define DEFAULT_HISTORY_GROW_SIZE 50
38 if (history_stifled && history_max_entries > 0)
39 ! history_size = history_max_entries + 2;
41 history_size = DEFAULT_HISTORY_INITIAL_SIZE;
44 if (history_stifled && history_max_entries > 0)
45 ! history_size = (history_max_entries > MAX_HISTORY_INITIAL_SIZE)
46 ! ? MAX_HISTORY_INITIAL_SIZE
47 ! : history_max_entries + 2;
49 history_size = DEFAULT_HISTORY_INITIAL_SIZE;
50 *** a/bash-4.4/patchlevel.h 2016-06-22 14:51:03.000000000 -0400
51 --- b/patchlevel.h 2016-10-01 11:01:28.000000000 -0400
54 looks for to find the patch level (for the sccs version string). */
56 ! #define PATCHLEVEL 0
58 #endif /* _PATCHLEVEL_H_ */
60 looks for to find the patch level (for the sccs version string). */
62 ! #define PATCHLEVEL 1
64 #endif /* _PATCHLEVEL_H_ */