From: "Gerd Möllmann" <gerd.moellmann@gmail.com>
To: Helmut Eller <eller.helmut@gmail.com>
Cc: Eli Zaretskii <eliz@gnu.org>, Emacs Devel <emacs-devel@gnu.org>
Subject: Re: MPS prstack
Date: Mon, 20 May 2024 20:21:02 +0200 [thread overview]
Message-ID: <m21q5wcpkh.fsf@pro2.fritz.box> (raw)
In-Reply-To: <87o790qsgm.fsf@gmail.com> (Helmut Eller's message of "Mon, 20 May 2024 19:54:49 +0200")
Helmut Eller <eller.helmut@gmail.com> writes:
> In print.c, there is a global variable prstack that is not yet scanned.
> This causes a crash for comp-tests but this example triggers the same
> problem:
>
> (progn
> (defun make-tree (i)
> (cond ((= i 0) nil)
> (t (list (make-string 10000 i)
> (make-tree (1- i)) (make-tree (1- i))))))
> (prin1-to-string (make-tree 13)))
>
> We could create an ambiguous root for this but I thought it would be an
> interesting exercise to scan it exactly. It's interesting because this is
> a static variable and the type is only declared in print.c. So I added
> a new function igc_xpalloc_exact to igc.h. That uses a callback that
> calls another callback. I'm not sure if this allowed by the MPS rules
> but it seems to work or at least doesn't seem to crash.
>
> WDYT?
LGTM and pushed. Thanks!
AFAICT, taking the reference literally, it is permissible to pass the
mps_ss_t around. It merely says this
type mps_ss_t
The type of scan states.
A scan state represents the state of the current scan. The MPS passes
a scan state to the scan method of an object format when it needs to
scan for references within a region of memory. The scan method must
pass the scan state to MPS_SCAN_BEGIN and MPS_SCAN_END to delimit a
sequence of fix operations, and to the functions MPS_FIX1(),
MPS_FIX2() and MPS_FIX12() when fixing a reference.
And that we do...
And it doesn't crash :-)
I've BTW also protected all the user-defined hash test functions in some
commit today, which are malloc'd in fns.c. Reason is that these persist
beyond the lifetime of hash tables using them, IIUC. Strange thing,
somewhat. Whatever :-).
next prev parent reply other threads:[~2024-05-20 18:21 UTC|newest]
Thread overview: 22+ messages / expand[flat|nested] mbox.gz Atom feed top
2024-05-20 17:54 MPS prstack Helmut Eller
2024-05-20 18:21 ` Gerd Möllmann [this message]
2024-05-20 18:32 ` Helmut Eller
2024-05-21 3:30 ` Gerd Möllmann
2024-05-22 16:27 ` Helmut Eller
2024-05-22 17:55 ` Gerd Möllmann
2024-05-24 14:17 ` Helmut Eller
2024-05-24 14:27 ` Gerd Möllmann
2024-05-25 13:45 ` Gerd Möllmann
2024-05-27 7:27 ` Helmut Eller
2024-05-27 8:43 ` Gerd Möllmann
2024-05-27 9:15 ` Helmut Eller
2024-05-27 9:47 ` Gerd Möllmann
2024-05-27 11:45 ` Eli Zaretskii
2024-05-27 12:39 ` Helmut Eller
2024-05-27 13:12 ` Eli Zaretskii
2024-05-27 14:15 ` Helmut Eller
2024-05-27 14:37 ` Mattias Engdegård
2024-05-27 14:54 ` Helmut Eller
2024-05-27 14:43 ` Po Lu
2024-05-27 15:08 ` Helmut Eller
2024-05-27 11:34 ` 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
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=m21q5wcpkh.fsf@pro2.fritz.box \
--to=gerd.moellmann@gmail.com \
--cc=eliz@gnu.org \
--cc=eller.helmut@gmail.com \
--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 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).