From 1877b7b4d79b3434379fd5a4abd85906c25df00c Mon Sep 17 00:00:00 2001 From: Andreas Schwab Date: Mon, 10 Jun 2019 12:34:38 +0200 Subject: [PATCH] Don't mark main_thread (Bug#36155) * thread.c (mark_threads_callback): Don't mark main_thread. --- src/thread.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src/thread.c b/src/thread.c index 0cd1ae33dc2..e2158019839 100644 --- a/src/thread.c +++ b/src/thread.c @@ -645,7 +645,10 @@ mark_threads_callback (void *ignore) Lisp_Object thread_obj; XSETTHREAD (thread_obj, iter); - mark_object (thread_obj); + /* Don't mark main_thread, since it is not allocated + dynamically, thus nothing would unmark it. */ + if (iter != &main_thread) + mark_object (thread_obj); mark_one_thread (iter); } } -- 2.39.2