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: Andrea Corallo <acorallo@gnu.org>
Cc: Eli Zaretskii <eliz@gnu.org>,  emacs-devel@gnu.org
Subject: Re: Native compilation on MPS branch
Date: Wed, 24 Apr 2024 14:49:59 +0200	[thread overview]
Message-ID: <m2h6frhqmg.fsf@pro2.fritz.box> (raw)
In-Reply-To: <yp15xw7dfvt.fsf@fencepost.gnu.org> (Andrea Corallo's message of "Tue, 23 Apr 2024 15:43:18 -0400")

[-- Attachment #1: Type: text/plain, Size: 325 bytes --]

Andrea Corallo <acorallo@gnu.org> writes:

> Cool, keep us updated.

Daily update ;-).

Haven't got much further, and can use a little break now.

I don't know if it makes sense to attach this, but maybe it does... I'm
sometimes keeping notes when debugging (which I find useful when
debugging more than 1 thing at a time).


[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #2: debugging --]
[-- Type: text/x-org, Size: 3900 bytes --]

:PROPERTIES:
:ID:       544E65F2-9EED-4D0E-812F-79205DA0040F
:END:
#+title: Debugging Ideas
* Assertion in string_char_and_length

In read_make_string a string is made that later leads to the assertion
in string_char_and_len.

#+begin_src sh
(lldb) p s
(const char *) 0x000000016fdf8588 "macroexp--cons"
#+end_src

Symbol whose name is that string is made in read:

#+begin_src sh
result = dwim-print result
(Lisp_Object) 0x00000000080935f8 (struct Lisp_Symbol *) $7 = 0x0000000108cc7568
#+end_src

Whole thing read looks like

#+begin_src sh
(lldb) xdebug_print retval
[let byte-compile-form-stack cons (byte-compile-form-stack) nil make-symbol "shared" "unshared" "tail" "new-el" let* (nil) while...
#+end_src

The read is in from load_static_obj, which is called from
load_comp_unit.

#+begin_src c
      if (!loading_dump)
	{
	  comp_u->optimize_qualities =
	    load_static_obj (comp_u, TEXT_OPTIM_QLY_SYM);
	  comp_u->data_vec = load_static_obj (comp_u, TEXT_DATA_RELOC_SYM);
	  comp_u->data_impure_vec =
	    load_static_obj (comp_u, TEXT_DATA_RELOC_IMPURE_SYM);

	  if (!NILP (Vpurify_flag))
	    /* Non impure can be copied into pure space.  */
	    comp_u->data_vec = Fpurecopy (comp_u->data_vec);

	  if (!NILP (Vpurify_flag))
	    /* Non impure can be copied into pure space.  */
	    comp_u->data_vec = Fpurecopy (comp_u->data_vec);
#+end_src

The cu is allocated in MPS, purify is nil

#+begin_src sh
(lldb) p comp_u
(Lisp_Native_Comp_Unit *) 0x0000000108cc51f0
(lldb) p is_mps (comp_u)
(bool) true
(lldb) p globals.f_Vpurify_flag
(Lisp_Object) NULL
#+end_src

Objects are copied

#+begin_src c
    Lisp_Object *data_relocs = dynlib_sym (handle, DATA_RELOC_SYM);
    Lisp_Object *data_imp_relocs = comp_u->data_imp_relocs;
    ...
    EMACS_INT d_vec_len = XFIXNUM (Flength (comp_u->data_vec));
    for (EMACS_INT i = 0; i < d_vec_len; i++)
      data_relocs[i] = AREF (comp_u->data_vec, i);
#+end_src

data_relocs points somewhere into the loaded dylib, I'd say

#+begin_src sh
  (lldb) p data_relocs
  (Lisp_Object *) 0x0000000100ebcfd8 (struct Lisp_Symbol *) $26 = 0x0000000201af0f48
  (lldb) p is_mps (data_relocs)
  (bool) false
  (lldb) p pdumper_object_p (data_relocs)
  (bool) false
  (lldb) p is_pure (data_relocs)
  (bool) false
#+end_src

data_imp_relocs too.

#+begin_src sh
  (lldb) p *comp_u
(Lisp_Native_Comp_Unit) {
  header = (size = 4611686018863607815)
  file = 0x0000000108cc50d4 (struct Lisp_String *) $28 = 0x0000000108cc50d0
  optimize_qualities = 0x0000000108cc53bb (struct Lisp_Cons *) $29 = 0x0000000108cc53b8
  lambda_gc_guard_h = 0x0000000108cc5255 (struct Lisp_Vector *) $30 = 0x0000000108cc5250
  lambda_c_name_idx_h = 0x0000000108cc52ad (struct Lisp_Vector *) $31 = 0x0000000108cc52a8
  data_fdoc_v = NULL
  data_vec = 0x0000000108cd000d (struct Lisp_Vector *) $32 = 0x0000000108cd0008
  data_impure_vec = NULL
  data_imp_relocs = 0x0000000100ebda00 (struct Lisp_Symbol *) $33 = 0x0000000201af1970
  loaded_once = false
  load_ongoing = true
  handle = 0x0000000088eb8210
}
#+end_src

That all looks like I would have expected.
(Note to self: remember register_comp_unit...)
That all happens in (require macroexp)

Continue. Landing in copy_sequence with invalid string.

#+begin_src sh
(struct Lisp_String) {
  u = {
    s = {
      size = 4546911032
      size_byte = -1
      intervals = NULL
      data = 0x0000000108cca740 "H\xdd\U00000003\U0000000f\U00000001"
    }
    next = 0x000000010f045b38
    gcaligned = '8'
  }
}
#+end_src

(Note to self: xbacktrace broken. By LLVM 18?)

Coming from print_prune_charset <- print_object <- print <-
Fprin1 of that string, ..., backtrace_frame_apply <- mapbacktrace ....
<- signal_or_quit.

From (error "Not enough aruments in format string") in styled_format.
args[0] is the kaputte string.

From readevalloop_eager_expand_eval, call of macroexpand.

And finito by calling xdebug_print, process was killed.

  reply	other threads:[~2024-04-24 12:49 UTC|newest]

Thread overview: 149+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-04-20  9:34 STatus of MPS branch Gerd Möllmann
2024-04-20 14:56 ` Michael Albinus
2024-04-20 15:08   ` Gerd Möllmann
2024-04-20 15:32     ` Michael Albinus
2024-04-20 17:37       ` Gerd Möllmann
2024-04-21  7:39         ` Michael Albinus
2024-04-21  7:56           ` Gerd Möllmann
2024-04-21  8:00             ` Gerd Möllmann
2024-04-21  8:04               ` Michael Albinus
2024-04-21  8:08                 ` Gerd Möllmann
2024-04-21  8:18                   ` Michael Albinus
2024-04-21  8:28                     ` Gerd Möllmann
2024-04-21  8:17           ` Gerd Möllmann
2024-04-21  9:43             ` Michael Albinus
2024-04-21 10:07               ` Gerd Möllmann
2024-04-21 10:58                 ` Tramp tests in MPS branch (was: STatus of MPS branch) Michael Albinus
2024-04-21 12:44                   ` Tramp tests in MPS branch Gerd Möllmann
2024-04-21  9:29           ` STatus of " Eli Zaretskii
2024-04-21  4:38 ` Gerd Möllmann
2024-04-21  5:31   ` Eli Zaretskii
2024-04-21  5:39     ` Gerd Möllmann
2024-04-21  9:04       ` Eli Zaretskii
2024-04-21  9:17         ` Gerd Möllmann
2024-04-21  6:15 ` Gerd Möllmann
2024-04-21  9:09   ` Eglot tests on MPS branch (was: STatus of MPS branch) Eli Zaretskii
2024-04-21  9:53     ` João Távora
2024-04-21 10:13       ` Eglot tests on MPS branch Gerd Möllmann
2024-04-21 11:01         ` João Távora
2024-04-21 10:55       ` Eglot tests on MPS branch (was: STatus of MPS branch) Eli Zaretskii
2024-04-21  7:49 ` STatus of MPS branch Gerd Möllmann
2024-04-21  8:45   ` Gerd Möllmann
2024-04-21  9:08     ` Andrea Corallo
2024-04-21  9:33     ` Native compilation on " Eli Zaretskii
2024-04-21 10:17       ` Gerd Möllmann
2024-04-21 13:07         ` Andrea Corallo
2024-04-22  7:15           ` Gerd Möllmann
2024-04-22 22:02             ` Andrea Corallo
2024-04-23  3:11               ` Gerd Möllmann
2024-04-23 16:09               ` Gerd Möllmann
2024-04-23 19:43                 ` Andrea Corallo
2024-04-24 12:49                   ` Gerd Möllmann [this message]
2024-04-24 18:14                     ` Andrea Corallo
2024-04-24 18:28                       ` Gerd Möllmann
2024-04-24 20:54                         ` Andrea Corallo
2024-04-25  4:33                           ` Gerd Möllmann
2024-04-25  5:50                             ` Andrea Corallo
2024-04-25  7:18                               ` Gerd Möllmann
2024-04-25  8:06                                 ` Andrea Corallo
2024-04-25  8:15                                   ` Gerd Möllmann
2024-04-25  8:57                                     ` Gerd Möllmann
2024-04-25  9:42                                     ` Andrea Corallo
2024-04-25 11:33                                       ` Gerd Möllmann
2024-04-25  5:24                           ` Eli Zaretskii
2024-04-25  5:48                             ` Andrea Corallo
2024-04-25 15:20                               ` Eli Zaretskii
2024-04-26 10:15                                 ` Gerd Möllmann
2024-04-21  8:58   ` STatus of " Andrea Corallo
2024-04-21  9:19     ` Gerd Möllmann
2024-04-21  9:30   ` Native compilation on MPS branch (was: STatus of MPS branch) Eli Zaretskii
2024-04-21 14:39 ` STatus of MPS branch Helmut Eller
2024-04-21 15:37   ` Gerd Möllmann
2024-04-21 15:52     ` Eli Zaretskii
2024-04-21 20:24     ` Helmut Eller
2024-04-22  4:58       ` Gerd Möllmann
2024-04-22  5:28       ` Gerd Möllmann
2024-04-22  6:15         ` MPS signals and Emacs (was: STatus of MPS branch) Eli Zaretskii
2024-04-22  6:44           ` MPS signals and Emacs Paul Eggert
2024-04-22  7:19             ` Gerd Möllmann
2024-04-22  7:40               ` Paul Eggert
2024-04-22  7:49                 ` Gerd Möllmann
2024-04-22  8:09                   ` Eli Zaretskii
2024-04-22  8:27                     ` Gerd Möllmann
2024-04-22  8:55                       ` Eli Zaretskii
2024-04-22  9:02                         ` Mattias Engdegård
2024-04-22  9:02                         ` Gerd Möllmann
2024-04-22  9:18                           ` Eli Zaretskii
2024-04-22  9:29                             ` Gerd Möllmann
2024-04-22  9:41                               ` Eli Zaretskii
2024-04-22 10:22                                 ` Gerd Möllmann
2024-04-22 10:46                                   ` Eli Zaretskii
2024-04-22 11:00                                     ` Gerd Möllmann
2024-04-22 12:01                                       ` Eli Zaretskii
2024-04-22 12:16                                         ` Gerd Möllmann
2024-04-22 10:54                                   ` Eli Zaretskii
2024-04-22 11:05                                     ` Gerd Möllmann
2024-04-22 19:41                   ` Paul Eggert
2024-04-22 20:55                     ` Gerd Möllmann
2024-04-22 22:12                       ` Paul Eggert
2024-04-23  3:15                         ` Gerd Möllmann
     [not found]                       ` <87le54g1h2.fsf@dick>
2024-04-23  5:51                         ` Gerd Möllmann
2024-04-23  6:35                           ` Helmut Eller
2024-04-23  6:45                             ` Gerd Möllmann
2024-04-23  6:53                               ` Helmut Eller
2024-04-23 14:29                                 ` Gerd Möllmann
     [not found]                                   ` <87sezbsmsd.fsf@dick>
2024-04-24  5:03                                     ` Gerd Möllmann
2024-04-22  7:46               ` Eli Zaretskii
2024-04-22  7:55                 ` Gerd Möllmann
2024-04-22 14:10             ` Helmut Eller
2024-04-22 14:42               ` Eli Zaretskii
2024-04-22 22:06                 ` Paul Eggert
2024-04-23  7:04                   ` Eli Zaretskii
2024-04-22  5:36       ` STatus of MPS branch Gerd Möllmann
2024-04-22  5:50         ` Gerd Möllmann
2024-04-22 15:09           ` Helmut Eller
2024-04-22 17:02             ` Gerd Möllmann
2024-04-24  7:26 ` Collecting markers with MPS (was: STatus of MPS branch) Helmut Eller
2024-04-24  7:44   ` Eli Zaretskii
2024-04-24  8:56     ` Collecting markers with MPS Helmut Eller
2024-04-24  9:17       ` Gerd Möllmann
2024-04-24 10:22       ` Eli Zaretskii
2024-04-24 10:27         ` Gerd Möllmann
2024-04-24 10:58           ` Gerd Möllmann
2024-04-24 13:32             ` Eli Zaretskii
2024-04-24 13:51               ` Gerd Möllmann
2024-04-24 15:03         ` Helmut Eller
2024-04-24 15:54           ` Eli Zaretskii
2024-04-24 16:21             ` Helmut Eller
2024-04-24 16:26               ` Eli Zaretskii
2024-04-24 16:50                 ` Gerd Möllmann
2024-04-24 19:18                 ` Helmut Eller
2024-04-24 19:55                   ` Gerd Möllmann
2024-04-25  7:38                   ` Mattias Engdegård
2024-04-24  9:08     ` Gerd Möllmann
2024-04-24 19:03       ` Helmut Eller
2024-04-24 20:02         ` Gerd Möllmann
2024-04-24 20:13           ` Helmut Eller
2024-04-24 20:42             ` Gerd Möllmann
2024-04-25  9:44       ` Helmut Eller
2024-04-25 11:44         ` Gerd Möllmann
2024-04-25 16:04 ` basic questions on MPS Andrea Corallo
2024-04-25 17:51   ` Helmut Eller
2024-04-25 18:48     ` Eli Zaretskii
2024-04-25 18:53     ` Gerd Möllmann
2024-04-25 19:26     ` Vibhav Pant
2024-04-26  6:36       ` Helmut Eller
2024-04-26  7:25         ` Gerd Möllmann
2024-04-26 15:07         ` vibhavp
2024-04-26  6:42       ` Gerd Möllmann
2024-04-27  0:20     ` Richard Stallman
2024-04-27  8:41       ` Helmut Eller
2024-04-28 22:44         ` Richard Stallman
2024-04-29  4:27           ` Helmut Eller
2024-04-29 22:40             ` Richard Stallman
2024-04-25 18:41   ` Eli Zaretskii
2024-04-25 18:53     ` Andrea Corallo
2024-04-25 18:56       ` Gerd Möllmann
2024-04-25 19:29         ` Andrea Corallo
2024-04-25 19:03       ` Eli Zaretskii
2024-04-25 19:09         ` Andrea Corallo

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=m2h6frhqmg.fsf@pro2.fritz.box \
    --to=gerd.moellmann@gmail.com \
    --cc=acorallo@gnu.org \
    --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 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.