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


Message #8 received at 79425 <at> debbugs.gnu.org (full text, mbox):

From: Stephen Berman <stephen.berman <at> gmx.net>
To: Rudolf Adamkovič <rudolf <at> adamkovic.org>
Cc: 79425 <at> debbugs.gnu.org
Subject: Re: bug#79425: 31.0.50; `subst-char-in-string' crashes
Date: Wed, 10 Sep 2025 23:51:52 +0200
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.
    [...]

Steve Berman




This bug report was last modified 2 days ago.

Previous Next


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