asan report in extmatch

2023-03-16 Thread Grisha Levit
The relevant code was added in https://git.savannah.gnu.org/cgit/bash.git/commit/?id=da43077 with similar additions to both gmatch and extmatch, but I suspect the test on line 912 was not meant to be in extmatch: > .a bash -O extglob -O dotglob -c ': ./!(.foo)' ERROR: AddressSanitizer: heap-buffe

Re: global-buffer-overflow in parse.y

2023-03-16 Thread Grisha Levit
On Mon, Mar 6, 2023 at 9:16 AM Chet Ramey wrote: > Thanks for the report. It's the specific combination of `if' and the `((' > command that causes the problem. Looks like same thing also happens when `if' is followed by a newline ./bash -c $'case $LINENO in 0) if\n:; then echo FAIL; fi esac' bas

Re: The memory occupied by bash has been increasing due to the fork bomb

2023-03-16 Thread Chet Ramey
On 3/10/23 9:50 PM, zju wrote: So is it possible to optimize the continuous growth of memory occupied by child processes? You'll have to show that it's an actual leak, not just memory bash is allocating and using for its own purposes. Maybe a more controlled test instead of a fork bomb that y

Re: The memory occupied by bash has been increasing due to the fork bomb

2023-03-16 Thread Chet Ramey
On 3/11/23 6:41 AM, zju wrote: The change was made in this pr: https://git.savannah.gnu.org/cgit/bash.git/commit/?h=devel&id=ea31c00845c858098d232bd014bf27b5a63a668b The logic goes like t

rl_filename_quoting_function restoration

2023-03-16 Thread Grisha Levit
bash_glob_complete_word modifies rl_filename_quoting_function, which can fail to be restored if bash_tilde_expand handles a SIGINT while glob-complete-word is running Handling the restore in bashline_reset() seems to solve the issue: diff --git a/bashline.c b/bashline.c index 2745c4dd..7c3812eb 1

Re: bash login shell detection broken using default compile options

2023-03-16 Thread Martin Schulte
Hello Tycho! > the login shell detection (leading dash: -bash) is apparently broken - at > least, ~/.bashrc is not sourced. As far as I understand the manual ~/.bashrc is not sourced from a login-shell, see https://www.gnu.org/software/bash/manual/bash.html#Bash-Startup-Files At least in Debia

Re: bash login shell detection broken using default compile options

2023-03-16 Thread Greg Wooledge
On Thu, Mar 16, 2023 at 05:21:23PM +0100, Tycho Kirchner wrote: > Hi, > when compiling bash with a plain > > mkdir build; cd build; ../configure && make > > the login shell detection (leading dash: -bash) is apparently broken - at > least, ~/.bashrc is not sourced. What you're referring to is a

bash login shell detection broken using default compile options

2023-03-16 Thread Tycho Kirchner
Hi, when compiling bash with a plain mkdir build; cd build; ../configure && make the login shell detection (leading dash: -bash) is apparently broken - at least, ~/.bashrc is not sourced. This happens in all tested versions, from 4.4 until the latest release 5.2.15. Interestingly, using distrib

Re: command_not_found_handle not run when PATH is empty

2023-03-16 Thread Chet Ramey
On 3/9/23 5:42 PM, Moshe Looks wrote: Thank you this is very illuminating and makes it clear that my naive one-line fix would be inappropriate. Given the current state of affairs there is really no good reason for PATH to ever be unset or set to empty vs. explicitly set to '.', right? So might be

Re: command_not_found_handle not run when PATH is empty

2023-03-16 Thread Chet Ramey
On 3/8/23 1:33 PM, Moshe Looks wrote: Bash Version: 5.1 Patch Level: 16 Release Status: release Description: When PATH is empty, the command_not_found_handle function is not called when a command is not found. I agree that bash should do a path search in the current directory when PATH is the

double-free in bashline.c

2023-03-16 Thread Grisha Levit
A few functions in bashline.c free static variables but do not assign to them until after calling bash_tilde_expand, which may throw_to_top_level. If SIGINT is received at an inopportune time, these variables may be free-d again. diff --git a/bashline.c b/bashline.c index 2745c4dd..b5c0a49f 10064