From: Fejfighter <fejfighter@gmail.com>
To: 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 19:04:42 +1100 [thread overview]
Message-ID: <CALohuRCR+4zRd+7Y2mZxTMoN2Tk8B0nRP0JkaryqUW8iUFjwRA@mail.gmail.com> (raw)
[-- 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 *
next reply other threads:[~2024-11-06 8:04 UTC|newest]
Thread overview: 9+ messages / expand[flat|nested] mbox.gz Atom feed top
2024-11-06 8:04 Fejfighter [this message]
2024-11-06 8:56 ` bug#74224: [PATCH][scratch/igc] pgtk: fix crashing bug in atimer used for checking scaling 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
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=CALohuRCR+4zRd+7Y2mZxTMoN2Tk8B0nRP0JkaryqUW8iUFjwRA@mail.gmail.com \
--to=fejfighter@gmail.com \
--cc=74224@debbugs.gnu.org \
/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.