all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
From: Jeff Walsh <fejfighter@gmail.com>
To: "Gerd Möllmann" <gerd.moellmann@gmail.com>
Cc: 74224@debbugs.gnu.org
Subject: bug#74224: [PATCH][scratch/igc] pgtk: fix crashing bug in atimer used for checking scaling
Date: Wed, 6 Nov 2024 20:30:02 +1100	[thread overview]
Message-ID: <CALohuRAH3CP_KvQi-izDjHSK=RVYgNyjyXgw9b49-J383w=tmw@mail.gmail.com> (raw)
In-Reply-To: <m2a5ecwxjh.fsf@gmail.com>


[-- Attachment #1.1: Type: text/plain, Size: 1511 bytes --]

Hi Gerd,

No problems, I'd love to see this go in one day, it's just hard enough to
carve out time to debug crash dumps

I got overzealous with the change in pgtkterm.c, with the call from
`lispstpcpy` (and your explanation there makes sense)
looking at xterm, I see we have not marked that as a root , which is where
I think that code was ported from originally.

I have attached an updated patch, using a rebuilt igc-emacs from that
commit, which is holding up.

Thanks,


On Wed, Nov 6, 2024 at 7:56 PM Gerd Möllmann <gerd.moellmann@gmail.com>
wrote:

> Fejfighter <fejfighter@gmail.com> writes:
>
> > This patch marks 2 outstanding ambiguous roots and appears to solve
> > crashing bugs I had been experiencing with igc/mps and pgtk.
> >
> > I have run this locally today, and I would have normally faced crashes
> > at timer expiration, this appears to be holding up.
>
> Thanks for the report, Jeff! Nice to see that someone besides me is
> using this :-).
>
> I think I see why the change in atimer.c is necessary: pgtk stores a
> struct frame * as client_data in an atimer structure. That's a Lisp
> object that can move during GC. Understood.
>
> The other change in pgtkterm.c I don't understand. AFAICS, x_id_name of
> the display_info structure is indeed only used as a character buffer
> into which characters from Lisp strings are memcpy'd. Could you please
> explain that one? (I'm macOS only, so I don't know anything about pgtk,
> if that matters.)
>

[-- Attachment #1.2: Type: text/html, Size: 2099 bytes --]

[-- Attachment #2: 0001-Mark-atimer-allocation-as-ambiguous-root.patch --]
[-- Type: text/x-patch, Size: 1070 bytes --]

From 080541ae5463eda9b20d9ec92cb41202ba21d87c Mon Sep 17 00:00:00 2001
From: Jeff Walsh <fejfighter@gmail.com>
Date: Tue, 5 Nov 2024 23:09:56 +1100
Subject: [PATCH] Mark atimer allocation as ambiguous root

* src/atimer.c (start_atimer): Time could be passed a lisp object for
data, we should allocate this as an ambiguous root
---
 src/atimer.c | 9 ++++++++-
 1 file changed, 8 insertions(+), 1 deletion(-)

diff --git a/src/atimer.c b/src/atimer.c
index 8253ae3a166..5bd282a310d 100644
--- a/src/atimer.c
+++ b/src/atimer.c
@@ -17,6 +17,7 @@
 along with GNU Emacs.  If not, see <https://www.gnu.org/licenses/>.  */
 
 #include <config.h>
+#include "igc.h"
 
 #ifdef WINDOWSNT
 #define raise(s) w32_raise(s)
@@ -132,7 +133,13 @@ start_atimer (enum atimer_type type, struct timespec timestamp,
       free_atimers = t->next;
     }
   else
-    t = xmalloc (sizeof *t);
+    {
+#ifdef HAVE_MPS
+      t = igc_xzalloc_ambig (sizeof *t);
+#else
+      t = xmalloc (sizeof *t);
+#endif
+    }
 
   /* Fill the atimer structure.  */
   memset (t, 0, sizeof *t);
-- 
2.47.0


  reply	other threads:[~2024-11-06  9:30 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-11-06  8:04 bug#74224: [PATCH][scratch/igc] pgtk: fix crashing bug in atimer used for checking scaling Fejfighter
2024-11-06  8:56 ` Gerd Möllmann
2024-11-06  9:30   ` Jeff Walsh [this message]
2024-11-06 10:34     ` Gerd Möllmann
2024-11-06 10:36     ` Gerd Möllmann
2024-11-06 10:44       ` Jeff Walsh
2024-11-06 10:49         ` Gerd Möllmann
2024-11-06 13:17           ` Eli Zaretskii
2024-11-06 13:39             ` 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='CALohuRAH3CP_KvQi-izDjHSK=RVYgNyjyXgw9b49-J383w=tmw@mail.gmail.com' \
    --to=fejfighter@gmail.com \
    --cc=74224@debbugs.gnu.org \
    --cc=gerd.moellmann@gmail.com \
    /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.