unofficial mirror of emacs-devel@gnu.org 
 help / color / mirror / code / Atom feed
From: Pip Cet <pipcet@protonmail.com>
To: Eli Zaretskii <eliz@gnu.org>
Cc: gerd.moellmann@gmail.com, yantar92@posteo.net,
	emacs-devel@gnu.org, eller.helmut@gmail.com
Subject: Re: MPS: a random backtrace while toying with gdb
Date: Sun, 30 Jun 2024 13:06:29 +0000	[thread overview]
Message-ID: <_TT3eLHz9Qo3sgDjPUpuNupK6Xb4vQLiDXsBUuGFoP8fNT61mte-VMXuckIhkPR1-fAGoRWmnppAXOuKcvN8BnOlLGmHKFwM4vgvoWOtrmc=@protonmail.com> (raw)
In-Reply-To: <86ed8ehg6l.fsf@gnu.org>

On Sunday, June 30th, 2024 at 10:34, Eli Zaretskii <eliz@gnu.org> wrote:
> > Date: Sun, 30 Jun 2024 10:16:42 +0000
> > From: Pip Cet pipcet@protonmail.com
> > Cc: gerd.moellmann@gmail.com, yantar92@posteo.net, emacs-devel@gnu.org, eller.helmut@gmail.com
> >
> > > > We could always "steal" the SIGSEGV handler and reinstall it with a sigmask (without modifying the MPS source). My guess is that's equivalent to what the macOS code does, essentially, by using a different class of signal that blocks POSIX signals...
> > >
> > > And this is less "ugly" (let alone more safe) than using sigblock?
> > > What am I missing?

And, yes, as far as I can tell my proposed solution is safer.

