unofficial mirror of bug-gnu-emacs@gnu.org 
 help / color / mirror / code / Atom feed
* bug#74224: [PATCH][scratch/igc] pgtk: fix crashing bug in atimer used for checking scaling
@ 2024-11-06  8:04 Fejfighter
  2024-11-06  8:56 ` Gerd Möllmann
  0 siblings, 1 reply; 9+ messages in thread
From: Fejfighter @ 2024-11-06  8:04 UTC (permalink / raw)
  To: 74224


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

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.



In GNU Emacs 31.0.50 (build 3, x86_64-pc-linux-gnu, GTK+ Version
 3.24.43, cairo version 1.18.0) of 2024-11-06 built on solidus.local
Repository revision: 96de0bf0ba9161af5d3f783b45a5a9de530b6f95
Repository branch: scratch/igc
System Description: Fedora Linux 41 (Sway)

Configured using:
 'configure --with-pgtk --with-mps CFLAGS=-O2'

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

[-- Attachment #2: mps-igc-pgtk.patch --]
[-- Type: text/x-patch, Size: 1495 bytes --]

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);
diff --git a/src/pgtkterm.c b/src/pgtkterm.c
index ef940509626..c0ed68d6820 100644
--- a/src/pgtkterm.c
+++ b/src/pgtkterm.c
@@ -7166,7 +7166,11 @@ #define NUM_ARGV 10
   if (ckd_add (&nbytes, SBYTES (Vinvocation_name), SBYTES (system_name) + 2))
     memory_full (SIZE_MAX);
   dpyinfo->x_id = ++x_display_id;
+#ifdef HAVE_MPS
+  dpyinfo->x_id_name = igc_xzalloc_ambig (nbytes);
+#else
   dpyinfo->x_id_name = xmalloc (nbytes);
+#endif
   char *nametail = lispstpcpy (dpyinfo->x_id_name, Vinvocation_name);
   *nametail++ = '@';
   lispstpcpy (nametail, system_name);
@@ -7302,7 +7306,14 @@ pgtk_delete_display (struct pgtk_display_info *dpyinfo)
     }
 
   pgtk_free_devices (dpyinfo);
+
+#ifdef HAVE_MPS
+  igc_xfree (dpyinfo->x_id_name);
+  igc_xfree (dpyinfo);
+#else
+  xfree (dpyinfo->x_id_name);
   xfree (dpyinfo);
+#endif
 }
 
 char *

^ permalink raw reply related	[flat|nested] 9+ messages in thread

end of thread, other threads:[~2024-11-06 13:39 UTC | newest]

Thread overview: 9+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
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
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

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).