GNU bug report logs -
#31238
Dynamic Module Crash
Previous Next
Reported by: Tuấn Anh Nguyễn <ubolonton <at> gmail.com>
Date: Sun, 22 Apr 2018 16:32:02 UTC
Severity: normal
Merged with 34655
Found in version 26.1.92
Done: Eli Zaretskii <eliz <at> gnu.org>
Bug is archived. No further changes may be made.
Full log
View this message in rfc822 format
>>> Emacs 25.3.1 crashes with a segfault when trying to print a value
>>> constructed (in certain ways) by a dynamic module.
>>> Reproduction: https://github.com/ubolonton/emacs-module-crash
>>> Context: https://github.com/ubolonton/emacs-module-rs/issues/2
>> This might be caused by commit 3eb93c07f7a60ac9ce8a16f10c3afd5a3a31243a,
IIUC that's just a wild guess, right?
>> which removed GC protection for module-allocated values.
Not really, no. It just relied on another pre-existing mechanism.
> Unless anybody complains, I'll revert that commit.
Do we even know that reverting it circumvents this crash?
And IIRC this patch is not just an implementation detail, it changes the
module's API and ABI, so reverting it shouldn't be done lightly.
> Modules can store/use emacs_value objects in arbitrary ways;
> there's no way we can rely on stack scanning to reliably find them.
We don't blindly rely on stack scanning: there are functions to
(un)register other values stored in the (non-Lisp) heap.
The previous code wasn't magical either.
I don't know nearly enough about Rust's implementation strategy and the
`emacs` crate used to guess how its memory management could/should
interact with Emacs's.
Stefan
This bug report was last modified 6 years and 61 days ago.
Previous Next
GNU bug tracking system
Copyright (C) 1999 Darren O. Benham,
1997,2003 nCipher Corporation Ltd,
1994-97 Ian Jackson.