Subject: bug#68690: Segmentation fault building with native-comp

From: Gerd Möllmann <[email-masked]>
Date: Fri, 26 Jan 2024 10:26:00 +0100

Stefan Monnier via "Bug reports for GNU Emacs, the Swiss army knife of
text editors" <[email-masked]> writes:

>> For example, I cannot understand why some fields which are
>> Lisp objects are dumped with dump_field_lv while others with
>> dump_field_lv_or_rawptr, and what is the significance of WEIGHT_NORMAL
>> vs WEIGHT_STRONG.  Hopefully, the above gives enough information for
>> you to figure this out.
>
> I'm just as lost as you are in pdumper.c, sadly.

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.