GNU bug report logs - #70122
29.3.50; transpose-regions can crash Emacs

Previous Next

Package: emacs;

Reported by: Braun Gábor <braungb88 <at> gmail.com>

Date: Mon, 1 Apr 2024 10:04:02 UTC

Severity: normal

Tags: patch, pending

Found in version 29.3.50

Full log


View this message in rfc822 format

From: Eli Zaretskii <eliz <at> gnu.org>
To: Braun Gábor <braungb88 <at> gmail.com>
Cc: 70122 <at> debbugs.gnu.org
Subject: bug#70122: 29.3.50; transpose-regions can crash Emacs
Date: Mon, 01 Apr 2024 14:55:21 +0300
> From: Braun Gábor <braungb88 <at> gmail.com>
> Date: Mon, 01 Apr 2024 12:02:35 +0200
> 
> I have the following file:
> 
> File ~/.emacs.d/trans-regions-bug.el:
> 
> (with-temp-buffer
>   (insert (propertize "a" 'face 'font-lock-variable-name-face))
>   (insert ":\n")
>   (insert (propertize "b" 'face 'font-lock-variable-name-face))
>   (insert ": \x2113\x2080\n")
>   (insert (propertize "v" 'face 'font-lock-variable-name-face))
>   (insert ": scaling\n")
>   ;; Move last line to the beginning
>   (transpose-regions 1 1 10 21))
> 
> End of file ~/.emacs.d/trans-regions-bug.el:
> 
> 
> After building Emacs as described in the INSTALL file, the following
> command crashes Emacs:
> 
>   src/emacs -Q --batch -l ~/.emacs.d/trans-regions-bug.el
> 
> The following appears:
> 
> Fatal error 11: Segmentation fault
> 
> 
> See below for debugging information.
> 
> Please find attached a patch to transpose-regions
> with added tests.  (The patch intends to fix typos:
> makes sure lengths in bytes and characters are not confused.

Thanks, but could you please show the minimal change required to fix
just the particular problem with this scenario (and perhaps explain
the reason for the crash in words), without any cleanup and
typo/confusion fixes?  That would make it easier to review the patch,
whereas with what you sent, it is hard to understand what exactly is
being fixed.

> One case (likely for optimization only) has been removed,
> seemed too much trouble to get it right.)

If you explain the reason for the crash, perhaps we could leave the
optimization alone.




This bug report was last modified 60 days ago.

Previous Next


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