From 4d40e0db35a79316d3f0c1921f1c3d7a57dac467 Mon Sep 17 00:00:00 2001 From: Eli Zaretskii Date: Sat, 21 Jun 2025 11:53:24 +0300 Subject: [PATCH] Avoid segfault when profiling Lisp programs with threads * src/eval.c (backtrace_top): Don't segfault if current_thread is NULL. (Bug#76970) (cherry picked from commit dd95447b05eb2e86e0500d953f43213df028c19a) --- src/eval.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/eval.c b/src/eval.c index 0ad26c43867..2e96c584524 100644 --- a/src/eval.c +++ b/src/eval.c @@ -171,7 +171,7 @@ backtrace_top (void) /* This is so "xbacktrace" doesn't crash in pdumped Emacs if they invoke the command before init_eval_once_for_pdumper initializes specpdl machinery. See also backtrace_p above. */ - if (!specpdl) + if (!current_thread || !specpdl) return NULL; union specbinding *pdl = specpdl_ptr - 1; -- 2.39.5