all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
From: Stefan Monnier <monnier@IRO.UMontreal.CA>
To: Philipp Stephani <p.stephani2@gmail.com>
Cc: 31238@debbugs.gnu.org, "Tuấn Anh Nguyễn" <ubolonton@gmail.com>
Subject: bug#31238: Dynamic Module Crash
Date: Fri, 21 Sep 2018 18:48:40 -0400	[thread overview]
Message-ID: <jwvin2y8os7.fsf-monnier+bug#31238@gnu.org> (raw)
In-Reply-To: <CAArVCkRGGR8Aux0x7JsrxsWCY8Pob3_jaVDgergP++ULvcVuDA@mail.gmail.com> (Philipp Stephani's message of "Fri, 21 Sep 2018 19:16:44 +0200")

>>> 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





  parent reply	other threads:[~2018-09-21 22:48 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-04-22 11:35 bug#31238: Dynamic Module Crash Tuấn Anh Nguyễn
2018-04-24 14:08 ` Philipp Stephani
2018-09-21 17:16   ` Philipp Stephani
2018-09-21 18:33     ` Noam Postavsky
2018-09-21 22:48     ` Stefan Monnier [this message]
2019-03-21 19:31       ` Philipp Stephani

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to='jwvin2y8os7.fsf-monnier+bug#31238@gnu.org' \
    --to=monnier@iro.umontreal.ca \
    --cc=31238@debbugs.gnu.org \
    --cc=p.stephani2@gmail.com \
    --cc=ubolonton@gmail.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this external index

	https://git.savannah.gnu.org/cgit/emacs.git
	https://git.savannah.gnu.org/cgit/emacs/org-mode.git

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.