Subject: Re: bug#54667: 29.0.50; posix_spawn breaks emacs-gdb

From: Herman, Géza <[email-masked]>
Date: Fri, 1 Apr 2022 15:29:50 +0200

I can confirm that it fixes the problem.

For reference, here's the patch: 
https://lists.gnu.org/archive/html/emacs-devel/2022-03/msg00067.html

(Btw., according to this email thread, vfork is faster than posix_spawn 
on Linux, so maybe it'd make sense to use posix_spawn only on non-Linux 
platforms?)

On 2022-04-01 14:16, Robert Pluim wrote:
>>>>>> On Fri, 1 Apr 2022 12:51:43 +0200, [email-masked], Géza <[email-masked]> said:
>      Herman> There's a gdb frontend: https://github.com/weirdNox/emacs-gdb
>      Herman> With the emacs commit "a60053f836 Use posix_spawn if possible.",
>      Herman> emacs-gdb doesn't work properly: when starting an executable, gdb says
>      Herman> that it's running, but in reality, it doesn't start. The process
>      Herman> itself is started, gdb attaches to it, but the process still not run
>      Herman> for some reason.
>
>      Herman> You can reproduce this:
>      Herman> 1. install emacs-gdb
>      Herman> 2. M-x gdb-executable, enter any executable, like "/bin/ls". emacs-gdb
>      Herman> should open a new frame.
>      Herman> 3. Then press f5 (this executes gdb-run-or-continue), this should
>      Herman> start the process in gdb.
>
>      Herman> Before the mentioned commit, this worked, and "ls" was run
>      Herman> properly. But with this commit, "ls" isn't started.
>
>      Herman> I checked this with a recent master
>      Herman> (bd5d136777ef30f36807c7e690413846ed38fce1), and still happens. Adding
>
>      Herman> #undef USABLE_POSIX_SPAWN
>      Herman> #define USABLE_POSIX_SPAWN 0
>
>      Herman> to callproc.c at line 49 fixes the issue.
>
> Thereʼs a patch from Jürgen Hötzel in <[email-masked]> on
> emacs-devel that should fix it (I haven't had a chance to fully test
> it).
>
> Robert