From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Eli Zaretskii Newsgroups: gmane.emacs.bugs 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 Message-ID: <83353hki16.fsf@gnu.org> References: Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="25789"; mail-complaints-to="usenet@ciao.gmane.io" Cc: 63752@debbugs.gnu.org To: Cyril Arnould Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Sat May 27 15:42:20 2023 Return-path: Envelope-to: geb-bug-gnu-emacs@m.gmane-mx.org Original-Received: from lists.gnu.org ([209.51.188.17]) by ciao.gmane.io with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1q2uBX-0006UO-PW for geb-bug-gnu-emacs@m.gmane-mx.org; Sat, 27 May 2023 15:42:19 +0200 Original-Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1q2uBH-0003Fg-FW; Sat, 27 May 2023 09:42:03 -0400 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1q2uBG-0003FY-Bq for bug-gnu-emacs@gnu.org; Sat, 27 May 2023 09:42:02 -0400 Original-Received: from debbugs.gnu.org ([209.51.188.43]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1q2uBG-0004yE-3q for bug-gnu-emacs@gnu.org; Sat, 27 May 2023 09:42:02 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1q2uBF-0004yc-Lg for bug-gnu-emacs@gnu.org; Sat, 27 May 2023 09:42:01 -0400 X-Loop: help-debbugs@gnu.org Resent-From: Eli Zaretskii Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Sat, 27 May 2023 13:42:01 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 63752 X-GNU-PR-Package: emacs Original-Received: via spool by 63752-submit@debbugs.gnu.org id=B63752.168519490619103 (code B ref 63752); Sat, 27 May 2023 13:42:01 +0000 Original-Received: (at 63752) by debbugs.gnu.org; 27 May 2023 13:41:46 +0000 Original-Received: from localhost ([127.0.0.1]:51566 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1q2uB0-0004y3-9p for submit@debbugs.gnu.org; Sat, 27 May 2023 09:41:46 -0400 Original-Received: from eggs.gnu.org ([209.51.188.92]:47786) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1q2uAy-0004xl-RT for 63752@debbugs.gnu.org; Sat, 27 May 2023 09:41:45 -0400 Original-Received: from fencepost.gnu.org ([2001:470:142:3::e]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1q2uAs-0004vf-SN; Sat, 27 May 2023 09:41:38 -0400 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=gnu.org; s=fencepost-gnu-org; h=References:Subject:In-Reply-To:To:From:Date: mime-version; bh=vg7W6Tuw/4czQeWjBS/eSMBvWbTJppXauYgb4iVQE68=; b=qkPXn72EAcxp b+68ZuuJzbq6sr+GUqmhoLJ3LM2qR9/yDWm/uixqg64VU8Opur4tXyNmUjqSoqwei8kvF7lKO8m/f uriOy+s6eHGzcr6bFmll/RpQiigWHFGVmVMTU0xRk43NFOHWumT5Q0ZEIPbl3FRG4Iv94SN/6ECc/ xUhBtrqW30m5pGqm99N1oiu2rZawggs7oeFBW7KW6kI4oCdH2om71eAdQkqbiFQ4vxUbE/LQRtdSY 0lxD9sLY9fSYlEdUEgzMtup22t8mbuU0CVfLJa2jvRWzZ3guIOF3fST8ArMduWLWpXwK/frg4cESB MboS6Yaw6Z7EUg2tcRW0sw==; Original-Received: from [87.69.77.57] (helo=home-c4e4a596f7) by fencepost.gnu.org with esmtpsa (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1q2uAs-0004SQ-Bu; Sat, 27 May 2023 09:41:38 -0400 In-Reply-To: (message from Cyril Arnould on Sat, 27 May 2023 12:57:44 +0000) X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list X-BeenThere: bug-gnu-emacs@gnu.org List-Id: "Bug reports for GNU Emacs, the Swiss army knife of text editors" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Original-Sender: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Xref: news.gmane.io gmane.emacs.bugs:262476 Archived-At: > From: Cyril Arnould > 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.