GNU bug report logs - #76091
31.0.50; festure/igc: buffer.h:829: Emacs fatal error: assertion failed: BUFFERP (a)

Previous Next

Package: emacs;

Reported by: Gregor Zattler <telegraph <at> gmx.net>

Date: Thu, 6 Feb 2025 12:51:01 UTC

Severity: normal

Found in version 31.0.50

Done: Pip Cet <pipcet <at> protonmail.com>

Bug is archived. No further changes may be made.

Full log


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

From: Pip Cet <pipcet <at> protonmail.com>
To: Helmut Eller <eller.helmut <at> gmail.com>
Cc: Gerd Möllmann <gerd.moellmann <at> gmail.com>,
 76091 <at> debbugs.gnu.org, Gregor Zattler <telegraph <at> gmx.net>,
 Eli Zaretskii <eliz <at> gnu.org>
Subject: Re: bug#76091: 31.0.50;
 festure/igc: buffer.h:829: Emacs fatal error: assertion failed:
 BUFFERP (a)
Date: Fri, 07 Feb 2025 20:35:10 +0000
"Helmut Eller" <eller.helmut <at> gmail.com> writes:

> On Fri, Feb 07 2025, Pip Cet wrote:
>
>> It still needs more testing, thought, and comments.  All the volatile
>> stuff is needed because we can't copy a union with word atomicity: all
>> we have is memcpy, which might copy bytewise and result in an invalid
>> intermediate state.
>
> But volatile doesn't guarantee atomicity.  Does it?

No, it doesn't.  But having a volatile structure on the stack guarantees
that none of the pointers in the heap structure can be moved (the
volatile stack structure pins them).

But I see now we do use union assignments in an attempt to get word
atomicity, so maybe the volatile stack structure pinning the pointers
isn't always needed.

Maybe it'd be better to define memcpy_by_words which never reveals
intermediate states.

However, this race condition window should be quite small, so probably
worth thinking about more...

Pip





This bug report was last modified 102 days ago.

Previous Next


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