Configuration Information [Automatically generated, do not change]: Machine: x86_64 OS: linux-gnu Compiler: x86_64-pc-linux-gnu-gcc Compilation CFLAGS: -O2 -pipe -march=native -ggdb3 uname output: Linux 2021-10-24 5.15.34-gentoo-dist-hardened #1 SMP Sat Apr 16 02:20:51 BST 2022 x86_64 AMD Ryzen 9 3950X 16-Core Processor AuthenticAMD GNU/Linux Machine Type: x86_64-pc-linux-gnu
Bash Version: 5.2 Patch Level: 0 Release Status: beta Description: Bash crashes when running compgen -c -X a. Repeat-By: # bash -c "compgen -c -X a" Segmentation fault (core dumped) ---- Originally noticed when running 'eselect compiler-shadow update' in Gentoo Linux, but Ionen Wolkens (ionen@g.o) came up with a far smaller reproducer: # bash -c "compgen -c -X a" Segmentation fault (core dumped) Backtrace: ``` Starting program: /bin/bash -c compgen\ -c\ -X\ a [Thread debugging using libthread_db enabled] Using host libthread_db library "/lib64/libthread_db.so.1". Program received signal SIGSEGV, Segmentation fault. __strchr_avx2 () at ../sysdeps/x86_64/multiarch/strchr-avx2.S:65 65 vmovdqu (%rdi), %ymm8 (gdb) bt #0 __strchr_avx2 () at ../sysdeps/x86_64/multiarch/strchr-avx2.S:65 #1 0x00005555555c618f in quote_word_break_chars (text=0x55555565f300 "/usr/local/sbin/.keep") at bashline.c:4143 #2 bash_quote_filename (s=s@entry=0x55555565f2c0 "/usr/local/sbin/.keep", rtype=rtype@entry=1, qcp=qcp@entry=0x7fffffffdbbf "") at bashline.c:4346 #3 0x00005555555c73f5 in executable_completion (searching_path=1, filename=0x55555565f2c0 "/usr/local/sbin/.keep") at bashline.c:1951 #4 command_word_completion_function (hint_text=0x555555613bff "", state=83) at bashline.c:2378 #5 0x00007ffff7f77257 in rl_completion_matches (text=text@entry=0x555555613bff "", entry_function=0x5555555c6d70 <command_word_completion_function>) at /usr/src/debug/sys-libs/readline-8.2_beta/readline-8.2-beta/complete.c:2219 #6 0x00005555555d00ef in gen_action_completions (text=text@entry=0x555555613bff "", cs=<optimized out>, cs=<optimized out>) at pcomplete.c:856 #7 0x00005555555d02f1 in gen_compspec_completions (cs=cs@entry=0x555555655860, cmd=cmd@entry=0x5555556130b0 "compgen", word=word@entry=0x555555613bff "", start=start@entry=0, end=end@entry=0, foundp=foundp@entry=0x0) at pcomplete.c:1333 #8 0x00005555555ebab1 in compgen_builtin (list=<optimized out>) at ./complete.def:721 #9 0x0000555555579f7b in execute_builtin (builtin=builtin@entry=0x5555555eb7f0 <compgen_builtin>, words=words@entry=0x555555655510, flags=flags@entry=64, subshell=subshell@entry=0) at execute_cmd.c:4958 #10 0x000055555557fec1 in execute_builtin_or_function (flags=64, fds_to_close=0x5555556551a0, redirects=0x0, var=0x0, builtin=0x5555555eb7f0 <compgen_builtin>, words=0x555555655510) at execute_cmd.c:5472 #11 execute_simple_command (fds_to_close=0x5555556551a0, async=<optimized out>, pipe_out=<optimized out>, pipe_in=<optimized out>, simple_command=0x555555655080) at execute_cmd.c:4724 #12 execute_command_internal (command=0x555555655050, asynchronous=asynchronous@entry=0, pipe_in=pipe_in@entry=-1, pipe_out=pipe_out@entry=-1, fds_to_close=fds_to_close@entry=0x5555556551a0) at execute_cmd.c:866 #13 0x00005555555d8c99 in parse_and_execute (string=<optimized out>, from_file=from_file@entry=0x5555555fd09f "-c", flags=flags@entry=20) at evalstring.c:519 #14 0x0000555555565650 in run_one_command (command=0x7fffffffe4fe "compgen -c -X a") at shell.c:1473 #15 0x0000555555563f0d in main (argc=3, argv=0x7fffffffe268, env=0x7fffffffe288) at shell.c:763 ``` Let me know if I need to grab more information.
signature.asc
Description: Message signed with OpenPGP