From: Stefan Kangas <stefankangas@gmail.com>
To: "Eli Zaretskii" <eliz@gnu.org>, "Alan Third" <alan@idiocy.org>,
"Gerd Möllmann" <gerd.moellmann@gmail.com>
Cc: 75275@debbugs.gnu.org, Michael Albinus <michael.albinus@gmx.de>
Subject: bug#75275: 30.0.92; `make-thread` bug on macOS 15.2
Date: Thu, 2 Jan 2025 01:31:39 -0600 [thread overview]
Message-ID: <CADwFkmmf8sC99qZHHiP9Gm+8GRAu-mLRmQghU0gUuVnj_e80qQ@mail.gmail.com> (raw)
In-Reply-To: <86bjwplmc1.fsf@gnu.org>
Eli Zaretskii <eliz@gnu.org> 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.
next prev parent reply other threads:[~2025-01-02 7:31 UTC|newest]
Thread overview: 45+ messages / expand[flat|nested] mbox.gz Atom feed top
2025-01-02 4:57 bug#75275: 30.0.92; `make-thread` bug on macOS 15.2 Stefan Kangas
2025-01-02 5:46 ` Gerd Möllmann
2025-01-02 5:55 ` Gerd Möllmann
2025-01-02 6:47 ` Stefan Kangas
2025-01-02 7:12 ` Gerd Möllmann
2025-01-02 14:35 ` Stefan Kangas
2025-01-02 14:38 ` Gerd Möllmann
2025-01-02 14:45 ` Gerd Möllmann
2025-01-02 15:19 ` Stefan Kangas
2025-01-02 16:06 ` Alan Third
2025-01-02 16:47 ` Alan Third
2025-01-02 16:58 ` Eli Zaretskii
2025-01-02 17:09 ` Gerd Möllmann
2025-01-02 17:22 ` Eli Zaretskii
2025-01-02 17:25 ` Gerd Möllmann
2025-01-02 17:42 ` Alan Third
2025-01-02 17:48 ` Gerd Möllmann
2025-01-02 17:37 ` Alan Third
2025-01-02 17:46 ` Gerd Möllmann
2025-01-02 17:52 ` Gerd Möllmann
2025-01-02 19:26 ` Alan Third
2025-01-02 19:59 ` Gerd Möllmann
2025-01-02 16:46 ` Eli Zaretskii
2025-01-02 7:53 ` Eli Zaretskii
2025-01-02 7:58 ` Stefan Kangas
2025-01-02 7:13 ` Eli Zaretskii
2025-01-02 7:30 ` Gerd Möllmann
2025-01-02 8:28 ` Eli Zaretskii
2025-01-02 8:33 ` Gerd Möllmann
2025-01-02 8:41 ` Gerd Möllmann
2025-01-02 8:55 ` Eli Zaretskii
2025-01-02 10:04 ` Gerd Möllmann
2025-01-02 11:03 ` Alan Third
2025-01-02 13:05 ` Gerd Möllmann
2025-01-02 13:53 ` Alan Third
2025-01-02 14:03 ` Gerd Möllmann
2025-01-02 14:17 ` Alan Third
2025-01-02 15:31 ` Eli Zaretskii
2025-01-02 15:37 ` Gerd Möllmann
2025-01-02 15:55 ` Alan Third
2025-01-02 16:08 ` Gerd Möllmann
2025-01-02 8:51 ` Gerd Möllmann
2025-01-02 7:31 ` Stefan Kangas [this message]
2025-01-02 8:31 ` Eli Zaretskii
2025-01-02 10:31 ` Michael Albinus via Bug reports for GNU Emacs, the Swiss army knife of text editors
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
List information: https://www.gnu.org/software/emacs/
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=CADwFkmmf8sC99qZHHiP9Gm+8GRAu-mLRmQghU0gUuVnj_e80qQ@mail.gmail.com \
--to=stefankangas@gmail.com \
--cc=75275@debbugs.gnu.org \
--cc=alan@idiocy.org \
--cc=eliz@gnu.org \
--cc=gerd.moellmann@gmail.com \
--cc=michael.albinus@gmx.de \
/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 public inbox
https://git.savannah.gnu.org/cgit/emacs.git
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).