tailscale icon indicating copy to clipboard operation
tailscale copied to clipboard

macOS: menu bar app CPU spinning on a combine sink

Open elrazez opened this issue 3 weeks ago • 2 comments

What is the issue?

The menu bar app (/Applications/Tailscale.app/Contents/MacOS/Tailscale) sits at ~97% CPU with no window open. The network extension stays near 0% and the tailnet works fine (peers are direct). WindowServer and WindowManager go up with it, so the laptop gets hot.

A 3-second sample of the GUI process shows the main thread stuck in a Combine sink that keeps setting the window frame and re-running layout:

_dispatch_main_queue_drain
 closure #1 in Publishers.ReceiveOn.Inner.receive(_:)   (Combine)
  Subscribers.Sink.receive(_:)                          (Combine)
   ??? (in Tailscale) load address 0x100af0000 + 0x2309e8
    ??? (in Tailscale) load address 0x100af0000 + 0x230c2c
     -[NSWindow _setFrameCommon:display:fromServer:]
      -[NSWindow _oldPlaceWindow:fromServer:]
       -[NSWindow(NSConstraintBasedLayoutInternal) _layoutViewTree]
        -[NSView layoutSubtreeIfNeeded]
         ... (recursive _layoutSubtreeWithOldSize)

446 of 569 main-thread samples are under that sink, 317 of them in _setFrameCommon. Offsets are from 1.104.5 (long version below).

While it loops, ~/Library/Preferences/io.tailscale.ipn.macsys.plist keeps getting rewritten, but MainWindowFrame stays the same ([[290,268],[890,566]]). My guess is that saving or restoring the frame re-triggers the publisher that sets it.

Workaround, which has worked both times:

osascript -e 'quit app "Tailscale"'
defaults delete io.tailscale.ipn.macsys MainWindowFrame
open -a Tailscale

After that the GUI is back to 0% CPU.

Expected: an idle menu bar app should sit near 0% CPU.

Steps to reproduce

I can't trigger it on demand. I've seen it twice:

  • 2026-10-18 on 1.104.1
  • 2026-11-07 on 1.104.5

Both times it was already looping when I noticed the heat, about 4 hours after login, and I hadn't opened the main window. This time only the built-in display was connected (2560x1664).

Are there any recent changes that introduced the issue?

Nothing specific that I know of. Updating from 1.104.1 to 1.104.5 did not fix it.

OS

No response

OS version

macOS 27.2 (26B123), Mac15,12 (MacBook Air M3)

Tailscale version

1.104.5 standalone (io.tailscale.ipn.macsys), long version 1.104.5-t788384763-gd9218e278

Other software

Mullvad VPN 2026.5 (connected), Malwarebytes (real-time protection), LuLu firewall

Bug report

BUG-8ebf504b634c18a95425318e803ec68f8fe607395cc3bb28f186ee941141ba4d-20261107173119Z-ab6bc0391602e2a7

elrazez avatar Nov 07 '26 17:11 elrazez

@elrazez I looked into this and I suspect it may be related to our settings window's dynamic content sizing. Do you happen to remember opening the settings window when this last occurred?

willh-ts avatar Nov 09 '26 18:11 willh-ts

@willh-ts Hi there. i think i did open the settings window but i am not 100% sure.

elrazez avatar Nov 21 '26 02:11 elrazez