Subject: bug#75870: 30.0.93; feature/igc: Breakpoint 1, terminate_due_to_signal (sig=sig@entry=6, backtrace_limit=backtrace_limit@entry=40) at ./src/emacs.c:432

From: Pip Cet <[email-masked]>
Date: Tue, 28 Jan 2025 19:41:15 +0000

"Eli Zaretskii" <[email-masked]> writes:

>> Date: Tue, 28 Jan 2025 18:26:20 +0000
>> From:  Pip Cet via "Bug reports for GNU Emacs,
>>  the Swiss army knife of text editors" <[email-masked]>
>>
>> > #3  0x00005555557ef088 in xfree (block=0x555556646030) at ./src/alloc.c:842
>> > #4  xfree (block=0x555556646030) at ./src/alloc.c:835
>> > #5 0x000055555571e72c in xi_disable_devices
>> > (dpyinfo=dpyinfo@entry=0x555556633190,
>> > to_disable=to_disable@entry=0x7fffffffb340,
>> > n_disabled=n_disabled@entry=1) at ./src/xterm.c:13970
>>
>> That line is:
>>
>>       xfree (dpyinfo->devices);
>
> There's a similar line at xterm.c:5417, it seems.

Thanks for the heads-up!  Here's the patch again, which seems to cover
that line.  Or did I mess up somehow?

Pip

diff --git a/src/xterm.c b/src/xterm.c
index ada7fbc2e41..049e283cdbc 100644
--- a/src/xterm.c
+++ b/src/xterm.c
@@ -5414,7 +5414,11 @@ x_free_xi_devices (struct x_display_info *dpyinfo)
 #endif /* HAVE_XINPUT2_2 */
 	}
 
+#ifdef HAVE_MPS
+      igc_xfree (dpyinfo->devices);
+#else
       xfree (dpyinfo->devices);
+#endif
       dpyinfo->devices = NULL;
       dpyinfo->num_devices = 0;
     }
@@ -13967,7 +13971,11 @@ xi_disable_devices (struct x_display_info *dpyinfo,
     }
 
   /* Free the old devices array and replace it with ndevices.  */
+#ifdef HAVE_MPS
+  igc_xfree (dpyinfo->devices);
+#else
   xfree (dpyinfo->devices);
+#endif
 
   dpyinfo->devices = devices;
   dpyinfo->num_devices = ndevices;
-- 
2.47.1