Subject: 28.0.60; "Args out of range" when completing shell command

From: Kévin Le Gouguec <[email-masked]>
Date: Sun, 28 Nov 2021 22:38:27 +0100

Hello,

This is sort of a garbage-in, garbage-out situation, so I'll just let
the reproducer speak for itself:

$ emacs -Q
M-! ./nosuchcommand C-b TAB

- In Emacs 27.1, this simply says "[No match]".
- In Emacs 28.0.60, this errors out:

> completion--some: Args out of range: "./nosuchcomma", 0, 14

I'm attaching the backtrace obtained with M-x toggle-debug-on-error.

I'm not on the most ideal setup for compiling ATM, so I apologize for
not bisecting this (and for not trying with 27.2; Debian stable only has
27.1); I'll get to it eventually if no-one beats me.

AFAICT it's not a very impactful issue; however, since Emacs now throws
an error where it didn't use to, I figure there's a somewhat subtle bug
here with consequences I can't quite evaluate.

Thanks for your time.

In GNU Emacs 29.0.50 (build 1, x86_64-pc-linux-gnu, GTK+ Version 3.24.24, cairo version 1.16.0)
 of 2021-11-26 built on hirondell
Repository revision: 11860f89a593a8cfe7efb94e86370bbbe4318fba
Repository branch: master
Windowing system distributor 'The X.Org Foundation', version 11.0.12011000
System Description: Debian GNU/Linux 11 (bullseye)

Configured using:
 'configure --with-xwidgets --with-cairo --with-gconf --with-xinput2'

Configured features:
ACL CAIRO DBUS FREETYPE GCONF GIF GLIB GMP GNUTLS GPM GSETTINGS HARFBUZZ
JPEG JSON LCMS2 LIBOTF LIBSELINUX LIBSYSTEMD LIBXML2 M17N_FLT MODULES
NOTIFY INOTIFY PDUMPER PNG RSVG SECCOMP SOUND THREADS TIFF
TOOLKIT_SCROLL_BARS X11 XDBE XIM XINPUT2 XPM XWIDGETS GTK3 ZLIB

Important settings:
  value of $LANG: en_US.UTF-8
  locale-coding-system: utf-8-unix