GNU bug report logs - #78943
feature/igc [PATCH] Trace current minor maps exactly

Previous Next

Package: emacs;

Reported by: Helmut Eller <eller.helmut <at> gmail.com>

Date: Wed, 2 Jul 2025 12:29:02 UTC

Severity: normal

Tags: patch

Full log


View this message in rfc822 format

From: Pip Cet <pipcet <at> protonmail.com>
To: Helmut Eller <eller.helmut <at> gmail.com>
Cc: 78943 <at> debbugs.gnu.org
Subject: bug#78943: feature/igc [PATCH] Trace current minor maps exactly
Date: Wed, 09 Jul 2025 14:29:29 +0000
"Helmut Eller" <eller.helmut <at> gmail.com> writes:

> From 3a1a4549a0545afbddc96a87b404b6c7b835d5b7 Mon Sep 17 00:00:00 2001
> From: Helmut Eller <eller.helmut <at> gmail.com>
> Date: Wed, 2 Jul 2025 14:10:56 +0200
> Subject: [PATCH] Trace current minor maps exactly
>
> * src/keymap.c (current_minor_maps): Use igc_xalloc_lisp_objs_exact
> instead of igc_xzalloc_ambig.

Thanks, LGTM.  Hope that applies to the other accumulated patches, too,
then I'll install them all.

This is a preexisting bug, but I'm suspicious about the code leaking a
pointer to an igc_xzalloc'd area to its caller, which may call Lisp
(when it autoloads a map) in the case of Fminor_mode_key_binding.  If
that Lisp code recursively accesses keymaps and the maps get
reallocated, we end up resurrecting free'd data, and will probably
crash.  (My suspicion is this is the reason for the "don't use realloc"
comment, too).

We should really fix this on master and just use vectors, and it's
probably even less effort for you to do so than it is for me, but I
still don't get how code like this is meant to be fixed.

(I hope the comment about static being defined to the empty string is no
longer accurate :-) ).

Pip





This bug report was last modified 66 days ago.

Previous Next


GNU bug tracking system
Copyright (C) 1999 Darren O. Benham, 1997,2003 nCipher Corporation Ltd, 1994-97 Ian Jackson.