From 0a5b6e28f91ff46231a768737170e39172297257 Mon Sep 17 00:00:00 2001 From: Eli Zaretskii Date: Wed, 21 Dec 2016 22:16:24 +0200 Subject: [PATCH] Fix aborts in GC under GC_CHECK_MARKED_OBJECTS * src/alloc.c (mark_object) [GC_CHECK_MARKED_OBJECTS]: Don't abort for thread objects. They are marked via the all_threads list, and therefore don't need to be inserted into the red-black tree, so mem_find will never find them. Reported by Daniel Colascione in http://lists.gnu.org/archive/html/emacs-devel/2016-12/msg00817.html. --- src/alloc.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/src/alloc.c b/src/alloc.c index f2b7682b05d..e979f3631ee 100644 --- a/src/alloc.c +++ b/src/alloc.c @@ -6406,7 +6406,7 @@ mark_object (Lisp_Object arg) #ifdef GC_CHECK_MARKED_OBJECTS m = mem_find (po); - if (m == MEM_NIL && !SUBRP (obj)) + if (m == MEM_NIL && !SUBRP (obj) && !THREADP (obj)) emacs_abort (); #endif /* GC_CHECK_MARKED_OBJECTS */ @@ -6416,7 +6416,9 @@ mark_object (Lisp_Object arg) else pvectype = PVEC_NORMAL_VECTOR; - if (pvectype != PVEC_SUBR && pvectype != PVEC_BUFFER) + if (pvectype != PVEC_SUBR + && pvectype != PVEC_BUFFER + && pvectype != PVEC_THREAD) CHECK_LIVE (live_vector_p); switch (pvectype) -- 2.39.2