> > Mostly, I think, the race condition where the barrier is installed (by MPS) some time before dflt_scan is even called (and, symmetrically, we'd unblock it too early while the barrier is still in effect). IOW, sigblock wouldn't work.
>
>
> Then we should block signals earlier, e.g., in igc_alloc (and any
> other place which could cause our objects moved).

That would be a very expensive and error-prone way of achieving the same result as simply blocking the signals while handling SIGSEGV.

> > (I should point out that you've convinced me as far as SIGPROF goes. At least for the initial stage, it makes more sense to count hits in GC (which we do, with false positives, using the current scratch/igc code) than to delay signal processing until GC is over).
>
>
> SIGPROF is not the only one.

It's the only one where I am not convinced the right thing is to simply block it using sa_sigmask.

> We have other useful signals, and we
> need to think about a solution that will cover most if not all of
> them. I've listed the signals that came to mind a few messages ago.

Those would be handled just fine by blocking all but the known-to-be-safe SIGPROF while handling SIGSEGV.

> I still cannot believe MPS doesn't have a canonical solution for these
> cases.

I haven't been able to find one in the docs. It still seems a simple oversight in the MPS code to me that they don't simply block all signals while handling SIGSEGV, or provide an API to set the mask.

Pip



  reply	other threads:[~2024-06-30 13:06 UTC|newest]

Thread overview: 68+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-06-29 19:12 MPS: a random backtrace while toying with gdb Ihor Radchenko
2024-06-29 19:19 ` Pip Cet
2024-06-29 21:46   ` Gerd Möllmann
2024-06-30  4:55     ` Eli Zaretskii
2024-06-30  5:33       ` Gerd Möllmann
2024-06-30  6:16         ` Eli Zaretskii
2024-06-30  6:43           ` Gerd Möllmann
2024-06-30  8:52             ` Eli Zaretskii
2024-06-30  9:43               ` Gerd Möllmann
2024-06-30 10:05                 ` Eli Zaretskii
2024-06-30 11:20                   ` Gerd Möllmann
2024-06-30 12:16                     ` Eli Zaretskii
2024-06-30 12:43                       ` Gerd Möllmann
2024-06-30  9:36     ` Helmut Eller
2024-06-30 10:00       ` Eli Zaretskii
2024-06-30 10:24         ` Helmut Eller
2024-06-30 10:43           ` Eli Zaretskii
2024-06-30 18:42             ` Helmut Eller
2024-06-30 18:59               ` Gerd Möllmann
2024-06-30 19:25               ` Pip Cet
2024-06-30 19:49                 ` Ihor Radchenko
2024-06-30 20:09                 ` Eli Zaretskii
2024-06-30 20:32                   ` Pip Cet
2024-07-01 11:07                     ` Eli Zaretskii
2024-07-01 17:27                       ` Pip Cet
2024-07-01 17:42                         ` Ihor Radchenko
2024-07-01 18:08                         ` Eli Zaretskii
2024-07-02  7:55                           ` Pip Cet
2024-07-02 13:10                             ` Eli Zaretskii
2024-07-02 14:24                               ` Pip Cet
2024-07-02 14:57                                 ` Eli Zaretskii
2024-07-02 17:06                                   ` Pip Cet
2024-07-03 11:31                                     ` Pip Cet
2024-07-03 11:50                                       ` Eli Zaretskii
2024-07-03 14:35                                         ` Pip Cet
2024-07-03 15:41                                           ` Eli Zaretskii
2024-07-01  2:33                 ` Eli Zaretskii
2024-07-01  6:05                 ` Helmut Eller
2024-06-30 19:58               ` Eli Zaretskii
2024-06-30 21:08                 ` Ihor Radchenko
2024-07-01  2:35                   ` Eli Zaretskii
2024-07-01 11:13                   ` Eli Zaretskii
2024-07-01 11:47                     ` Ihor Radchenko
2024-07-01 12:33                       ` Eli Zaretskii
2024-07-01 17:17                         ` Ihor Radchenko
2024-07-01 17:44                           ` Eli Zaretskii
2024-07-01 18:01                             ` Ihor Radchenko
2024-07-01 18:16                               ` Eli Zaretskii
2024-07-01 18:24                                 ` Ihor Radchenko
2024-07-01 18:31                                   ` Eli Zaretskii
2024-07-01 18:51                                     ` Ihor Radchenko
2024-07-01 19:05                                       ` Eli Zaretskii
2024-07-01 19:34                                       ` Gerd Möllmann
2024-07-01 20:00                                         ` Ihor Radchenko
2024-07-02  4:33                                           ` Gerd Möllmann
2024-07-02  7:05                                             ` Ihor Radchenko
2024-07-02  7:06                                               ` Gerd Möllmann
2024-07-01 18:19                               ` Gerd Möllmann
2024-07-01 18:23                                 ` Eli Zaretskii
2024-06-30 11:07           ` Gerd Möllmann
2024-06-30 11:06         ` Gerd Möllmann
2024-06-30 11:05       ` Gerd Möllmann
2024-06-30  9:59     ` Pip Cet
2024-06-30 10:09       ` Eli Zaretskii
2024-06-30 10:16         ` Pip Cet
2024-06-30 10:34           ` Eli Zaretskii
2024-06-30 13:06             ` Pip Cet [this message]
2024-06-30 11:10       ` Gerd Möllmann

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

  List information: https://www.gnu.org/software/emacs/

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

  git send-email \
    --in-reply-to='_TT3eLHz9Qo3sgDjPUpuNupK6Xb4vQLiDXsBUuGFoP8fNT61mte-VMXuckIhkPR1-fAGoRWmnppAXOuKcvN8BnOlLGmHKFwM4vgvoWOtrmc=@protonmail.com' \
    --to=pipcet@protonmail.com \
    --cc=eliz@gnu.org \
    --cc=eller.helmut@gmail.com \
    --cc=emacs-devel@gnu.org \
    --cc=gerd.moellmann@gmail.com \
    --cc=yantar92@posteo.net \
    /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 public inbox

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

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).