unofficial mirror of bug-gnu-emacs@gnu.org 
 help / color / mirror / code / Atom feed
From: Eli Zaretskii <eliz@gnu.org>
To: Cyril Arnould <cyril.arnould@outlook.com>
Cc: 63752@debbugs.gnu.org
Subject: bug#63752: 28.2; GCC 13.1 breaks Emacs subprocess handling when built with -D_FORTIFY_SOURCE
Date: Sat, 27 May 2023 16:42:13 +0300	[thread overview]
Message-ID: <83353hki16.fsf@gnu.org> (raw)
In-Reply-To: <AS4PR10MB61108173EEBD22AC88ABE125E3449@AS4PR10MB6110.EURPRD10.PROD.OUTLOOK.COM> (message from Cyril Arnould on Sat, 27 May 2023 12:57:44 +0000)

> From: Cyril Arnould <cyril.arnould@outlook.com>
> Date: Sat, 27 May 2023 12:57:44 +0000
> 
> First of all, I'm on Windows 10, using the MINGW64 MSYS2 environment, so
> this issue might be specific to MinGW. Note: While I'm using a UCRT
> build of Emacs to generate this report, the problem is present in the
> MinGW GCC build as well. Emacs has some weird behaviour regarding
> subprocess handling (?) when compiled with
> "-D_FORTIFY_SOURCE=1". Setting the value to 2 causes the same issue, I
> haven't tested setting it to 3. I believe this is the why the MSYS2
> Emacs builds have been broken for a while now:

Thank you for your report.

What happens if you don't use -D_FORTIFY_SOURCE= at all?

I don't know what this option odes for MSYS2 MinGW GCC compiler and
its header files.  Up until now I knew that this option is only used
on GNU/Linux.  In any case, I see no reason for end-user builds to use
it, as it is (AFAIU) intended for developers, to facilitate detection
of problematic code.

> https://github.com/msys2/MINGW-packages/issues/16190
> https://github.com/msys2/MINGW-packages/issues/16375
> https://github.com/msys2/MINGW-packages/issues/16413

I see nothing in these issues that would point out some upstream
problem.  The issues are all related to the Emacs builds produced by
the MSYS2 folks.  So I think the initial investigation should be
theirs, until they identify the code in Emacs which misbehaves.

> In the example above, I built Emacs from the emacs-28.2 tag, but I also
> managed to reproduce the issue in the emacs-28, emacs-29 and master
> branches.

FWIW, Emacs 28 and 29 (and also Emacs 30) builds fine for me with
MinGW, both with and without native-compilation, but I don't use
_FORTIFY_SOURCE (and don't plan on using it any time soon).

Which version of GCC is this, btw?  If it's the latest GCC 13, did you
try downgrading to GCC 12?

Bottom line, I see no evidence yet that this is an upstream problem of
Emacs, and my MinGW builds are all fine.





  reply	other threads:[~2023-05-27 13:42 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-05-27 12:57 bug#63752: 28.2; GCC 13.1 breaks Emacs subprocess handling when built with -D_FORTIFY_SOURCE Cyril Arnould
2023-05-27 13:42 ` Eli Zaretskii [this message]
2023-05-27 14:32   ` bug#63752: AW: " Cyril Arnould
2023-06-01  7:31     ` András Svraka
2023-06-30 22:41 ` Cyril Arnould
2023-07-01  6:40   ` Eli Zaretskii
2023-07-05 20:23 ` Cyril Arnould
2023-07-06  5:28   ` Eli Zaretskii
2023-07-06 19:28 ` Cyril Arnould

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: https://www.gnu.org/software/emacs/

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=83353hki16.fsf@gnu.org \
    --to=eliz@gnu.org \
    --cc=63752@debbugs.gnu.org \
    --cc=cyril.arnould@outlook.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this public inbox

	https://git.savannah.gnu.org/cgit/emacs.git

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).