From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Stefan Kangas Newsgroups: gmane.emacs.bugs Subject: bug#75275: 30.0.92; `make-thread` bug on macOS 15.2 Date: Thu, 2 Jan 2025 01:31:39 -0600 Message-ID: References: <86bjwplmc1.fsf@gnu.org> Mime-Version: 1.0 Content-Type: text/plain; charset="UTF-8" Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="32595"; mail-complaints-to="usenet@ciao.gmane.io" Cc: 75275@debbugs.gnu.org, Michael Albinus To: Eli Zaretskii , Alan Third , Gerd =?UTF-8?Q?M=C3=B6llmann?= Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Thu Jan 02 08:32:13 2025 Return-path: Envelope-to: geb-bug-gnu-emacs@m.gmane-mx.org Original-Received: from lists.gnu.org ([209.51.188.17]) by ciao.gmane.io with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1tTFgj-0008Iz-4y for geb-bug-gnu-emacs@m.gmane-mx.org; Thu, 02 Jan 2025 08:32:13 +0100 Original-Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1tTFgb-00026m-J4; Thu, 02 Jan 2025 02:32:05 -0500 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1tTFga-00026B-28 for bug-gnu-emacs@gnu.org; Thu, 02 Jan 2025 02:32:04 -0500 Original-Received: from debbugs.gnu.org ([2001:470:142:5::43]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1tTFgY-0005tx-1N for bug-gnu-emacs@gnu.org; Thu, 02 Jan 2025 02:32:03 -0500 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=debbugs.gnu.org; s=debbugs-gnu-org; h=Date:MIME-Version:References:In-Reply-To:From:To:Subject; bh=ZwVJLqJByJeGARoY1UUwP8CuKXaJKS62pVCYei/xyCA=; b=uHAsFMxo1do+XGK+M+cRNsKzszrltwHy6anNsemMXmkMwz8mp+nHiS6DulrwX940g9w8t5L5B9ZqKXr0f75XRiITnavLo6tbur6Oe6mjV+N7fe0uZFuygFFojYfqbVPrgwhpSWXcDYs7SZL5liWrV5rkL7cSzFj7UKOsiXBP/o1gtUnZYCUmVovjugOunbyBgWs4Ui2Si7GiLe489AJ7RLEzzDijIMlo9l9S3fo9pn8hs0Lm1GtvAfHdqGqRbZhO3mA0QYppuH1zoujtWJ+AqJN89dhKUzDG64VWEY8AWRTEBcL6SKhBN3Hq8CyVzthA0wOGxFrxyKyJ7P/NWZO1ZA==; Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1tTFgX-0001UW-SC for bug-gnu-emacs@gnu.org; Thu, 02 Jan 2025 02:32:01 -0500 X-Loop: help-debbugs@gnu.org Resent-From: Stefan Kangas Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Thu, 02 Jan 2025 07:32:01 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 75275 X-GNU-PR-Package: emacs Original-Received: via spool by 75275-submit@debbugs.gnu.org id=B75275.17358031045708 (code B ref 75275); Thu, 02 Jan 2025 07:32:01 +0000 Original-Received: (at 75275) by debbugs.gnu.org; 2 Jan 2025 07:31:44 +0000 Original-Received: from localhost ([127.0.0.1]:42567 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1tTFgF-0001U0-D7 for submit@debbugs.gnu.org; Thu, 02 Jan 2025 02:31:43 -0500 Original-Received: from mail-ed1-x532.google.com ([2a00:1450:4864:20::532]:58657) by debbugs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.84_2) (envelope-from ) id 1tTFgD-0001Tr-EF for 75275@debbugs.gnu.org; Thu, 02 Jan 2025 02:31:42 -0500 Original-Received: by mail-ed1-x532.google.com with SMTP id 4fb4d7f45d1cf-5cecbddb574so19236138a12.1 for <75275@debbugs.gnu.org>; Wed, 01 Jan 2025 23:31:41 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1735803100; x=1736407900; darn=debbugs.gnu.org; h=cc:to:subject:message-id:date:mime-version:references:in-reply-to :from:from:to:cc:subject:date:message-id:reply-to; bh=ZwVJLqJByJeGARoY1UUwP8CuKXaJKS62pVCYei/xyCA=; b=KQ6ddortOsZCQbHxeh17Tcq8HPiSitBcrUyHJILg8eoPs18I6erpuvYMTjtOxPH668 pSmJfzjDdE02BPo+w5Xoo6hP8KCwyI0XjqwMjfXH7h8D52inLTa8T42zaO4JIjesi04p C8oFzzmjtAMmjm2463VH4g+DyMG6kpFqJEhIX4yp6YdHH6JyT2vJfVS+514n2LTxtD5f 8J+uHmxpZGFxtAflvBKOJEF7UCJbMcLe9eZyhStaE06N2YkwaJKKubr19sY78MLqcyZp uWLFo2QCR4mdLd5ms3UW+5pKbZHKYEwey0ivX/Fg/UlqaN9C+3gvU3m2RIJTkzDmTtZn tqow== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1735803100; x=1736407900; h=cc:to:subject:message-id:date:mime-version:references:in-reply-to :from:x-gm-message-state:from:to:cc:subject:date:message-id:reply-to; bh=ZwVJLqJByJeGARoY1UUwP8CuKXaJKS62pVCYei/xyCA=; b=QiHRQ2zJX+ByV5jp8rFPiPrSJSh0TfCU+iEIo4jMog7CJ/0LZhxGlG8qENa/3SLSid MDpxSh750ntTbEsN2O3ZCF0NQCU7gj7Kabf7lE6DXaJM9LdbbFKQInizVPT+Jsd2tXfq 1FioidNiPQA89Fy9LuzrZ/SxBnClhstyjmTPPnluqPMAxGchnqVmNLcB4AxCIp9BjT5t K7mCJ6TvFh76lrNC49O1SpFQCL4HAarKo6h1H3TKAqzFbZ2CiFX5sMstZNhU3S2TSJ+N k21AfzbEwmgsNyCqlFe6TAlDKMWLTGCzjZnok0Ov8WGLsdDZgCH1UZNRsN2JdLVISMUY hiZw== X-Gm-Message-State: AOJu0YyYE4IR8R2iPGshcA79YPwn1JBCya1xdozjI+/w2cMWnYGQkoei 1g67iyIH91bhkwnlDU8gjMbCfxlBDhFHOh94aLsL2pyh83um5KsWbET8+WrovXcIkMUYEpj76WM wrU5L0jHHc+H00uA+27KkWuZW9bw= X-Gm-Gg: ASbGncv6WwUeh6YOSDhj2ehw+19PisuxxV11wvOWMtCCajQ6GfzeaREoCE1/FkrNaJT BzVeAymhqX7iOz77AZmFQ6nM4jWXHLcYBQslzYyyK X-Google-Smtp-Source: AGHT+IEcWzf+iibMAVqAM4s8NkBLTkKwevkdMk45yMzchnUywTu5MQhmYKLOoUh7iiLKleEiM6EcI/j1m//GxMK+UZo= X-Received: by 2002:a05:6402:3510:b0:5d0:e2c8:dc8d with SMTP id 4fb4d7f45d1cf-5d81ddfe37cmr41471168a12.20.1735803099883; Wed, 01 Jan 2025 23:31:39 -0800 (PST) Original-Received: from 753933720722 named unknown by gmailapi.google.com with HTTPREST; Thu, 2 Jan 2025 01:31:39 -0600 In-Reply-To: <86bjwplmc1.fsf@gnu.org> X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list X-BeenThere: bug-gnu-emacs@gnu.org List-Id: "Bug reports for GNU Emacs, the Swiss army knife of text editors" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Original-Sender: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Xref: news.gmane.io gmane.emacs.bugs:298138 Archived-At: Eli Zaretskii writes: > The above works as expected on MS-Windows and on GNU/Linux: after > about 1 sec the new thread exits, and Emacs works normally. > list-threads shows a single main thread running at that time. Thanks for verifying that this is macOS specific. >> thread #7, name = 'bug' >> frame #0: 0x000000018de3a2b0 >> dyld`dyld3::MachOLoaded::findClosestSymbol(unsigned long long, char >> const**, unsigned long long*) const + 488 >> frame #1: 0x000000018de1b13c dyld`dyld4::APIs::dladdr(void const*, >> dl_info*) + 236 >> frame #2: 0x000000018e012f00 libsystem_c.dylib`backtrace_symbols + 144 >> frame #3: 0x000000018f4998c0 Foundation`-[_NSCallStackArray >> descriptionWithLocale:indent:] + 144 >> frame #4: 0x000000018f3e8c10 Foundation`_NS_os_log_callback + 276 >> frame #5: 0x000000018debee60 >> libsystem_trace.dylib`_os_log_fmt_flatten_NSCF + 64 >> frame #6: 0x000000018dec5830 >> libsystem_trace.dylib`_os_log_fmt_flatten_object_impl + 372 >> frame #7: 0x000000018debc9c8 >> libsystem_trace.dylib`_os_log_impl_flatten_and_send + 2144 >> frame #8: 0x000000018debc150 libsystem_trace.dylib`_os_log + 168 >> frame #9: 0x000000018debc0a0 libsystem_trace.dylib`_os_log_impl + 28 >> frame #10: 0x000000019209151c AppKit`-[NSApplication reportException:] + 624 >> frame #11: 0x0000000191db0118 AppKit`-[NSApplication run] + 664 >> frame #12: 0x0000000100403fec emacs`-[EmacsApp >> run](self=0x0000000156610fe0, _cmd="run") at nsterm.m:5938:7 >> frame #13: 0x00000001004024b0 emacs`ns_select_1(nfds=0, >> readfds=0x00000001708c26bc, writefds=0x00000001708c263c, >> exceptfds=0x0000000000000000, timeout=0x00000001708c2610, >> sigmask=0x0000000000000000, run_loop_only=NO) at nsterm.m:4954:3 >> frame #14: 0x000000010040202c emacs`ns_select(nfds=0, >> readfds=0x00000001708c26bc, writefds=0x00000001708c263c, >> exceptfds=0x0000000000000000, timeout=0x00000001708c2610, >> sigmask=0x0000000000000000) at nsterm.m:5006:10 >> frame #15: 0x000000010036930c >> emacs`wait_reading_process_output(time_limit=1, nsecs=0, read_kbd=0, >> do_display=false, wait_for_cell=(i = 0x0000000000000000), >> wait_proc=0x0000000000000000, just_wait_proc=0) at process.c:5753:18 >> frame #16: 0x000000010000b400 emacs`Fsleep_for(seconds=(i = >> 0x0000000000000006), milliseconds=(i = 0x0000000000000000)) at >> dispnew.c:6248:2 > > This is the new Lisp thread started by make-thread, but it is > somewhere in the bowels of macOS. Is this what you see each time you > kill Emacs after it hangs? Yes, the backtrace seems to be the same every time. For example, I tried again just now and got this over three attempts: 1. thread #18, name = 'bug' frame #0: 0x000000018de3a268 dyld`dyld3::MachOLoaded::findClosestSymbol(unsigned long long, char const**, unsigned long long*) const + 416 frame #1: 0x000000018de1b13c dyld`dyld4::APIs::dladdr(void const*, dl_info*) + 236 frame #2: 0x000000018e012f00 libsystem_c.dylib`backtrace_symbols + 144 frame #3: 0x000000018f4998c0 Foundation`-[_NSCallStackArray descriptionWithLocale:indent:] + 144 2. thread #7, name = 'bug' frame #0: 0x000000018de3a2b0 dyld`dyld3::MachOLoaded::findClosestSymbol(unsigned long long, char const**, unsigned long long*) const + 488 frame #1: 0x000000018de1b13c dyld`dyld4::APIs::dladdr(void const*, dl_info*) + 236 frame #2: 0x000000018e012f00 libsystem_c.dylib`backtrace_symbols + 144 frame #3: 0x000000018f4998c0 Foundation`-[_NSCallStackArray descriptionWithLocale:indent:] + 144 3. thread #9, name = 'bug' frame #0: 0x000000018de3a268 dyld`dyld3::MachOLoaded::findClosestSymbol(unsigned long long, char const**, unsigned long long*) const + 416 frame #1: 0x000000018de1b13c dyld`dyld4::APIs::dladdr(void const*, dl_info*) + 236 frame #2: 0x000000018e012f00 libsystem_c.dylib`backtrace_symbols + 144 frame #3: 0x000000018f4998c0 Foundation`-[_NSCallStackArray descriptionWithLocale:indent:] + 144 > Can someone describe how sleep-for works on macOS, i.e. what is > supposed to happen after ns_select_1 calls -[EmacsApp run], whatever > that is? It sounds like something in that machinery conflicts with > how Lisp threads are implemented. Note that this is a minimized reproducer. I first noticed the issue after I upgraded the GNU ELPA package debbugs, which recently got support for threads using `make-thread'. In that package, the function `debbugs-gnu-show-reports' in debbugs-gnu.el is called in a thread, and the backtrace is the same. See debbugs-gnu.el:897. I don't see `sleep-for' called directly there, but I didn't yet investigate it very closely. Maybe Michael (in Cc) knows more.