all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
From: Pip Cet via "Emacs development discussions." <emacs-devel@gnu.org>
To: Po Lu <luangruo@yahoo.com>
Cc: Eli Zaretskii <eliz@gnu.org>,
	gerd.moellmann@gmail.com, ali_gnu2@emvision.com,
	emacs-devel@gnu.org
Subject: Re: pdumper on Solaris 10
Date: Wed, 11 Dec 2024 11:29:03 +0000	[thread overview]
Message-ID: <8734iumpbi.fsf@protonmail.com> (raw)
In-Reply-To: <87v7vrqax6.fsf@yahoo.com>

"Po Lu" <luangruo@yahoo.com> writes:
> Eli Zaretskii <eliz@gnu.org> writes:
>>> From: Po Lu <luangruo@yahoo.com>
>>> Cc: Gerd Möllmann <gerd.moellmann@gmail.com>,  Eli
>>>  Zaretskii <eliz@gnu.org>,
>>>   ali_gnu2@emvision.com,  emacs-devel@gnu.org
>>> Date: Tue, 10 Dec 2024 08:04:03 +0800
>>>
>>> Pip Cet <pipcet@protonmail.com> writes:
>>>
>>> > I was talking about the non-mps branch, yes.  We should drop !USE_LSB,
>>> > which doesn't work in its original use case today and hasn't for a
>>> > while.  It does happen to work in the WIDE_EMACS_INT case, but that's a
>>> > fortuitous accident at best.
>>>
>>> I propose to make it work again.  It ought to be a simple matter of
>>> scanning stack slots twice, with and without tag bits.
>>
>> Patches to that effect will be welcome, thanks.
>
> Yes, like I said at the beginning of this (burgeoning) thread, I intend
> to return to active Emacs development after the release of Emacs 30.

That's great to hear, but I'd like to make a final (promise!) attempt to
dissuade you from making this particular change ("fixing" the code to
support !USE_LSB_TAG more often).

The changes that are necessary concern the most delicate part of the
garbage collector: ambiguous scanning needs to remove the tag (the easy
part), and live_cons_p etc. have to be changed to allow for more offsets
(we need to recognize pointers to &Lisp_Object + 4 as well as pointers
to &Lisp_Object itself; I think this bug is already present on
big-endian 32-bit builds utilizing WIDE_EMACS_INT, but no one's using
that).  I suspect other changes will be necessary (in particular, I
expect breakage on systems that use the high byte of 64-bit pointers, as
some Android systems do; I also expect there will be sign extension /
zero extension problems). The pdumper code also needs to be studied
carefully, and most likely changed. (Pure space and unexec will likely
have gone away by then, but they would be affected, too).  This is not a
quick fix.

What makes this code delicate is that it's very rare for a stack
reference, particularly an unusual one, to be the last reference that
keeps another object alive; even if we fail to recognize an ambiguous
reference and free the object it refers to, the most likely outcome is
an invisible UAF error, because we happen to use-after-free memory right
after the garbage collection, and it'll still have the expected
contents.

This part of the garbage collector has long been in need of some work
(we currently search the RB tree twice for every word, even though the
second pass is usually unnecessary). Obviously, that will be harder if
we change the code in other ways.

The very best outcome of making the changes you propose is that no one
will ever use the changed code; in that case, all that will be achieved
is to add unused code to a function that's already hard to understand,
and to make future changes that much harder.

But that's not what I think will hapen. What I think will happen is that
users will start or continue using !USE_LSB_TAG, try to switch to MPS,
run into a problem, (hopefully) report a bug, and we won't be able to
deal with that bug report because we're comparing a USE_LSB_TAG + MPS
build to a !USE_LSB_TAG + !MPS one, and it'll be impossible to tell
which of the two major changes are causing the problem.

In other words, every person affected by your proposed changes will be
unable to usefully test MPS. I think that's bad.

If you insist on making the changes, please make sure there is a visible
"feature" in the corresponding MPS build which will let us know that bug
reports are useless and should be disregarded. I personally won't ask
anyone to test MPS in a setting where they cannot usefully report bugs.

Obviously, reducing the number of people who can usefully test MPS will
make it slightly less likely it'll ever land.

Pip




  reply	other threads:[~2024-12-11 11:29 UTC|newest]

