all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
From: Pip Cet <pipcet@protonmail.com>
To: Eli Zaretskii <eliz@gnu.org>
Cc: emacs-devel@gnu.org
Subject: Re: MPS: Win64 testers?
Date: Sat, 27 Jul 2024 15:49:59 +0000	[thread overview]
Message-ID: <tUG9SOVfHPRFBuOkirOfxGUtGqcbWBrIwCxyMthuZfhuUZnKtrLmkG2brvaJKV1OFWuJP80AXvQq9Woj0CGDrQr3fQLssU1IRfhg8nCQvJ8=@protonmail.com> (raw)
In-Reply-To: <86ttgb1186.fsf@gnu.org>

On Saturday, July 27th, 2024 at 12:14, Eli Zaretskii <eliz@gnu.org> wrote:
> > Date: Sat, 27 Jul 2024 10:42:12 +0000
> 
> > From: Pip Cet pipcet@protonmail.com
> > Cc: emacs-devel@gnu.org
> > 
> > > 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 where
> > > did you see that "we allocate handlers with 8-byte alignment in MPS
> > > builds"?
> > 
> > All our pools are aligned to IGC_ALIGN, which is GCALIGNMENT, which is 8 bytes on this system.
> > [...]
> > 
> > > > - force LISP_ALIGNMENT to be 8, not 16
> > > 
> > > 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?
> > 
> > emacs_align_type contains struct thread_state, which contains a jmpbuf, which is 16-byte aligned.
> 
> 
> 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
> > > 
> > > Why would this be any different from a non-MPS build for 64-bit MinGW?
> > 
> > Because non-MPS allocates handlers with xmalloc(), which is 16-byte aligned, 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.
> 
> 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 for MPS_KEY_FMT_ALIGN. Currently the code passes 8, which is necessary to keep 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 you
> > > > link against MSVCRT instead?
> > 
> > I'm using the msys2-docker-experimental image with MSYSTEM=MINGW64. I don't know whether that means I'm using UCRT, sorry. If I use MSYSTEM=UCRT64, I get many more and different problems...
> 
> 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, stderr, 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 != 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 = _fdopen (0, "r");

but I'm not sure the variable (or macro) stdin is an lvalue. That's probably 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 instead were discarded.

Pip



  reply	other threads:[~2024-07-27 15:49 UTC|newest]

Thread overview: 124+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-07-24 15:45 MPS: Win64 testers? Pip Cet
2024-07-25  7:16 ` Eli Zaretskii
2024-07-25 15:39   ` Pip Cet
2024-07-27  8:02     ` Eli Zaretskii
2024-07-27 10:42       ` Pip Cet
2024-07-27 12:14         ` Eli Zaretskii
2024-07-27 15:49           ` Pip Cet [this message]
2024-07-27 16:10             ` Eli Zaretskii
2024-07-27 16:56               ` Eli Zaretskii
2024-07-27 18:27                 ` Pip Cet
2024-07-27 18:50                   ` Eli Zaretskii
2024-07-27 20:22                     ` Pip Cet
2024-07-28  5:25                       ` Eli Zaretskii
2024-07-28 13:00                         ` Pip Cet
2024-07-28 14:20                           ` Eli Zaretskii
2024-07-28 15:00                             ` Pip Cet
2024-07-28 15:20                               ` Eli Zaretskii
2024-07-28 20:22                                 ` Pip Cet
2024-07-29 11:25                                   ` Eli Zaretskii
2024-07-31  6:18                                     ` Pip Cet
2024-07-31 14:02                                       ` Eli Zaretskii
2024-07-31 19:04                                         ` Sebastián Monía
2024-08-01  5:00                                           ` Eli Zaretskii
2024-08-03  7:50                                         ` pipcet
2024-08-03  9:23                                           ` Eli Zaretskii
2024-08-03 15:17                                             ` pipcet
2024-08-03 16:07                                               ` Eli Zaretskii
2024-07-30  2:51               ` MPS: Lose64 testers? Richard Stallman
2024-07-27 16:09         ` MPS: Win64 testers? Michael Albinus
2024-07-28 13:22           ` Pip Cet
2024-07-28 17:32             ` Emba (was: MPS: Win64 testers?) Michael Albinus
  -- strict thread matches above, loose matches on Subject: below --
