unofficial mirror of help-gnu-emacs@gnu.org
 help / color / mirror / Atom feed
* (Windows) Problems with processes on master branch
@ 2024-03-01 16:46 Óscar Fuentes
  2024-03-01 16:52 ` Eli Zaretskii
  2024-03-02 12:16 ` Arash Esbati
  0 siblings, 2 replies; 6+ messages in thread
From: Óscar Fuentes @ 2024-03-01 16:46 UTC (permalink / raw)
  To: help-gnu-emacs

With a fresh MSYS2/Mingw-w64 build executed on Windows 11 64bits with
-Q, emacs mangles the output of processes and does not detect when they
end.

For instance, with emacs -Q

M-x shell

it shows

icrosoft Windows [Version <omitted rest of output>

Note the missing initial M. Then, emacs hangs (no input possible, C-g
doen't work) showing (Shell:run) on the modeline.

If I execute eshell instead of shell and invoke an executable like

$ gcc -v

the shown output misses the first line:

Using built-in specs.

and then eshell keeps waiting as if the command would still be
executing, which is false (Windows' Task Manager confirms that there is
no gcc executable running).

Is this a known problem?




^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: (Windows) Problems with processes on master branch
  2024-03-01 16:46 (Windows) Problems with processes on master branch Óscar Fuentes
@ 2024-03-01 16:52 ` Eli Zaretskii
  2024-03-01 17:12   ` Óscar Fuentes
  2024-03-02 12:16 ` Arash Esbati
  1 sibling, 1 reply; 6+ messages in thread
From: Eli Zaretskii @ 2024-03-01 16:52 UTC (permalink / raw)
  To: Óscar Fuentes; +Cc: help-gnu-emacs

> From: Óscar Fuentes <ofv@wanadoo.es>
> Date: Fri, 01 Mar 2024 17:46:10 +0100
> 
> With a fresh MSYS2/Mingw-w64 build executed on Windows 11 64bits with
> -Q, emacs mangles the output of processes and does not detect when they
> end.
> 
> For instance, with emacs -Q
> 
> M-x shell
> 
> it shows
> 
> icrosoft Windows [Version <omitted rest of output>
> 
> Note the missing initial M. Then, emacs hangs (no input possible, C-g
> doen't work) showing (Shell:run) on the modeline.

I cannot reproduce this with the latest master branch.  My build is a
32-bit one, but I don't think it should matter.

> If I execute eshell instead of shell and invoke an executable like
> 
> $ gcc -v
> 
> the shown output misses the first line:
> 
> Using built-in specs.
> 
> and then eshell keeps waiting as if the command would still be
> executing, which is false (Windows' Task Manager confirms that there is
> no gcc executable running).

I cannot reproduce this, either.

My first guess would be some weird buffering issue.  But I have no
clue why it would happen.  Which versions of Emacs behave like that?



^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: (Windows) Problems with processes on master branch
  2024-03-01 16:52 ` Eli Zaretskii
@ 2024-03-01 17:12   ` Óscar Fuentes
  2024-03-01 18:10     ` Corwin Brust
  0 siblings, 1 reply; 6+ messages in thread
From: Óscar Fuentes @ 2024-03-01 17:12 UTC (permalink / raw)
  To: help-gnu-emacs

Eli Zaretskii <eliz@gnu.org> writes:

> My first guess would be some weird buffering issue.  But I have no
> clue why it would happen.  Which versions of Emacs behave like that?

This is current master branch.

I vaguely recall experiencing the same problem long time ago. Indeed it
looks like a buffering problem, probably on the mingw-64 runtime side,
that's why I didn't report an Emacs bug. However, the emacs-29
msys2/mingw-w64 package works fine.

Thanks.




^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: (Windows) Problems with processes on master branch
  2024-03-01 17:12   ` Óscar Fuentes
@ 2024-03-01 18:10     ` Corwin Brust
  0 siblings, 0 replies; 6+ messages in thread
From: Corwin Brust @ 2024-03-01 18:10 UTC (permalink / raw)
  To: Óscar Fuentes; +Cc: help-gnu-emacs

FWIW, I cannot reproduce truncation of the initial output from M-x
shell with a self-built 31a4bec609578afd453caf232f78e275c3a075bc (only
a few commits behind HEAD, I believe).

This looks fine:

Microsoft Windows [Version 10.0.19045.4123]
(c) Microsoft Corporation. All rights reserved.

C:\>



^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: (Windows) Problems with processes on master branch
  2024-03-01 16:46 (Windows) Problems with processes on master branch Óscar Fuentes
  2024-03-01 16:52 ` Eli Zaretskii
@ 2024-03-02 12:16 ` Arash Esbati
  2024-03-02 23:17   ` Óscar Fuentes
  1 sibling, 1 reply; 6+ messages in thread
From: Arash Esbati @ 2024-03-02 12:16 UTC (permalink / raw)
  To: Óscar Fuentes; +Cc: help-gnu-emacs

Óscar Fuentes <ofv@wanadoo.es> writes:

> With a fresh MSYS2/Mingw-w64 build executed on Windows 11 64bits with
> -Q, emacs mangles the output of processes and does not detect when they
> end.
>
> For instance, with emacs -Q
>
> M-x shell
>
> it shows
>
> icrosoft Windows [Version <omitted rest of output>
>
> Note the missing initial M. Then, emacs hangs (no input possible, C-g
> doen't work) showing (Shell:run) on the modeline.

With my Emacs 30 (d0766c0999) build, started from cmd.exe with
'runemacs -Q' and M-x shell RET, I get:

--8<---------------cut here---------------start------------->8---
Microsoft Windows [Version 10.0.19045.4046]
(c) Microsoft Corporation. Alle Rechte vorbehalten.

z:dir\>gcc -v
gcc -v
Using built-in specs.
...
--8<---------------cut here---------------end--------------->8---

With 'emacs -Q' started from a MinGW64 shell, M-x shell RET says:

--8<---------------cut here---------------start------------->8---
bash: cannot set terminal process group (-1): Inappropriate ioctl for device
bash: no job control in this shell

$ gcc -v
Using built-in specs.
...
--8<---------------cut here---------------end--------------->8---

Both versions work, despite the bash message.  I didn't try eshell.

Best, Arash



^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: (Windows) Problems with processes on master branch
  2024-03-02 12:16 ` Arash Esbati
@ 2024-03-02 23:17   ` Óscar Fuentes
  0 siblings, 0 replies; 6+ messages in thread
From: Óscar Fuentes @ 2024-03-02 23:17 UTC (permalink / raw)
  To: help-gnu-emacs

Arash Esbati <arash@gnu.org> writes:

> With my Emacs 30 (d0766c0999) build, started from cmd.exe with
> 'runemacs -Q' and M-x shell RET, I get:
>
> Microsoft Windows [Version 10.0.19045.4046]
> (c) Microsoft Corporation. Alle Rechte vorbehalten.
>
> z:dir\>gcc -v
> gcc -v
> Using built-in specs.
> ...
>
>
> With 'emacs -Q' started from a MinGW64 shell, M-x shell RET says:
>
> bash: cannot set terminal process group (-1): Inappropriate ioctl for device
> bash: no job control in this shell
>
> $ gcc -v
> Using built-in specs.
> ...
>
> Both versions work, despite the bash message.  I didn't try eshell.

Thanks Arash and Corwin.

The problem is caused by MSYS2 makepkg-mingw (the MSYS2 binary package
builder) which adds

-D_FORTIFY_SOURCE

to CFLAGS. In fact, the MSYS2/Mingw-packages recipe for emacs-29
contains:

  # -D_FORTIFY_SOURCE breaks build
  CFLAGS=${CFLAGS//"-Wp,-D_FORTIFY_SOURCE=2"}
  # -foptimize-sibling-calls breaks native compilation (GCC 13.1)
  CFLAGS+=" -fno-optimize-sibling-calls"

Once that is added to my recipe, the problem goes away.




^ permalink raw reply	[flat|nested] 6+ messages in thread

end of thread, other threads:[~2024-03-02 23:17 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2024-03-01 16:46 (Windows) Problems with processes on master branch Óscar Fuentes
2024-03-01 16:52 ` Eli Zaretskii
2024-03-01 17:12   ` Óscar Fuentes
2024-03-01 18:10     ` Corwin Brust
2024-03-02 12:16 ` Arash Esbati
2024-03-02 23:17   ` Óscar Fuentes

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).