[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: MPS: Forwording symbols
From: |
Gerd Möllmann |
Subject: |
Re: MPS: Forwording symbols |
Date: |
Mon, 17 Jun 2024 20:50:36 +0200 |
User-agent: |
Gnus/5.13 (Gnus v5.13) |
Gerd Möllmann <gerd.moellmann@gmail.com> writes:
> Helmut Eller <eller.helmut@gmail.com> writes:
>
>> On Mon, Jun 17 2024, Gerd Möllmann wrote:
>>
>>> The whole dumping of these structs looks highly dubious to me,
>>> independent of MPS. They are constants, always have been, AFAICT, even
>>> from what I remember from the 90s.
>>
>> The patch below creates the necessary relocs so that no forwarding
>> structs end up in the dump.
>
> Thanks. pushed.
>
>>
>>> Looking forward to the time when the mirror code is gone :-).
>>
>> I'm not so optimistic. The first collection is very slow:
>>
>> time ./emacs -batch -f igc--collect
>>
>> real 0m12.555s
>> user 0m11.708s
>> sys 0m0.097s
>
> That's pretty slow, indeed. The version of Emacs I'm currently running,
> which is my fork which does not contain your recent changes, and is an
> optimized build with -lmps says
>
> .../emacs/github/igc % /usr/bin/time src/emacs -batch -f igc--collect
> 0.25 real 0.14 user 0.11 sys
>
>> That's not good. Maybe there is some unfixed problem that is causing
>> this slowness, but it could also be that MPS simply is so slow for this
>> allocation pattern.
>
> I guess it is what you suspect because I run into an assertion when dumping:
>
> Dumping fingerprint:
> 79b503a407de48b18f4c304971c234d89bf236c259a1e7cd857559f919943b91
>
> igc.c:345: Emacs fatal error: assertion failed: h->obj_type == IGC_OBJ_PAD
> || nbytes >= sizeof (struct igc_fwd)
> Fatal error 6: Aborted
>
> That's a build starting from git clean -xdf, optimized, -lmps, and no
> native compilation here of course.
>
> I'll try to debug this, but I think I have to read the new code first a
> bit to understand where to start.
Anyway, maybe the following gives you a hint already. The abort happens
with this backtrace while writing the dump
* thread #1, queue = 'com.apple.main-thread', stop reason = breakpoint 5.2
frame #0: 0x00000001001e3cf8 bootstrap-emacs`emacs_abort at sysdep.c:2391:3
frame #1: 0x00000001003ec57c bootstrap-emacs`ns_term_shutdown(sig=6) at
nsterm.m:5889:5
frame #2: 0x00000001001a2dbc bootstrap-emacs`shut_down_emacs(sig=6,
stuff=(struct Lisp_Symbol *) $2 = 0x0000000100ca5010) at emacs.c:3162:3
frame #3: 0x00000001001a27a4 bootstrap-emacs`terminate_due_to_signal(sig=6,
backtrace_limit=2147483647) at emacs.c:464:11
frame #4: 0x0000000100399fa4 bootstrap-emacs`igc_assert_fail(file="igc.c",
line=345, msg="h->obj_type == IGC_OBJ_PAD || nbytes >= sizeof (struct
igc_fwd)") at igc.c:82:3
frame #5: 0x000000010039cde8 bootstrap-emacs`obj_size(h=0x00000001298085f8)
at igc.c:345:3
frame #6: 0x000000010039cc6c
bootstrap-emacs`igc_dump_finish_obj(client=0x0000000129808600,
type=IGC_OBJ_DUMPED_BUFFER_TEXT, base="", end="") at igc.c:3721:7
frame #7: 0x0000000100277fc0
bootstrap-emacs`dump_igc_finish_obj(ctx=0x000000016fdfc3e8) at pdumper.c:910:26
* frame #8: 0x00000001002840d0
bootstrap-emacs`dump_cold_buffer(ctx=0x000000016fdfc3e8, data=(struct buffer *)
$3 = 0x000000010e4d3308) at pdumper.c:3694:3
here:
char *
igc_dump_finish_obj (void *client, enum igc_obj_type type,
char *base, char *end)
{
if (client == NULL)
return end;
struct igc_header *out = (struct igc_header *) base;
if (is_mps (client))
{
struct igc_header *h = client_to_base (client);
if (h->obj_type == IGC_OBJ_VECTOR_WEAK)
igc_assert (
(type == IGC_OBJ_VECTOR && h->obj_type == IGC_OBJ_VECTOR_WEAK)
|| h->obj_type == type);
igc_assert (base + obj_size (h) >= end);
Looks like the client object passed in is bogus
(lldb) p *h
(igc_header) (obj_type = IGC_OBJ_INVALID, hash = 128931976, nwords = 1)
(lldb)
- Re: MPS: Forwording symbols, (continued)
Re: MPS: Forwording symbols, Gerd Möllmann, 2024/06/16
- Re: MPS: Forwording symbols, Eli Zaretskii, 2024/06/17
- Re: MPS: Forwording symbols, Helmut Eller, 2024/06/17
- Re: MPS: Forwording symbols, Gerd Möllmann, 2024/06/17
- Re: MPS: Forwording symbols,
Gerd Möllmann <=
- Re: MPS: Forwording symbols, Helmut Eller, 2024/06/17
- Re: MPS: Forwording symbols, Gerd Möllmann, 2024/06/17
- Re: MPS: Forwording symbols, Helmut Eller, 2024/06/17
- Re: MPS: Forwording symbols, Gerd Möllmann, 2024/06/17
- Re: MPS: Forwording symbols, Gerd Möllmann, 2024/06/18
- Re: MPS: Forwording symbols, Helmut Eller, 2024/06/18
- Re: MPS: Forwording symbols, Gerd Möllmann, 2024/06/18
- Re: MPS: Forwording symbols, Gerd Möllmann, 2024/06/18
- Re: MPS: Forwording symbols, Helmut Eller, 2024/06/18
- Re: MPS: Forwording symbols, Gerd Möllmann, 2024/06/18