Thread overview: 146+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <mailman.39.1723910423.12184.emacs-devel@gnu.org>
2024-08-17 22:49 ` Emacs-devel Digest, Vol 246, Issue 17 ali_gnu2
2024-08-18  0:10   ` Po Lu
2024-08-18  0:19     ` Po Lu
2024-08-18  1:15     ` Solaris dldump (was: Pure space) ali_gnu2
2024-08-18  1:25       ` Solaris dldump Po Lu
2024-08-18 22:27         ` Stefan Kangas
2024-08-18 23:56           ` Po Lu
2024-08-19 11:18             ` Eli Zaretskii
2024-08-19 12:09               ` Po Lu
2024-08-19 12:50                 ` Eli Zaretskii
2024-08-19 11:44             ` Pip Cet
2024-08-19 11:57               ` Po Lu
2024-08-19 12:10                 ` Pip Cet
2024-08-19 12:55                   ` Eli Zaretskii
2024-08-19 13:46                     ` Pip Cet
2024-08-19 14:39                       ` Eli Zaretskii
2024-08-19 15:26                         ` Corwin Brust
2024-08-19 15:31                           ` Corwin Brust
2024-08-19 20:51                       ` Stefan Kangas
2024-08-19 20:35             ` Stefan Kangas
2024-12-08 12:17     ` pdumper on Solaris 10 Pip Cet via Emacs development discussions.
2024-12-08 13:05       ` Eli Zaretskii
2024-12-08 13:52         ` Pip Cet via Emacs development discussions.
2024-12-08 14:52           ` Eli Zaretskii
2024-12-08 16:17             ` Pip Cet via Emacs development discussions.
2024-12-08 16:49               ` Eli Zaretskii
2024-12-08 17:37                 ` Pip Cet via Emacs development discussions.
2024-12-08 18:41                   ` Eli Zaretskii
2024-12-08 19:15                     ` Gerd Möllmann
2024-12-08 20:38                       ` Eli Zaretskii
2024-12-09  3:09                         ` Gerd Möllmann
2024-12-09  3:32                           ` Eli Zaretskii
2024-12-09  3:43                             ` Gerd Möllmann
2024-12-09  4:53                               ` Stefan Kangas
2024-12-09  5:26                                 ` Gerd Möllmann
2024-12-09 13:58                                 ` Eli Zaretskii
2024-12-10  0:02                                   ` Po Lu
2024-12-09  9:56                           ` Pip Cet via Emacs development discussions.
2024-12-10  0:04                             ` Po Lu
2024-12-10  3:34                               ` Eli Zaretskii
2024-12-11  1:13                                 ` Po Lu
2024-12-11 11:29                                   ` Pip Cet via Emacs development discussions. [this message]
2024-12-09  4:59                     ` Stefan Kangas
2024-12-09 14:39                       ` Eli Zaretskii
2024-12-09 21:06                         ` Merging MPS a.k.a. scratch/igc, yet again Stefan Kangas
2024-12-09 21:49                           ` Óscar Fuentes
2024-12-10  4:17                             ` Xiyue Deng
2024-12-10  4:26                               ` Sean Whitton
2024-12-10  4:42                               ` chad
2024-12-10 13:10                               ` Óscar Fuentes
2024-12-10 15:10                                 ` Pip Cet via Emacs development discussions.
2024-12-10 15:37                                   ` Óscar Fuentes
2024-12-10 15:47                                     ` Pip Cet via Emacs development discussions.
2024-12-10 17:16                                     ` Eli Zaretskii
2024-12-12  4:37                                   ` Xiyue Deng
2024-12-19 16:02                                   ` Gregor Zattler
2024-12-19 17:32                                     ` Pip Cet via Emacs development discussions.
2024-12-19 18:12                                       ` Gerd Möllmann
2024-12-19 18:27                                         ` Eli Zaretskii
2024-12-19 18:39                                           ` Gerd Möllmann
2024-12-19 19:15                                         ` Pip Cet via Emacs development discussions.
2024-12-19 19:57                                           ` Gerd Möllmann
2024-12-20  6:39                                             ` Eli Zaretskii
2024-12-20  9:27                                       ` Gregor Zattler
2024-12-10 13:20                               ` Eli Zaretskii
2024-12-10 14:46                               ` Pip Cet via Emacs development discussions.
2024-12-10 13:09                             ` Eli Zaretskii
2024-12-10 13:20                               ` Óscar Fuentes
2024-12-10 14:41                                 ` Eli Zaretskii
2024-12-09 23:13                           ` chad
2024-12-10 12:41                           ` Eli Zaretskii
2024-12-10  0:09                         ` pdumper on Solaris 10 Stefan Kangas
2024-12-10 12:59                           ` Eli Zaretskii
2024-12-10 13:39                             ` Óscar Fuentes
2024-12-10 14:39                               ` Eli Zaretskii
2024-12-10 15:21                                 ` Óscar Fuentes
2024-12-10 16:39                                   ` Eli Zaretskii
2024-12-10 15:38                               ` Pip Cet via Emacs development discussions.
2024-12-10 16:04                                 ` Óscar Fuentes
2024-12-10 17:23                                   ` Eli Zaretskii
2024-12-11  5:27                                 ` Gap buffer problem? Gerd Möllmann
2024-12-11  8:50                                   ` Pip Cet via Emacs development discussions.
2024-12-11  9:35                                     ` Gerd Möllmann
2024-12-11 11:50                                       ` Pip Cet via Emacs development discussions.
2024-12-11 13:22                                         ` Gerd Möllmann
2024-12-11 14:53                                           ` Pip Cet via Emacs development discussions.
2024-12-11 15:33                                             ` Gerd Möllmann
2024-12-11 16:58                                               ` Eli Zaretskii
2024-12-11 17:13                                                 ` Gerd Möllmann
2024-12-11 17:45                                                   ` Robert Pluim
2024-12-11 18:11                                                     ` Gerd Möllmann
2024-12-11 19:08                                                     ` Eli Zaretskii
2024-12-11 17:41                                                 ` Pip Cet via Emacs development discussions.
2024-12-11 19:04                                                   ` Eli Zaretskii
2024-12-11 19:54                                                     ` Pip Cet via Emacs development discussions.
2024-12-11 20:26                                                       ` Eli Zaretskii
2024-12-11 22:07                                                       ` Dmitry Gutov
2024-12-11 19:09                                                   ` Gerd Möllmann
2024-12-12  8:55                                                     ` Robert Pluim
2024-12-12 10:14                                                       ` Gerd Möllmann
2024-12-11 12:27                                       ` Pip Cet via Emacs development discussions.
2024-12-11 13:27                                         ` Gerd Möllmann
2024-12-11 15:06                                           ` Marcus Harnisch
2024-12-11 22:11                                             ` Dmitry Gutov
2024-12-12  3:49                                               ` Gerd Möllmann
2024-12-12 19:07                                                 ` Dmitry Gutov
2024-12-12 19:30                                                   ` Eli Zaretskii
2024-12-12 19:40                                                   ` Gerd Möllmann
2024-12-12  6:01                                               ` Eli Zaretskii
2024-12-11 14:22                                   ` Eli Zaretskii
2024-12-11 15:51                                     ` Gerd Möllmann
2024-12-11 17:06                                       ` Eli Zaretskii
2024-12-11 17:15                                         ` Gerd Möllmann
2024-12-10 18:13                               ` pdumper on Solaris 10 Gerd Möllmann
2024-12-10 15:23                             ` Pip Cet via Emacs development discussions.
2024-12-10 17:08                               ` Eli Zaretskii
2024-12-10 18:03                                 ` Gerd Möllmann
2024-12-10 19:34                                   ` Pip Cet via Emacs development discussions.
2024-12-10 19:59                                     ` Gerd Möllmann
2024-12-10 20:17                                       ` Pip Cet via Emacs development discussions.
2024-12-10 20:34                                         ` Gerd Möllmann
2024-12-11 14:13                                   ` Pip Cet via Emacs development discussions.
2024-12-11 17:43                                     ` Eli Zaretskii
2024-12-14 14:30                                     ` Eli Zaretskii
2024-12-15 10:55                                       ` Pip Cet via Emacs development discussions.
2024-12-15 11:13                                         ` Eli Zaretskii
2024-12-15 12:09                                           ` Pip Cet via Emacs development discussions.
2024-12-15 12:52                                             ` Eli Zaretskii
2024-12-15 19:54                                             ` John ff
2024-12-17 19:10                                           ` Paul Eggert
2024-12-17 19:43                                             ` Pip Cet via Emacs development discussions.
2024-12-17 20:00                                               ` Paul Eggert
2024-12-17 20:19                                             ` Eli Zaretskii
2024-12-17 21:14                                               ` Paul Eggert
2024-12-09 16:21                       ` Pip Cet via Emacs development discussions.
2024-12-17 13:12                     ` Pip Cet via Emacs development discussions.
2024-12-17 14:16                       ` Eli Zaretskii
2024-12-18  0:55                       ` Po Lu
2024-12-18  9:24                         ` Pip Cet via Emacs development discussions.
2024-12-08 18:47                 ` Pip Cet via Emacs development discussions.
2024-12-09  1:13                 ` Po Lu
2024-12-09  1:08           ` Po Lu
2024-12-09  0:58       ` Po Lu
2024-12-09  3:28         ` Eli Zaretskii
2024-12-09  1:01       ` Po Lu
2024-12-09 13:11         ` Pip Cet via Emacs development discussions.

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=8734iumpbi.fsf@protonmail.com \
    --to=emacs-devel@gnu.org \
    --cc=ali_gnu2@emvision.com \
    --cc=eliz@gnu.org \
    --cc=gerd.moellmann@gmail.com \
    --cc=luangruo@yahoo.com \
    --cc=pipcet@protonmail.com \
    /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.