Subject: bug#69561: 30.0.50; Freeze from M-x gnus on macOS

From: Gerd Möllmann <[email-masked]>
Date: Tue, 05 Mar 2024 11:59:59 +0100

I experienced another complete Emacs freeze today on macOS, this time
from M-x gnus.

This doesn't always happen, most of the time Gnus works just fine. It's
maybe also significant that I see freezes without using Gnus. I have not
found a recipe to reproduce the freezes at will.

Interrupting the process in LLDB shows

(lldb) xbacktrace
(unsigned char *) data = 0x00000001002a5cbd "accept-process-output"
(unsigned char *) data = 0x00007fccffcd8490 "epg-wait-for-status"
(unsigned char *) data = 0x00007fcd0129fb20 "epg-start-decrypt"
(unsigned char *) data = 0x00007fcd0129fc10 "epg-decrypt-file"
(unsigned char *) data = 0x00007fcd013b2a08 "epa-file-insert-file-contents"
(unsigned char *) data = 0x000000010029eb79 "apply"
(unsigned char *) data = 0x0000000175c52557 "epa-file-handler"
(unsigned char *) data = 0x000000010029b6e3 "insert-file-contents"
(unsigned char *) data = 0x00007fccff9dd398 "auth-source-netrc-parse"
(unsigned char *) data = 0x00007fccff9dcbe8 "auth-source-netrc-search"
(unsigned char *) data = 0x000000010029eb79 "apply"
(unsigned char *) data = 0x00007fccff9dd020 "auth-source-search-backends"
(unsigned char *) data = 0x00007fccff9dce48 "auth-source-search"
(unsigned char *) data = 0x00007fccffdf1138 "nntp-send-authinfo"
(unsigned char *) data = 0x00007fcd0180f9a8 "nntp-open-connection"
(unsigned char *) data = 0x00007fcd0180fc78 "nntp-open-server"
(unsigned char *) data = 0x00007fcd012ba800 "gnus-open-server"
(unsigned char *) data = 0x00007fcd012cd1c8 "gnus-start-news-server"
(unsigned char *) data = 0x00007fccffcca8c8 "gnus-1"
(unsigned char *) data = 0x0000000175c5d840 "gnus"
(unsigned char *) data = 0x000000010029e589 "funcall-interactively"
(unsigned char *) data = 0x000000010029e576 "call-interactively"
(unsigned char *) data = 0x00000001002a1a0f "command-execute"
(unsigned char *) data = 0x0000000175c74bc7 "execute-extended-command"
(unsigned char *) data = 0x000000010029e589 "funcall-interactively"
(unsigned char *) data = 0x000000010029e576 "call-interactively"
(unsigned char *) data = 0x00000001002a1a0f "command-execute"

It apparently doesn't come out of the accept-process-output, although
epg-wait-for-status specifies a timeout of 1 second.

On the C side, backtraces always show wait_reading_process_output on the
stack. This is AFAICT also the case in other freezes without using Gnus.

In GNU Emacs 30.0.50 (build 3, x86_64-apple-darwin23.3.0, NS
 appkit-2487.40 Version 14.3.1 (Build 23D60)) of 2024-03-05 built on
 Pro.fritz.box
Repository revision: 218748c26287ae865229fe8a3c520facfa12fede
Repository branch: master
Windowing system distributor 'Apple', version 10.3.2487
System Description:  macOS 14.3.1