all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
From: "Gerd Möllmann" <gerd.moellmann@gmail.com>
To: Helmut Eller <eller.helmut@gmail.com>
Cc: Emacs Devel <emacs-devel@gnu.org>,  Eli Zaretskii <eliz@gnu.org>
Subject: Re: MPS: Forwording symbols
Date: Mon, 17 Jun 2024 20:50:36 +0200	[thread overview]
Message-ID: <m2r0cvpfnn.fsf@pro2.fritz.box> (raw)
In-Reply-To: <m2v827pg5s.fsf@pro2.fritz.box> ("Gerd Möllmann"'s message of "Mon, 17 Jun 2024 20:39:43 +0200")

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)




  reply	other threads:[~2024-06-17 18:50 UTC|newest]

Thread overview: 69+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-06-16  9:43 MPS: Forwording symbols Gerd Möllmann
2024-06-16 10:15 ` Gerd Möllmann
2024-06-16 19:27 ` Helmut Eller
2024-06-16 19:39   ` Gerd Möllmann
2024-06-17 10:57     ` Eli Zaretskii
2024-06-17 12:15       ` Gerd Möllmann
2024-06-17 12:24         ` Eli Zaretskii
2024-06-17 12:58           ` Gerd Möllmann
2024-06-17  3:43   ` Gerd Möllmann
2024-06-17 11:47     ` Eli Zaretskii
2024-06-17 18:10     ` Helmut Eller
2024-06-17 18:39       ` Gerd Möllmann
2024-06-17 18:50         ` Gerd Möllmann [this message]
2024-06-17 19:05           ` Helmut Eller
2024-06-17 19:19             ` Gerd Möllmann
2024-06-17 19:25               ` Helmut Eller
2024-06-17 20:07                 ` Gerd Möllmann
2024-06-18  6:32                   ` Gerd Möllmann
2024-06-18  9:05                     ` Helmut Eller
2024-06-18  9:24                       ` Gerd Möllmann
2024-06-18 10:44                         ` Gerd Möllmann
2024-06-18 11:55                           ` Helmut Eller
2024-06-18 12:21                             ` Gerd Möllmann
2024-06-18 19:36                               ` Helmut Eller
2024-06-18 19:55                                 ` Gerd Möllmann
2024-06-20 14:18                                   ` Helmut Eller
2024-06-20 15:16                                     ` Gerd Möllmann
2024-06-20 16:17                                       ` Helmut Eller
2024-06-20 16:27                                         ` Gerd Möllmann
2024-06-18 12:05                         ` Helmut Eller
2024-06-18 12:29                           ` Gerd Möllmann
2024-06-18 13:08                           ` Eli Zaretskii
2024-06-18 12:36                   ` Eli Zaretskii
2024-06-18 16:20                     ` Helmut Eller
2024-06-18 16:29                       ` Eli Zaretskii
2024-06-18 16:43                       ` Gerd Möllmann
2024-06-18 16:37                     ` Helmut Eller
2024-06-18 17:33                       ` Eli Zaretskii
2024-06-18 17:51                         ` Helmut Eller
2024-06-18 18:18                           ` Eli Zaretskii
2024-06-18 17:54                         ` Eli Zaretskii
2024-06-18 18:11                           ` Gerd Möllmann
2024-06-18 18:20                             ` Eli Zaretskii
2024-06-18 18:23                               ` Gerd Möllmann
2024-06-18 18:12                           ` Helmut Eller
2024-06-18 18:22                             ` Eli Zaretskii
2024-06-18 19:27                               ` Helmut Eller
2024-06-18 19:33                                 ` Gerd Möllmann
2024-06-19 11:22                                   ` Eli Zaretskii
2024-06-17 19:06           ` Gerd Möllmann
2024-06-21 15:36 ` Helmut Eller
2024-06-21 15:41   ` Gerd Möllmann
2024-06-21 16:20     ` Gerd Möllmann
2024-06-22 18:02       ` Helmut Eller
2024-06-22 18:27         ` Gerd Möllmann
2024-06-22 18:53           ` Helmut Eller
2024-06-22 19:26             ` Gerd Möllmann
2024-06-23  3:28               ` Gerd Möllmann
2024-06-23  4:10                 ` Gerd Möllmann
2024-06-23 19:59               ` Helmut Eller
2024-06-24  3:45                 ` Gerd Möllmann
2024-06-24 15:13                   ` Helmut Eller
2024-06-24 16:14                     ` Gerd Möllmann
2024-06-24 16:32                       ` Eli Zaretskii
2024-06-24 17:00                         ` Gerd Möllmann
2024-06-23 15:59           ` Helmut Eller
2024-06-23 16:26             ` Gerd Möllmann
2024-06-21 16:15   ` Ihor Radchenko
2024-06-21 16:25     ` Gerd Möllmann

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=m2r0cvpfnn.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 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.