GNU bug report logs - #79425
31.0.50; `subst-char-in-string' crashes

Previous Next

Package: emacs;

Reported by: Rudolf Adamkovič <rudolf <at> adamkovic.org>

Date: Wed, 10 Sep 2025 21:25:01 UTC

Severity: normal

Tags: notabug

Found in version 31.0.50

Full log


View this message in rfc822 format

From: Eli Zaretskii <eliz <at> gnu.org>
To: Stephen Berman <stephen.berman <at> gmx.net>
Cc: rudolf <at> adamkovic.org, 79425 <at> debbugs.gnu.org
Subject: bug#79425: 31.0.50; `subst-char-in-string' crashes
Date: Thu, 11 Sep 2025 07:48:09 +0300
tags 79425 notabug
thanks

> Cc: 79425 <at> debbugs.gnu.org
> Date: Wed, 10 Sep 2025 23:51:52 +0200
> From:  Stephen Berman via "Bug reports for GNU Emacs,
>  the Swiss army knife of text editors" <bug-gnu-emacs <at> gnu.org>
> 
> On Wed, 10 Sep 2025 23:24:13 +0200 Rudolf Adamkovič <rudolf <at> adamkovic.org> wrote:
> 
> > I am trying to export an Org mode file with citations using Emacs
> > compiled from `master' on NS.  The export crashes in `citeproc-el', a
> > 3rd-party library used by Org to format citations.  I reported the
> > problem upstream [1], and it seems to be a problem with Emacs itself.
> >
> > [1] https://github.com/andras-simonyi/citeproc-el/issues/181
> >
> > REPRODUCTION STEPS:
> >
> >   1. Checkout Emacs from Git commit `66ef930ebea'.
> >   1. Run `emacs -Q' on NS (MacOS 15.5).
> >   2. Evaluate `(subst-char-in-string 39 700 "D'Arcus" t)' in *scratch*.
> >
> > UNEXPECTED ERROR:
> >
> >   Debugger entered--Lisp error: (error "Attempt to store non-byte value into unibyte string")
> >     aset("D'Arcus" 1 700)
> 
> This is due to this change:
> 
> commit 308e3ab1dbd9633b843541af55d77c82b725df02
> Author:     Mattias Engdegård <mattias.engdegard <at> gmail.com>
> Commit:     Mattias Engdegård <mattias.engdegard <at> gmail.com>
> CommitDate: Sun Aug 24 10:28:27 2025 +0200
> 
>     Disallow string data resizing (bug#79784)
>     
>     Only allow string mutation that is certain not to require string data to
>     be resized and reallocated: writing bytes into a unibyte string, and
>     changing ASCII to ASCII in a multibyte string.
>     
>     This ensures that mutation will never transform a unibyte string to
>     multibyte, that the size of a string in bytes never changes, and that
>     the byte offsets of characters remain the same.  Most importantly, it
>     removes a long-standing obstacle to reform of string representation and
>     allow for future performance improvements.
>     
>     * src/data.c (Faset): Disallow resizing string mutation.
>     [...]

Indeed, and so this is not a bug, but a deliberate change, documented
in NEWS.

(It is also wrong to say "crashes" when actually Emacs signals an
error.)




This bug report was last modified 3 days ago.

Previous Next


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