Subject: 29.0.50; posix_spawn breaks emacs-gdb

From: Herman, Géza <[email-masked]>
Date: Fri, 1 Apr 2022 12:51:43 +0200

There's a gdb frontend: https://github.com/weirdNox/emacs-gdb

With the emacs commit "a60053f836 Use posix_spawn if possible.", 
emacs-gdb doesn't work properly: when starting an executable, gdb says 
that it's running, but in reality, it doesn't start. The process itself 
is started, gdb attaches to it, but the process still not run for some 
reason.

You can reproduce this:
1. install emacs-gdb
2. M-x gdb-executable, enter any executable, like "/bin/ls". emacs-gdb 
should open a new frame.
3. Then press f5 (this executes gdb-run-or-continue), this should start 
the process in gdb.

Before the mentioned commit, this worked, and "ls" was run properly. But 
with this commit, "ls" isn't started.

I checked this with a recent master 
(bd5d136777ef30f36807c7e690413846ed38fce1), and still happens. Adding

#undef USABLE_POSIX_SPAWN
#define USABLE_POSIX_SPAWN 0

to callproc.c at line 49 fixes the issue.

In GNU Emacs 29.0.50 (build 1, x86_64-pc-linux-gnu, GTK+ Version 
3.24.20, cairo version 1.16.0)
  of 2022-04-01 built on zetor
Repository revision: bd5d136777ef30f36807c7e690413846ed38fce1
Repository branch: master
Windowing system distributor 'The X.Org Foundation', version 11.0.12008000
System Description: Debian GNU/Linux bullseye/sid

Configured using:
  'configure --with-native-compilation --without-compress-install
  --with-xinput2'

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

Important settings:
   value of $LC_ALL: C.UTF-8
   value of $LANG: en_US.UTF-8
   value of $XMODIFIERS: @im=none
   locale-coding-system: utf-8-unix

Major mode: C++//l

Minor modes in effect:
   gdb-keys-mode: t
   tooltip-mode: t
   global-eldoc-mode: t
   show-paren-mode: t
   electric-indent-mode: t
   mouse-wheel-mode: t
   tool-bar-mode: t
   menu-bar-mode: t
   file-name-shadow-mode: t
   global-font-lock-mode: t
   font-lock-mode: t
   blink-cursor-mode: t
   line-number-mode: t
   indent-tabs-mode: t
   transient-mark-mode: t
   auto-composition-mode: t
   auto-encryption-mode: t
   auto-compression-mode: t
   abbrev-mode: t

Load-path shadows:
/home/geza/.emacs.d/elpa/transient-20220216.2303/transient hides 
/usr/local/share/emacs/29.0.50/lisp/transient
~/.emacs.d/lisp/emacs-gdb/gdb-mi hides 
/usr/local/share/emacs/29.0.50/lisp/progmodes/gdb-mi

Features:
(shadow sort mail-extr emacsbug message yank-media rmc puny dired
dired-loaddefs rfc822 mml mml-sec epa derived epg rfc6068 epg-config
gnus-util text-property-search time-date mm-decode mm-bodies mm-encode
mail-parse rfc2231 mailabbrev gmm-utils mailheader sendmail rfc2047
rfc2045 ietf-drums mm-util mail-prsvr mail-utils gdb-mi comp comp-cstr
warnings rx cl-extra gdb-module hydra lv comint ansi-color ring help-fns
radix-tree cl-print debug backtrace help-mode find-func finder-inf info
helm-easymenu advice package browse-url url url-proxy url-privacy
url-expand url-methods url-history url-cookie url-domsuf url-util
mailcap url-handlers url-parse auth-source cl-seq eieio eieio-core
cl-macs eieio-loaddefs password-cache json map url-vars seq gv subr-x
byte-opt bytecomp byte-compile cconv cc-mode cc-fonts cc-guess cc-menus
cc-cmds cc-styles cc-align cc-engine cc-vars cc-defs cl-loaddefs cl-lib
iso-transl tooltip eldoc paren electric uniquify ediff-hook vc-hooks
lisp-float-type elisp-mode mwheel term/x-win x-win term/common-win x-dnd
tool-bar dnd fontset image regexp-opt fringe tabulated-list replace
newcomment text-mode lisp-mode prog-mode register page tab-bar menu-bar
rfn-eshadow isearch easymenu timer select scroll-bar mouse jit-lock
font-lock syntax font-core term/tty-colors frame minibuffer nadvice
simple cl-generic cham georgian utf-8-lang misc-lang vietnamese tibetan
thai tai-viet lao korean japanese eucjp-ms cp51932 hebrew greek romanian
slovak czech european ethiopic indian cyrillic chinese composite
emoji-zwj charscript charprop case-table epa-hook jka-cmpr-hook help
abbrev obarray cl-preloaded button loaddefs faces cus-face macroexp
files window text-properties overlay sha1 md5 base64 format env
code-pages mule custom widget keymap hashtable-print-readable backquote
threads dbusbind inotify lcms2 dynamic-setting system-font-setting
font-render-setting cairo move-toolbar gtk x-toolkit xinput2 x multi-tty
make-network-process native-compile emacs)

Memory information:
((conses 16 186444 9283)
  (symbols 48 14946 0)
  (strings 32 49762 3465)
  (string-bytes 1 1931765)
  (vectors 16 27008)
  (vector-slots 8 517036 11837)
  (floats 8 65 232)
  (intervals 56 890 0)
  (buffers 992 20))