On Sunday, July 21st, 2024 at 14:25, Eli Zaretskii wrote: > > Date: Sun, 21 Jul 2024 14:11:56 +0000 > > > From: Pip Cet pipcet@protonmail.com > > Cc: emacs-devel@gnu.org > > > > > Does the below help? > > > > > > #4 dump_write (ctx=0x71ceb38, buf=0x71ce848, nbyte=8) at pdumper.c:792 > > > 792 dump_write (struct dump_context *ctx, const void *buf, dump_off nbyte) > > > (gdb) p ctx->igc_obj_dumped > > > > > > $1 = (void *) 0xc3f000 > > > > Thanks, that helps a lot! It's an internal subr, and those don't store their proper size in the pseudovector header, so we don't dump them properly as we trust the pseudovector header. > > > > I've managed to reproduce something similar here, and the attached patch helps, but it probably breaks GC in the !HAVE_MPS case. > > > 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.) > There's the PVEC_SUBR in the struct, no? Yes, there is. Pip