unofficial mirror of bug-gnu-emacs@gnu.org 
 help / color / mirror / code / Atom feed
From: Matt Armstrong <matt@rfc20.org>
To: "Gerd Möllmann" <gerd.moellmann@gmail.com>
Cc: 59029@debbugs.gnu.org, stefan monnier <monnier@iro.umontreal.ca>
Subject: bug#59029: 29.0.50; noverlay: pdumper.c: dump_interval_node recursion has no base case
Date: Sat, 05 Nov 2022 11:09:29 -0700	[thread overview]
Message-ID: <87cza1w9wm.fsf@rfc20.org> (raw)
In-Reply-To: <m2zgd6vtyi.fsf@Mini.fritz.box> ("Gerd Möllmann"'s message of "Sat, 05 Nov 2022 06:41:41 +0100")

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

Gerd Möllmann <gerd.moellmann@gmail.com> writes:

> Yes, I think you are right.
>
> Could we also rename dump_interval_node to dump_itree_node?  There is
> another function dump_interval_tree for text properties, which is a bit
> confusing.

Attached renames the function and tags two related FIXMEs with this bug
number.  The root issue is that pdumping buffers with overlays is not
implemented.


[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #2: 0005-Add-FIXME-comments-for-overlays.patch --]
[-- Type: text/x-diff, Size: 3016 bytes --]

From 82c448f7f6eda810114151b5339d500fd6cf5826 Mon Sep 17 00:00:00 2001
From: Matt Armstrong <matt@rfc20.org>
Date: Sat, 5 Nov 2022 11:03:09 -0700
Subject: [PATCH 5/5] Add FIXME comments for overlays.

* src/pdumper.c (dump_itree_node): Renamed from dump_interval_node.
Add FIXME(Matt): comment for bug#59029.
(dump_buffer): Tag comment with FIXME bug#59029.
---
 src/pdumper.c | 19 ++++++++++++-------
 1 file changed, 12 insertions(+), 7 deletions(-)

diff --git a/src/pdumper.c b/src/pdumper.c
index 0a5d96dbb7c..10b6f58bbd8 100644
--- a/src/pdumper.c
+++ b/src/pdumper.c
@@ -2134,8 +2134,8 @@ dump_marker (struct dump_context *ctx, const struct Lisp_Marker *marker)
 }
 
 static dump_off
-dump_interval_node (struct dump_context *ctx, struct itree_node *node,
-                    dump_off parent_offset)
+dump_itree_node (struct dump_context *ctx, struct itree_node *node,
+		 dump_off parent_offset)
 {
 #if CHECK_STRUCTS && !defined (HASH_itree_node_50DE304F13)
 # error "itree_node changed. See CHECK_STRUCTS comment in config.h."
@@ -2158,21 +2158,25 @@ dump_interval_node (struct dump_context *ctx, struct itree_node *node,
   DUMP_FIELD_COPY (&out, node, rear_advance);
   DUMP_FIELD_COPY (&out, node, front_advance);
   dump_off offset = dump_object_finish (ctx, &out, sizeof (out));
+  /* FIXME: bug#59029 We haven't implemented the code to dump overlays
+     that are part of a buffer.  The code below will recurse forever
+     if any of parent, left or right is non-NULL, but isn't worth
+     changing until we have a test case.  */
   if (node->parent)
       dump_remember_fixup_ptr_raw
 	(ctx,
 	 offset + dump_offsetof (struct itree_node, parent),
-	 dump_interval_node (ctx, node->parent, offset));
+	 dump_itree_node (ctx, node->parent, offset));
   if (node->left)
       dump_remember_fixup_ptr_raw
 	(ctx,
 	 offset + dump_offsetof (struct itree_node, left),
-	 dump_interval_node (ctx, node->left, offset));
+	 dump_itree_node (ctx, node->left, offset));
   if (node->right)
       dump_remember_fixup_ptr_raw
 	(ctx,
 	 offset + dump_offsetof (struct itree_node, right),
-	 dump_interval_node (ctx, node->right, offset));
+	 dump_itree_node (ctx, node->right, offset));
   return offset;
 }
 
@@ -2189,7 +2193,7 @@ dump_overlay (struct dump_context *ctx, const struct Lisp_Overlay *overlay)
   dump_remember_fixup_ptr_raw
     (ctx,
      offset + dump_offsetof (struct Lisp_Overlay, interval),
-     dump_interval_node (ctx, overlay->interval, offset));
+     dump_itree_node (ctx, overlay->interval, offset));
   return offset;
 }
 
@@ -2864,7 +2868,8 @@ dump_buffer (struct dump_context *ctx, const struct buffer *in_buffer)
   DUMP_FIELD_COPY (out, buffer, long_line_optimizations_p);
 
   if (buffer->overlays && buffer->overlays->root != NULL)
-    /* We haven't implemented the code to dump overlays.  */
+    /* FIXME: bug#59029 We haven't implemented the code to dump
+       overlays that are in a buffer.  */
     emacs_abort ();
   else
     out->overlays = NULL;
-- 
2.35.1


  reply	other threads:[~2022-11-05 18:09 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-11-04 23:09 bug#59029: 29.0.50; noverlay: pdumper.c: dump_interval_node recursion has no base case Matt Armstrong
2022-11-05  5:41 ` Gerd Möllmann
2022-11-05 18:09   ` Matt Armstrong [this message]
2022-11-06  5:21     ` Gerd Möllmann
2022-11-05 20:38 ` Stefan Monnier via Bug reports for GNU Emacs, the Swiss army knife of text editors
2022-11-08 15:59   ` bug#59029: Dumping Emacs crashes when buffers have overlays Matt Armstrong
2022-11-08 16:59     ` Eli Zaretskii
2022-11-08 17:21       ` Stefan Monnier via Bug reports for GNU Emacs, the Swiss army knife of text editors
2022-11-09 20:04         ` Matt Armstrong

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

  List information: https://www.gnu.org/software/emacs/

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=87cza1w9wm.fsf@rfc20.org \
    --to=matt@rfc20.org \
    --cc=59029@debbugs.gnu.org \
    --cc=gerd.moellmann@gmail.com \
    --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 public inbox

	https://git.savannah.gnu.org/cgit/emacs.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).