From: Stefan Monnier via "Bug reports for GNU Emacs, the Swiss army knife of text editors" <bug-gnu-emacs@gnu.org>
To: "Gerd Möllmann" <gerd.moellmann@gmail.com>
Cc: 68690@debbugs.gnu.org, jm@pub.pink, eliz@gnu.org
Subject: bug#68690: Segmentation fault building with native-comp
Date: Fri, 26 Jan 2024 08:48:46 -0500 [thread overview]
Message-ID: <jwv7cjwkxzc.fsf-monnier+emacs@gnu.org> (raw)
In-Reply-To: <m2plxov42f.fsf@Pro.fritz.box> ("Gerd Möllmann"'s message of "Fri, 26 Jan 2024 10:26:00 +0100")
[-- Attachment #1: Type: text/plain, Size: 643 bytes --]
> I remembered seeing something in pdumper.c that could be related, namely
>
> /* Start the cold section. This section contains bytes that should
> never change and so can be direct-mapped from the dump without
> special processing. */
> dump_drain_cold_data (ctx);
>
> And if you follow that function you'll see that it treats charsets
> specially.
>
> I find the comment about directly mapping very suspicious, when the
> charset contains a Lisp_Object, possibly requiring relocation. But it
> could well be that I misundertand something here.
Hmm... would a patch like the one below fix the problem, then?
Stefan
[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #2: cold-charset.patch --]
[-- Type: text/x-diff, Size: 1852 bytes --]
diff --git a/src/pdumper.c b/src/pdumper.c
index f42d1777371..56177d3fd89 100644
--- a/src/pdumper.c
+++ b/src/pdumper.c
@@ -440,7 +440,6 @@ dump_fingerprint (FILE *output, char const *label,
{
COLD_OP_OBJECT,
COLD_OP_STRING,
- COLD_OP_CHARSET,
COLD_OP_BUFFER,
COLD_OP_BIGNUM,
COLD_OP_NATIVE_SUBR,
@@ -3245,10 +3244,6 @@ dump_charset (struct dump_context *ctx, int cs_i)
memcpy (out.fast_map, &cs->fast_map, sizeof (cs->fast_map));
DUMP_FIELD_COPY (&out, cs, code_offset);
dump_off offset = dump_object_finish (ctx, &out, sizeof (out));
- if (cs_i < charset_table_used && cs->code_space_mask)
- dump_remember_cold_op (ctx, COLD_OP_CHARSET,
- Fcons (dump_off_to_lisp (cs_i),
- dump_off_to_lisp (offset)));
return offset;
}
@@ -3402,20 +3397,6 @@ dump_cold_string (struct dump_context *ctx, Lisp_Object string)
dump_write (ctx, XSTRING (string)->u.s.data, total_size);
}
-static void
-dump_cold_charset (struct dump_context *ctx, Lisp_Object data)
-{
- /* Dump charset lookup tables. */
- int cs_i = XFIXNUM (XCAR (data));
- dump_off cs_dump_offset = dump_off_from_lisp (XCDR (data));
- dump_remember_fixup_ptr_raw
- (ctx,
- cs_dump_offset + dump_offsetof (struct charset, code_space_mask),
- ctx->offset);
- struct charset *cs = charset_table + cs_i;
- dump_write (ctx, cs->code_space_mask, 256);
-}
-
static void
dump_cold_buffer (struct dump_context *ctx, Lisp_Object data)
{
@@ -3509,9 +3490,6 @@ dump_drain_cold_data (struct dump_context *ctx)
case COLD_OP_STRING:
dump_cold_string (ctx, data);
break;
- case COLD_OP_CHARSET:
- dump_cold_charset (ctx, data);
- break;
case COLD_OP_BUFFER:
dump_cold_buffer (ctx, data);
break;
next prev parent reply other threads:[~2024-01-26 13:48 UTC|newest]
Thread overview: 29+ messages / expand[flat|nested] mbox.gz Atom feed top
2024-01-24 14:36 bug#68690: Segmentation fault building with native-comp john muhl via Bug reports for GNU Emacs, the Swiss army knife of text editors
2024-01-24 17:10 ` Eli Zaretskii
2024-01-24 19:52 ` Gerd Möllmann
2024-01-24 19:56 ` Stefan Monnier via Bug reports for GNU Emacs, the Swiss army knife of text editors
2024-01-24 20:27 ` Eli Zaretskii
2024-01-24 23:59 ` Stefan Monnier via Bug reports for GNU Emacs, the Swiss army knife of text editors
2024-01-25 10:26 ` Eli Zaretskii
2024-01-26 2:43 ` Stefan Monnier via Bug reports for GNU Emacs, the Swiss army knife of text editors
2024-01-26 8:40 ` Eli Zaretskii
2024-01-26 9:26 ` Gerd Möllmann
2024-01-26 13:48 ` Stefan Monnier via Bug reports for GNU Emacs, the Swiss army knife of text editors [this message]
2024-01-26 14:36 ` Eli Zaretskii
2024-01-26 15:51 ` Stefan Monnier via Bug reports for GNU Emacs, the Swiss army knife of text editors
2024-01-26 14:30 ` Eli Zaretskii
2024-01-26 14:47 ` Gerd Möllmann
2024-01-26 14:55 ` Eli Zaretskii
2024-01-27 0:08 ` Stefan Monnier via Bug reports for GNU Emacs, the Swiss army knife of text editors
2024-01-27 4:07 ` Stefan Monnier via Bug reports for GNU Emacs, the Swiss army knife of text editors
2024-01-27 7:50 ` Eli Zaretskii
2024-01-27 14:45 ` Stefan Monnier via Bug reports for GNU Emacs, the Swiss army knife of text editors
2024-01-26 10:18 ` Andreas Schwab
2024-01-26 13:49 ` Stefan Monnier via Bug reports for GNU Emacs, the Swiss army knife of text editors
2024-01-26 14:50 ` Stefan Monnier via Bug reports for GNU Emacs, the Swiss army knife of text editors
2024-01-25 5:33 ` Gerd Möllmann
2024-01-25 8:33 ` Gerd Möllmann
2024-01-25 15:58 ` Stefan Monnier via Bug reports for GNU Emacs, the Swiss army knife of text editors
2024-01-25 18:12 ` Mattias Engdegård
2024-01-25 22:39 ` Stefan Monnier via Bug reports for GNU Emacs, the Swiss army knife of text editors
2024-01-26 16:07 ` Mattias Engdegård
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=jwv7cjwkxzc.fsf-monnier+emacs@gnu.org \
--to=bug-gnu-emacs@gnu.org \
--cc=68690@debbugs.gnu.org \
--cc=eliz@gnu.org \
--cc=gerd.moellmann@gmail.com \
--cc=jm@pub.pink \
--cc=monnier@iro.umontreal.ca \
/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.