2024-07-25  9:45 MPS: Win64 testers? Angelo Graziosi
2024-07-25 10:02 ` Stefan Kangas
2024-07-25 11:35 ` Eli Zaretskii
2024-07-27 14:22   ` Angelo Graziosi
2024-08-06  3:04 Quang Kien Nguyen
2024-08-06  7:03 ` Quang Kien Nguyen
2024-08-06 11:40 ` Eli Zaretskii
2024-08-06 17:39   ` Quang Kien Nguyen
2024-08-06 18:32     ` Eli Zaretskii
2024-08-06 20:52       ` Quang Kien Nguyen
2024-08-07 11:41         ` Eli Zaretskii
2024-08-07 18:32           ` Quang Kien Nguyen
2024-08-08  5:46             ` Eli Zaretskii
2024-08-08 23:44               ` Quang Kien Nguyen
2024-08-09  6:00                 ` Eli Zaretskii
2024-08-09  6:10                   ` Eli Zaretskii
2024-08-09  9:19                     ` Quang Kien Nguyen
2024-08-09 11:03                       ` Eli Zaretskii
2024-08-13 12:12                         ` Quang Kien Nguyen
2024-08-13 12:37                           ` Eli Zaretskii
2024-08-13 15:51                             ` Pip Cet
2024-08-13 18:26                               ` Quang Kien Nguyen
2024-08-13 19:19                                 ` Eli Zaretskii
2024-08-13 20:22                                   ` Quang Kien Nguyen
2024-08-14 13:11                                     ` Sebastián Monía
2024-08-14 17:24                                       ` Quang Kien Nguyen
2024-08-16 20:09                                         ` Sebastián Monía
2024-08-17 11:37                                           ` Sebastián Monía
2024-08-17 12:54                                             ` Eli Zaretskii
2024-08-17 13:24                                               ` Sebastián Monía
2024-08-19 14:34                                                 ` Sebastián Monía
2024-08-19 14:55                                                   ` Eli Zaretskii
2024-08-19 15:12                                                     ` Pip Cet
2024-08-19 15:23                                                     ` Sebastián Monía
2024-08-19 15:31                                                       ` Quang Kien Nguyen
2024-08-19 16:23                                                         ` Quang Kien Nguyen
2024-08-21 18:14                                                           ` Sebastián Monía
2024-08-21 18:20                                                             ` Pip Cet
2024-08-21 19:46                                                               ` Sebastián Monía
2024-08-21 18:22                                                             ` Ihor Radchenko
2024-08-21 19:48                                                               ` Sebastián Monía
2024-08-22 17:34                                                             ` Sebastián Monía
2024-08-22 17:51                                                               ` Pip Cet
2024-08-22 18:34                                                                 ` Eli Zaretskii
2024-08-22 19:12                                                                   ` Quang Kien Nguyen
2024-08-23  5:32                                                                     ` Eli Zaretskii
2024-08-22 19:14                                                                   ` Pip Cet
2024-08-23  5:38                                                                     ` Eli Zaretskii
2024-08-23  7:59                                                                       ` Pip Cet
2024-08-23 13:08                                                                         ` Eli Zaretskii
2024-08-23 13:42                                                                           ` Quang Kien Nguyen
2024-08-23 13:48                                                                             ` Pip Cet
2024-08-23 14:35                                                                               ` Eli Zaretskii
2024-08-23 14:54                                                                                 ` Quang Kien Nguyen
2024-08-23 16:08                                                                                   ` Eli Zaretskii
2024-08-23 18:23                                                                                   ` Sebastián Monía
2024-08-23 13:44                                                                           ` Pip Cet
2024-08-23 14:32                                                                             ` Eli Zaretskii
2024-08-23 15:51                                                                               ` Pip Cet
2024-08-23 16:17                                                                                 ` Eli Zaretskii
2024-08-23 18:57                                                                                   ` Pip Cet
2024-08-23 19:28                                                                                     ` Eli Zaretskii
2024-08-24 17:31                                                                         ` Pip Cet
2024-08-25  3:17                                                                           ` Quang Kien Nguyen
2024-08-30 19:59                                                                             ` Sebastián Monía
2024-09-01  8:21                                                                               ` Kien Nguyen
2024-09-01  8:43                                                                                 ` Eli Zaretskii
2024-09-01  9:36                                                                                   ` Kien Nguyen
2024-09-01 10:28                                                                                     ` Eli Zaretskii
2024-09-01 11:59                                                                                       ` Eli Zaretskii
2024-09-01 18:54                                                                                         ` Kien Nguyen
2024-09-01 19:27                                                                                           ` Eli Zaretskii
2024-09-01 19:44                                                                                           ` Pip Cet
2024-09-01 21:42                                                                                             ` Kien Nguyen
2024-09-02 11:08                                                                                             ` Eli Zaretskii
2024-09-03  4:12                                                                                               ` Kien Nguyen
2024-09-03 10:37                                                                                                 ` Pip Cet
2024-09-03 16:50                                                                                                   ` Kien Nguyen
2024-09-03 17:48                                                                                                     ` Pip Cet
2024-09-07  8:19                                                                                           ` Eli Zaretskii
2024-09-20 15:09                                                                                             ` Sebastián Monía
2024-09-20 15:44                                                                                               ` Eli Zaretskii
2024-09-23 16:21                                                                                                 ` Kien Nguyen
2024-09-01 10:49                                                                                 ` Pip Cet
2024-09-01 12:15                                                                                   ` Kien Nguyen
2024-08-22 18:11                                                               ` Eli Zaretskii
2024-08-22 19:17                                                                 ` Sebastián Monía
2024-08-23  5:45                                                                   ` Eli Zaretskii
2024-08-07 19:50           ` Pip Cet
2024-08-07 23:14             ` Quang Kien Nguyen
2024-08-08  5:15             ` Eli Zaretskii
2024-08-06 14:18 ` Pip Cet
2024-08-07 11:03   ` Eli Zaretskii

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

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

  git send-email \
    --in-reply-to='tUG9SOVfHPRFBuOkirOfxGUtGqcbWBrIwCxyMthuZfhuUZnKtrLmkG2brvaJKV1OFWuJP80AXvQq9Woj0CGDrQr3fQLssU1IRfhg8nCQvJ8=@protonmail.com' \
    --to=pipcet@protonmail.com \
    --cc=eliz@gnu.org \
    --cc=emacs-devel@gnu.org \
    /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 external index

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

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.