From: Valentin Gatien-Baron <vgatien-baron@janestreet.com>
To: Eli Zaretskii <eliz@gnu.org>
Cc: 29066@debbugs.gnu.org, Mark Shinwell <mshinwell@janestreet.com>
Subject: bug#29066: 26.0.90; crash in gc involving buffer local symbols
Date: Mon, 30 Oct 2017 18:04:14 -0400 [thread overview]
Message-ID: <CAFd54qOEYm2UAG+cFjcEmRR0pHZJzy=1eyfonQTnYsRVE=NCfQ@mail.gmail.com> (raw)
In-Reply-To: <83a808tlqp.fsf@gnu.org>
[-- Attachment #1: Type: text/plain, Size: 1896 bytes --]
Yes, it fixes the problem.
I also checked the following works, and seems better to me (stop having
dangling pointers, instead of being careful with them):
diff --git a/src/alloc.c b/src/alloc.c
index da0c3ad4b3..44dfa95cf5 100644
--- a/src/alloc.c
+++ b/src/alloc.c
@@ -7030,8 +7030,10 @@ sweep_symbols (void)
{
if (!sym->s.gcmarkbit)
{
- if (sym->s.redirect == SYMBOL_LOCALIZED)
+ if (sym->s.redirect == SYMBOL_LOCALIZED) {
xfree (SYMBOL_BLV (&sym->s));
+ sym->s.val.blv = NULL;
+ }
sym->s.next = symbol_free_list;
symbol_free_list = &sym->s;
symbol_free_list->function = Vdead;
On Mon, Oct 30, 2017 at 4:38 PM, Eli Zaretskii <eliz@gnu.org> wrote:
> > From: Valentin Gatien-Baron <vgatien-baron@janestreet.com>
> > Date: Mon, 30 Oct 2017 10:36:41 -0400
> > Cc: Mark Shinwell <mshinwell@janestreet.com>
> >
> > $ installed/bin/emacs -Q -L . -batch --eval '(progn (message "before")
> (make-local-variable (make-symbol "\
> > s")) (kill-buffer) (garbage-collect) (garbage-collect) (message
> "after"))'
> > before
> > *** Error in `installed/bin/emacs': double free or corruption (!prev):
> 0x00000000014bff10 ***
>
> Thanks.
>
> Does the below fix the problem?
>
> diff --git a/src/alloc.c b/src/alloc.c
> index d9d7485..11afdfd 100644
> --- a/src/alloc.c
> +++ b/src/alloc.c
> @@ -7024,7 +7024,9 @@ sweep_symbols (void)
> {
> if (!sym->s.gcmarkbit)
> {
> - if (sym->s.redirect == SYMBOL_LOCALIZED)
> + if (sym->s.redirect == SYMBOL_LOCALIZED
> + /* Already freed? */
> + && !EQ (sym->s.function, Vdead))
> xfree (SYMBOL_BLV (&sym->s));
> sym->s.next = symbol_free_list;
> symbol_free_list = &sym->s;
>
[-- Attachment #2: Type: text/html, Size: 3644 bytes --]
next prev parent reply other threads:[~2017-10-30 22:04 UTC|newest]
Thread overview: 16+ messages / expand[flat|nested] mbox.gz Atom feed top
2017-10-30 14:36 bug#29066: 26.0.90; crash in gc involving buffer local symbols Valentin Gatien-Baron
2017-10-30 20:38 ` Eli Zaretskii
2017-10-30 22:04 ` Valentin Gatien-Baron [this message]
2017-10-31 3:39 ` Eli Zaretskii
2017-10-31 6:32 ` Andreas Schwab
2017-10-31 14:52 ` Valentin Gatien-Baron
2017-10-31 19:10 ` Eli Zaretskii
2017-10-31 19:58 ` Valentin Gatien-Baron
2017-10-31 20:09 ` Eli Zaretskii
2017-10-31 20:13 ` Valentin Gatien-Baron
2017-10-31 18:59 ` Eli Zaretskii
2017-10-31 20:23 ` Andreas Schwab
2017-10-31 20:34 ` Eli Zaretskii
2017-10-31 21:03 ` Andreas Schwab
2017-10-31 21:08 ` Eli Zaretskii
2017-10-31 22:00 ` Andreas Schwab
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='CAFd54qOEYm2UAG+cFjcEmRR0pHZJzy=1eyfonQTnYsRVE=NCfQ@mail.gmail.com' \
--to=vgatien-baron@janestreet.com \
--cc=29066@debbugs.gnu.org \
--cc=eliz@gnu.org \
--cc=mshinwell@janestreet.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.