From: Pip Cet <pipcet@protonmail.com>
To: Eli Zaretskii <eliz@gnu.org>
Cc: emacs-devel@gnu.org
Subject: Re: scratch/igc 90e80a9a53e 6/6: Adjust igc.c code to header changes
Date: Mon, 22 Jul 2024 14:35:23 +0000 [thread overview]
Message-ID: <LvEQ2QFGBAvBP5FRYUPSrww-7VAgdJ37j3nqgnB289H4HVlxAR-fdqvFaJPwFzjd1m9blvw4FfmlL8PRw9BvXShxjaMnlaRmYQQoqp6EjqQ=@protonmail.com> (raw)
In-Reply-To: <86cyn6bti1.fsf@gnu.org>
On Sunday, July 21st, 2024 at 16:27, Eli Zaretskii <eliz@gnu.org> wrote:
> > Date: Sun, 21 Jul 2024 16:20:57 +0000
>
> > From: Pip Cet pipcet@protonmail.com
> > Cc: emacs-devel@gnu.org
> >
> > > Why cannot you identify this kind of object during dumping, and avoid
> > > applying whatever igc_dump_finish_obj does?
> >
> > You mean you'd prefer to leave the pseudovector header for builtin subrs at its current value? We can do that, but I think the MPS header should still be valid. (It's not with the patch I had attached: that makes it claim an object size of 112 bytes when it's actually just 96 bytes, and that causes us to overwrite the first 16 bytes after the last subr; in my case, stdout... Anyway, next patch attached, which duplicates a bit of code unnecessarily.)
>
>
> Then why doesn't your patch do that?
I don't understand why it should. The pseudovector headers of main_thread and the subroutines are, currently, simply wrong:
(gdb) p vectorlike_nbytes(&Scall_interactively)
$1 = 2415919112
(gdb) p vectorlike_nbytes(&main_thread)
$2 = 584
(gdb) p sizeof(main_thread)
$3 = 520
(gdb) p sizeof(Scall_interactively)
$4 = 88
> And this new patch is even more massive than the previous one?
It is "even more massive" than a one-liner because there were additional bugs to fix, yes. As demonstrated above, vectorlike_nbytes doesn't work on subroutines because they lack the pseudovector flag, so I had to duplicate some code from alloc.c to use pseudovector_nbytes instead.
> In any case, if we need to change the definition of Aligned_Lisp_Subr,
> let's do that only "#if HAVE_MPS", and leave the old code intact.
No objections there.
I've found two more bugs that popped up testing this in various configurations: not protecting Vinternal_interpreter_environment (fun to debug, as might be imagined) and using xfree rather than igc_xfree in sort.c. Both may have affected dumping, so I'll push all three fixes and then hopefully things will work again.
Pip
prev parent reply other threads:[~2024-07-22 14:35 UTC|newest]
Thread overview: 8+ messages / expand[flat|nested] mbox.gz Atom feed top
2024-07-21 10:47 scratch/igc 90e80a9a53e 6/6: Adjust igc.c code to header changes Eli Zaretskii
2024-07-21 11:42 ` Pip Cet
2024-07-21 12:07 ` Eli Zaretskii
2024-07-21 14:11 ` Pip Cet
2024-07-21 14:25 ` Eli Zaretskii
2024-07-21 16:20 ` Pip Cet
2024-07-21 16:27 ` Eli Zaretskii
2024-07-22 14:35 ` Pip Cet [this message]
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='LvEQ2QFGBAvBP5FRYUPSrww-7VAgdJ37j3nqgnB289H4HVlxAR-fdqvFaJPwFzjd1m9blvw4FfmlL8PRw9BvXShxjaMnlaRmYQQoqp6EjqQ=@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 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).