From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Pip Cet Newsgroups: gmane.emacs.devel Subject: Re: MPS: Win64 testers? Date: Sat, 27 Jul 2024 15:49:59 +0000 Message-ID: References: <86le1q54bw.fsf@gnu.org> <86zfq31cvc.fsf@gnu.org> <86ttgb1186.fsf@gnu.org> Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="18628"; mail-complaints-to="usenet@ciao.gmane.io" Cc: emacs-devel@gnu.org To: Eli Zaretskii Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane-mx.org@gnu.org Sat Jul 27 18:14:09 2024 Return-path: Envelope-to: ged-emacs-devel@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 1sXk3c-0004jw-MR for ged-emacs-devel@m.gmane-mx.org; Sat, 27 Jul 2024 18:14:08 +0200 Original-Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1sXk3I-00028r-Ci; Sat, 27 Jul 2024 12:13:48 -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 1sXjgO-0001iz-Mp for emacs-devel@gnu.org; Sat, 27 Jul 2024 11:50:08 -0400 Original-Received: from mail-40133.protonmail.ch ([185.70.40.133]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1sXjgM-0003RG-4m for emacs-devel@gnu.org; Sat, 27 Jul 2024 11:50:08 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=protonmail.com; s=protonmail3; t=1722095402; x=1722354602; bh=OE+hXrqPTSDlvAnWHBioZrj7FF8o+aNb7eVhRT5Tnmk=; h=Date:To:From:Cc:Subject:Message-ID:In-Reply-To:References: Feedback-ID:From:To:Cc:Date:Subject:Reply-To:Feedback-ID: Message-ID:BIMI-Selector; b=BASRtYGWojtc79IUEFzNNKibnSQxnywaMY530rP3OmjITyTnZIJBKos6wrBDg2CbK t7ZSt4AlEyS/JFInc5eNJG0J2DUd8ze1ZokABPsqLZqIMhv5I/afWN1renyd55f66m KmflbesNRPwoZ8aTk+WLxpDIBwpAzvZ/DvBW2XFjjHFZLPriRUkke+RJL3E7DgMUyr rUAx84qs16UbwtiBxxwvjkz9cuI61REU8RZx/jfl5zqmWRDXn4j/kqSEIUWFxYOVrX 7/Zj9sv7m6ZYAc9WFZnKyk1lP4zB5ejOnqfJsR2feMW7J5YiojtcAyQro4QhmMySEk cCmctydkodGqA== In-Reply-To: <86ttgb1186.fsf@gnu.org> Feedback-ID: 112775352:user:proton X-Pm-Message-ID: 85ae43704fca2d0a9ccf9248a491d7d309fa841e Received-SPF: pass client-ip=185.70.40.133; envelope-from=pipcet@protonmail.com; helo=mail-40133.protonmail.ch X-Spam_score_int: -27 X-Spam_score: -2.8 X-Spam_bar: -- X-Spam_report: (-2.8 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, FREEMAIL_FROM=0.001, RCVD_IN_DNSWL_LOW=-0.7, RCVD_IN_MSPIKE_H4=0.001, RCVD_IN_MSPIKE_WL=0.001, SPF_HELO_PASS=-0.001, SPF_PASS=-0.001 autolearn=unavailable autolearn_force=no X-Spam_action: no action X-Mailman-Approved-At: Sat, 27 Jul 2024 12:13:39 -0400 X-BeenThere: emacs-devel@gnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "Emacs development discussions." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: emacs-devel-bounces+ged-emacs-devel=m.gmane-mx.org@gnu.org Original-Sender: emacs-devel-bounces+ged-emacs-devel=m.gmane-mx.org@gnu.org Xref: news.gmane.io gmane.emacs.devel:322135 Archived-At: On Saturday, July 27th, 2024 at 12:14, Eli Zaretskii wrote: > > Date: Sat, 27 Jul 2024 10:42:12 +0000 >=20 > > From: Pip Cet pipcet@protonmail.com > > Cc: emacs-devel@gnu.org > >=20 > > > If the "_setjmp_ex assumes 16-byte alignment of jmp_buf to store the > > > XMM registers" part is about what Wine does, then my question is wher= e > > > did you see that "we allocate handlers with 8-byte alignment in MPS > > > builds"? > >=20 > > All our pools are aligned to IGC_ALIGN, which is GCALIGNMENT, which is = 8 bytes on this system. > > [...] > >=20 > > > > - force LISP_ALIGNMENT to be 8, not 16 > > >=20 > > > Does this mean 'struct Lisp_*' structures are 16-byte aligned in the > > > 64-bit MinGW build? If not, what forces LISP_ALIGNMENT to be 16? > >=20 > > emacs_align_type contains struct thread_state, which contains a jmpbuf,= which is 16-byte aligned. >=20 >=20 > And that is specific to MS-Windows? Don't Posix systems store XMM > registers in jmpbuf as well? The SYSV ABI declares all XMM registers to be caller-saved, which means on = such systems we don't store the XMM registers in a jmpbuf. > > > > - make sys_setjmp and sys_longjmp use a larger buffer and memmove()= the data in it so it's 16-byte aligned > > >=20 > > > Why would this be any different from a non-MPS build for 64-bit MinGW= ? > >=20 > > Because non-MPS allocates handlers with xmalloc(), which is 16-byte ali= gned, and the jmpbuf in it is, too. I expect the change is required on MPS = builds on native Windows, too, though, because that also specifies 16-byte = alignment for jmpbuf, IIUC. >=20 > Maybe the way you made MPS compile with MinGW64 is incorrect, Very possible. > because > it ought to return the same alignment as malloc on the target > platform? I'm not sure that's correct, I think it assumes you pass the right value fo= r MPS_KEY_FMT_ALIGN. Currently the code passes 8, which is necessary to kee= p conses at a mere 24 bytes. > What is the value of MPS_PF_ALIGN you used for building > MPS? Also, did the library pass the test suite? I had some failures > until I set MPS_PF_ALIGN to the right value (8 for the 32-bit build). The patch you sent has it at 4, though? > > > > - disable the failure exit on close_stream failure in sysdep.c, and= silently ignore such errors > > > > I guess you are using UCRT? These problems with UCRT are known, but > > > > no one came up with an explanation for them yet. What happens if yo= u > > > > link against MSVCRT instead? > >=20 > > I'm using the msys2-docker-experimental image with MSYSTEM=3DMINGW64. I= don't know whether that means I'm using UCRT, sorry. If I use MSYSTEM=3DUC= RT64, I get many more and different problems... >=20 > There are no problems with close_stream when linking against MSVCRT, > AFAIK. Problems such as what you report were only reported in UCRT > build. I think the problem is init_ntproc in w32.c, which closes stdin, stdout, st= derr, then calls _fdopen and assumes the result will live in stdin, stdout,= stderr again. If I disable that code the backtick problem goes away: fclose (stdin); fclose (stdout); fclose (stderr); if (stdin_save !=3D INVALID_HANDLE_VALUE) _open_osfhandle ((intptr_t) stdin_save, O_TEXT); else _open ("nul", O_TEXT | O_NOINHERIT | O_RDONLY); _fdopen (0, "r"); I believe that last line should, possibly, on some systems, be stdin =3D _fdopen (0, "r"); but I'm not sure the variable (or macro) stdin is an lvalue. That's probabl= y why close_stream(stdout) and close_stream(stderr) fail, too: the streams = they refer to are already closed, and the new streams we should be using in= stead were discarded. Pip