doom-modeline icon indicating copy to clipboard operation
doom-modeline copied to clipboard

[Bug] (display-time-mode) results in a WebKit process leak

Open ben-- opened this issue 9 months ago • 2 comments

Thank you for the bug report

  • [x] I am using the latest version of doom-modeline related packages.
  • [x] I checked FAQ.
  • [ ] You may also try reproduce the issue using clean environment and minimal configurations with the command emacs -Q.

Bug description

With a stock Doom configuration on macos, adding (display-time-mode) to my configuration causes emacs to spawn and leak WebKit processes about 1-2 times a minute. This causes hundreds of WebContext processes to be leaked, eventually causing "Severe Hangs" (MacOS Instruments.app terminology) in at least Emacs and Safari.

$ sudo log stream   --predicate 'subsystem == "com.apple.xpc" AND eventMessage CONTAINS "WebKit.WebContent"'   --info
2025-06-02 22:33:00.079625-0400 0x24b442   Default     0x0                  25888  0    Emacs: (libxpc.dylib) [com.apple.xpc:connection] [0x600001b7ca50] activating connection: mach=false listener=false peer=false name=com.apple.WebKit.WebContent
2025-06-02 22:34:00.015427-0400 0x24b442   Default     0x0                  25888  0    Emacs: (libxpc.dylib) [com.apple.xpc:connection] [0x600001b74d20] activating connection: mach=false listener=false peer=false name=com.apple.WebKit.WebContent
2025-06-02 22:34:00.076770-0400 0x24b442   Default     0x0                  25888  0    Emacs: (libxpc.dylib) [com.apple.xpc:connection] [0x600001b694a0] activating connection: mach=false listener=false peer=false name=com.apple.WebKit.WebContent
2025-06-02 22:35:00.016941-0400 0x24b442   Default     0x0                  25888  0    Emacs: (libxpc.dylib) [com.apple.xpc:connection] [0x600001b74e10] activating connection: mach=false listener=false peer=false name=com.apple.WebKit.WebContent
2025-06-02 22:35:00.082286-0400 0x24b442   Default     0x0                  25888  0    Emacs: (libxpc.dylib) [com.apple.xpc:connection] [0x600001b7cff0] activating connection: mach=false listener=false peer=false name=com.apple.WebKit.WebContent

Steps to reproduce

Given:

brew tap railwaycat/emacsmacport
brew install emacs-mac --with-native-compilation --with-modules
  • current doom emacs
GNU Emacs     v29.1            nil
Doom core     v3.0.0-pre       HEAD -> master 313e8fb4 2025-06-02 17:34:15 +0200
Doom modules  v25.07.0-pre     HEAD -> master 313e8fb4 2025-06-02 17:34:15 +0200

Configure:

  • start with stock doom config
  • add the following line to config.el
(display-time-mode)

Expected behavior

  • emacs runs as normal, no process leak

OS

MacOS

Emacs Version

29 (gccemacs)

Emacs Configurations

Doom Emacs

Error callstack


Anything else

No response

ben-- avatar Jun 03 '25 02:06 ben--

Isolated to doom-modeline by proving the problem goes away when (display-time-mode) remains in config.el, but modeline is commented out in init.el.

ben-- avatar Jun 03 '25 02:06 ben--

Can you try these solutions, please?

  1. Reproduce with emacs -Q
  2. (setq doom-modeline-time-live-icon nil)
  3. Test with official Emacs package

seagle0128 avatar Jun 05 '25 11:06 seagle0128