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#73444: 30.0.50; mingw-w64: Emacs uses CRT's `read` when _FORTIFY_SOURCE > 0 Date: Tue, 24 Sep 2024 16:27:39 +0300 Message-ID: <865xqldvw4.fsf@gnu.org> References: <87r09axbio.fsf@telefonica.net> <86setpe0gm.fsf@gnu.org> <87ed59xlb7.fsf@telefonica.net> Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="31687"; mail-complaints-to="usenet@ciao.gmane.io" Cc: 73444@debbugs.gnu.org To: =?UTF-8?Q?=C3=93scar?= Fuentes Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Tue Sep 24 15:29:06 2024 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 1st5bF-00085i-Ii for geb-bug-gnu-emacs@m.gmane-mx.org; Tue, 24 Sep 2024 15:29:05 +0200 Original-Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1st5ap-0005Gg-VB; Tue, 24 Sep 2024 09:28:39 -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 1st5ao-0005Ae-9f for bug-gnu-emacs@gnu.org; Tue, 24 Sep 2024 09:28:38 -0400 Original-Received: from debbugs.gnu.org ([2001:470:142:5::43]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1st5ao-0003Jb-03 for bug-gnu-emacs@gnu.org; Tue, 24 Sep 2024 09:28:38 -0400 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=debbugs.gnu.org; s=debbugs-gnu-org; h=MIME-version:References:In-Reply-To:From:Date:To:Subject; bh=tNSXPgmRNA+FUL53jTszUjg5sH6RZ3u1QpWUN+YxnSk=; b=l8TB8l/TrkZV6i6qWz+JFDqL0XnLVfZc2iaCvNVaSNs432wSJsDzmDWV4BrV4hUhmyNOfqUur8zvVmxMvPndw9rC4RdGDFsSo+lx/Rw7fbIH56uF5ik4KibcWYhh1R94ue3qsr4Jm/8Es+KUcM7IS7ad9ncW4QcerFiCt+uRLQp5Seew26ZupkR0u+bzxzvYSNmkiInTF16i49qk8lrerDh41S/GWzbjciHrZ5a4Oh0hGnnvHrfBADPL4skLMwjpUZpk/CVIDP7hKoSCC1gD0EOmS5VyXurczyjctocGWNpLFqnoQJk/l/aH7fXNiJt3jdYNlQ+JVVQ/M9eeLqeykw==; Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1st5bC-0001Hx-3M for bug-gnu-emacs@gnu.org; Tue, 24 Sep 2024 09:29:02 -0400 X-Loop: help-debbugs@gnu.org Resent-From: Eli Zaretskii Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Tue, 24 Sep 2024 13:29:01 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 73444 X-GNU-PR-Package: emacs Original-Received: via spool by 73444-submit@debbugs.gnu.org id=B73444.17271845014890 (code B ref 73444); Tue, 24 Sep 2024 13:29:01 +0000 Original-Received: (at 73444) by debbugs.gnu.org; 24 Sep 2024 13:28:21 +0000 Original-Received: from localhost ([127.0.0.1]:45555 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1st5aW-0001Go-F8 for submit@debbugs.gnu.org; Tue, 24 Sep 2024 09:28:20 -0400 Original-Received: from eggs.gnu.org ([209.51.188.92]:54820) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1st5aR-0001GV-64 for 73444@debbugs.gnu.org; Tue, 24 Sep 2024 09:28:18 -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 1st5Zw-0003HG-Nz; Tue, 24 Sep 2024 09:27:44 -0400 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=gnu.org; s=fencepost-gnu-org; h=MIME-version:References:Subject:In-Reply-To:To:From: Date; bh=tNSXPgmRNA+FUL53jTszUjg5sH6RZ3u1QpWUN+YxnSk=; b=eHUnUrcfAxjV9RfjKzqg KmPtDT/9YsyLOoqc8HYwaxERK7tIlZ4VyD5V4WMQaKNlkgSXRP16Dp6IS8xUeM8kFNwjWhFbS5ulR LsG4L/2uZGAvAkm8Jne4RKdFxOHEYxOESTjqfRJxiJXX6dtdiryQQBNdByXNUqL0MY3XXyyN1emCM 4C2fmRobQ5RuXWEa53TyuxxO340ooZ7luB9OwQXNwAs1BwzZqeYjJvJur7qtCes1ftnzA++3Q8h4u bKvgcRJB0P1Y8LznbKWyM3PY4aNbJAAW/GSpH18O8KprYU6qeQb3D5nv1aEKwrdBfP2dwUieCaFBm g/E4pLc9tuWdbw==; In-Reply-To: <87ed59xlb7.fsf@telefonica.net> (message from =?UTF-8?Q?=C3=93scar?= Fuentes on Tue, 24 Sep 2024 14:55:56 +0200) 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:292333 Archived-At: > From: Óscar Fuentes > Cc: 73444@debbugs.gnu.org > Date: Tue, 24 Sep 2024 14:55:56 +0200 > > I tested that Emacs/MinGW64 + _FORTIFY_SOURCE works with the > > #define read dummy_read > > hack. Once we put the prototype for sys_read on ms-w32.h, maybe there is > no need to put a conditional on _FORTIFY_SOURCE as well. I can check > that. Yes, I'd like to avoid the _FORTIFY_SOURCE conditional, so that this code is always used. > So, ok to install the workaround? On which branch? On master, please. > @@ -257,7 +257,7 @@ extern void w32_reset_stack_overflow_guard (void); > #define link sys_link > #define localtime sys_localtime > #undef read > -#define read sys_read > +#define read unwanted_read // Override the CRT read, see #73444 > #define rename sys_rename > #define rmdir sys_rmdir > #define select sys_select > @@ -380,6 +380,11 @@ extern struct tm *localtime_r (time_t const * restrict, struct tm * restrict); > #define fileno _fileno > #endif > > +// Here we override CRT read with our own, see #73444 > +#undef read > +#define read sys_read > +int sys_read (int, char *, unsigned int); > + > /* Defines that we need that aren't in the standard signal.h. */ > #define SIGHUP 1 /* Hang up */ > #define SIGQUIT 3 /* Quit process */ But please don't use "//" as comment style, and please don't forget mentioning the bug number in the commit log message. Thanks.