Re: read -t0 may report that input is available where none is possible

2021-11-21 Thread Dale R. Worley
More to the essence:

$ read -t0 

Re: Strange complete -C output

2021-11-21 Thread Chet Ramey

On 11/20/21 10:40 PM, Emily Seville wrote:

Bash version: GNU bash, version 5.0.17(1)-release (x86_64-pc-linux-gnu)
OS version: Linux Mint 20.2 Cinnamon

Hello! Why when I create *complete -C 'echo -e "aa\nab\n"' : *completion 
and try use it I obtain additional garbage in output instead of only *ab 
ab* hints?


"When the function or command is invoked, the
first argument ($1) is the name of the command whose arguments are  be-
ing  completed,  the  second argument ($2) is the word being completed,
and the third argument ($3) is the word preceding the word  being  com-
pleted on the current command line. "

So your echo command is echoing the arguments it receives when invoked by
the completion system.

--
``The lyf so short, the craft so long to lerne.'' - Chaucer
 ``Ars longa, vita brevis'' - Hippocrates
Chet Ramey, UTech, CWRUc...@case.eduhttp://tiswww.cwru.edu/~chet/



Re: Using systemd-249's libnss_systemd.so.2 triggers a crash in bash-5.1's malloc.c

2021-11-21 Thread Julien Moutinho
Le ven. 19 nov. 2021 17h17 -0500, Chet Ramey a écrit :
> This fix is in the most recent set of patches I released this week
> (it's patch 9).
Thank you!

They've been merged a few days ago in the staging branch of NixOS:
https://github.com/NixOS/nixpkgs/pull/146463



Crash when using ulimit -n

2021-11-21 Thread balasr
Configuration Information [Automatically generated, do not change]:
Machine: x86_64
OS: linux-gnu
Compiler: gcc
Compilation CFLAGS: -O2 -Wall -D_FORTIFY_SOURCE=2 -fstack-protector-strong 
-funwind-tables -fasynchronous-unwind-tables -fstack-clash-protection 
-Werror=return-type -flto=auto -g  -D_GNU_SOURCE -DRECYCLES_PIDS -Wall -g 
-Wuninitialized -Wextra -Wno-switch-enum -Wno-unused-variable 
-Wno-unused-parameter -Wno-parentheses -ftree-loop-linear -pipe -DBNC382214=0 
-DIMPORT_FUNCTIONS_DEF=0
uname output: Linux sandkasten 5.14.11-2-default #1 SMP Sun Oct 10 08:34:34 UTC 
2021 (834) x86_64 x86_64 x86_64 GNU/Linux
Machine Type: x86_64-suse-linux-gnu

Bash Version: 5.1
Patch Level: 8
Release Status: release

Description:
    Calling ulimit -n 1024 results in the message "Warning: Program '/bin/bash' 
crashed." and bash locks up.

Repeat-By:
    1. Open bash
    2. Enter `ulimit -n 1024'


I alwso generated a stacktrace:

Program received signal SIGSEGV, Segmentation fault.
0x5558c062in string_to_rlimtype(s=0x5591b570 "1024") at 
/usr/src/debug/bash-5.1.8-2.1.x86_64/general.c:189
Downloading source file /usr/src/debug/bash-5.1.8-2.1.x86_64/general.c...
189   for( ; s && *s && DIGIT (*s); s++)
Missing separate debuginfos, use: zypper install bash-debuginfo-5.1.8-2.1.x86_64
(gdb) bt
#0  0x5558c062in string_to_rlimtype(s=0x5591b570 "1024") at 
/usr/src/debug/bash-5.1.8-2.1.x86_64/general.c:189
#1  0x55617f6bin ulimit_internal(multiple=, 
mode=, cmdarg=0x5591b570 "1024", cmd=) at 
builtins/./ulimit.def:475
#2  ulimit_builtin(list=) at builtins/./ulimit.def:432
#3  0x5559e4f3in execute_builtin(builtin=0x55617760 
, words=0x556bac90, flags=0, subshell=0) at 
/usr/src/debug/bash-5.1.8-2.1.x86_64/execute_cmd.c:4828 

#4  0x55596973in execute_builtin_or_function(flags=0, 
fds_to_close=0x5591b500, redirects=, var=0x0, 
builtin=0x55617760 , words=0x556bac90) at 
/usr/src/debug/bash-5.1.8-2.1.x86_64/execute_cmd.c:5341
#5  execute_simple_command(simple_command=, pipe_in=-1, 
pipe_out=-1, async=0, fds_to_close=0x5591b500) at 
/usr/src/debug/bash-5.1.8-2.1.x86_64/execute_cmd.c:4597 

#6  0x55597cf3in execute_command_internal(command=0x5591b420, 
asynchronous=, pipe_in=-1, pipe_out=-1, 
fds_to_close=0x5591b500) at 
/usr/src/debug/bash-5.1.8-2.1.x86_64/execute_cmd.c:845
#7  0x5559a319in execute_command(command=0x5591b420) at 
/usr/src/debug/bash-5.1.8-2.1.x86_64/execute_cmd.c:395
#8  0x5558a365in reader_loop() at 
/usr/src/debug/bash-5.1.8-2.1.x86_64/eval.c:170
#9  0x5557a46ain main(argc=1, argv=0x7fffd978, env=0x7fffd988) 
at /usr/src/debug/bash-5.1.8-2.1.x86_64/shell.c:813


Regards
Robert