[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: igc, macOS avoiding signals
From: |
Eli Zaretskii |
Subject: |
Re: igc, macOS avoiding signals |
Date: |
Thu, 02 Jan 2025 11:05:14 +0200 |
> From: Stefan Kangas <stefankangas@gmail.com>
> Date: Thu, 2 Jan 2025 02:37:12 -0600
> Cc: eller.helmut@gmail.com, pipcet@protonmail.com, emacs-devel@gnu.org
>
> Gerd Möllmann <gerd.moellmann@gmail.com> writes:
>
> >> Mercy: I have a lot of other Emacs-related stuff on my plate, as you
> >> are well aware. Just keeping up with this discussion is already hard
> >> for me. Please help me by reaching out to the MPS folks about this
> >> issue.
> >
> > I think it should be something "official". Maybe Stefan Kangas could
> > contact them, or Richard.
>
> I'm happy to reach out to them in official capacity, but I'm not really
> close enough to the code to be able to usefully discuss the issue with
> them. So I think it might be best to put some or all of you in Cc.
>
> Before we do anything though, are we sure that it is faster to ask them
> to do things for us, instead of, say, just sending a patch? I'm not
> sure how confident people are with hacking MPS, but if we are still
> seriously entertaining the idea of a fork then maybe we should be, to
> some extent.
We don't know the answer, AFAIU. We could tell them that if they
prefer a patch, we can send one.
> If we do decide to contact them, I'm afraid that I don't have sufficient
> context to accurately describe the proposed callback. I would need to
> ask someone to summarize the idea in sufficient detail so that we can
> start a conversation.
The problem is that evidently (at least on Posix platforms), if a
program that uses MPS runs application code from a SIGPROF or a
SIGALRM or a SIGCHLD signal handler can trigger a recursive access to
the MPS arena, which causes a fatal signal if that happens while MPS
holds the arena lock. So we want to ask for a callback when MPS is
about to lock the arena, and another callback immediately after it
releases the lock. With that, we could defer the application code of
these signal handlers until after the arena is free to be accessed
again.
Alternatively, if MPS already has a solution for such applications
that use signals, we'd like to hear what they suggest.
As background, you can point them to this discussion:
https://lists.gnu.org/archive/html/emacs-devel/2024-06/msg00568.html