Vivaldi (Chromium-based browsers) freeze on macOS 26 Tahoe due to IMKInputSession deadlock triggered by input source switching

Đang mở
#92 0 bình luận 0 reaction 0 người được giao Xem trên GitHub

Chưa có ai nhận issue này.

Đánh giá

Độ khó
4/5
Thời gian dự kiến
3-5 ngày
Mức phù hợp với người mới
30/100
Loại issue
Lỗi
Độ rõ ràng
Cần làm rõ
Mức độ hoạt động
Đình trệ
Công nghệ
macos, swift
Lĩnh vực
desktop

Hướng nghiên cứu

Start from where Input Source Pro calls TISSelectInputSource when an app gains focus (the focus-observation/switching code in the Swift app), since that call is what triggers IMKInputSession activate inside Vivaldi. Investigate whether the switch can be deferred, throttled, or performed off the target app's activation path so Chromium's firstRectForCharacterRange query cannot race it. Done means a documented mitigation that avoids the XPC deadlock on macOS Tahoe, verifiable by reproducing the Cmd+T navigation freeze with the fix applied. The issue has no comments, no linked PR, and is 194 days old, so confirm maintainers still want it handled before investing.

Do mô hình lập chỉ mục viết ra từ nội dung của issue.

Mô tả

Steps to Reproduce
  1. Have Input Source Pro configured to automatically switch input source when focusing Vivaldi (e.g., switch to Chinese input when Vivaldi becomes active)
  2. Open Vivaldi
  3. Open a new tab (Cmd+T)
  4. Type a URL in the address bar (e.g., claude.ai or google.com) and press Enter
  5. Observe the browser becoming completely unresponsive for 15–30 seconds before recovering

The freeze is reliably reproducible on new tab navigation and hit-or-miss on subsequent navigations within the same tab.


Expected Behavior

Input Source Pro switches the input method when Vivaldi gains focus without causing any freeze or unresponsiveness in the browser.


Actual Behavior

Vivaldi's main thread deadlocks for 15–30 seconds. The browser is completely unresponsive — no scrolling, clicking, or typing possible. It eventually recovers on its own. Quitting Input Source Pro completely eliminates the freeze.

A spindump captured during the freeze shows Vivaldi's main thread (CrBrowserMain) blocked in IMKInputSession_Modern activate → invocationAwaitXPCReply → HIRunLoopSemaphore wait → psynch_cvwait, while simultaneously Chromium's text input bridge is blocked in firstRectForCharacterRange → psynch_cvwait — a classic XPC deadlock between the IME activation triggered by Input Source Pro and Chromium's concurrent cursor position query.

Relevant portion of spindump stack trace:

Thread 0x4b4df7  DispatchQueue "com.apple.main-thread"  CrBrowserMain  1934 samples

-[NSTextInputContext handleTSMEvent:completionHandler:]
  → TUIRectForCharacterRange
    → -[NSTextInputContext firstRectForCharacterRange:completionHandler:]
      → ChromeMain → psynch_cvwait   ← BLOCKED

CallMyActivateTSMDocument
  → IMKInputSession_Modern activate
    → IMKInputSessionXPCInvocation_Modern invocationAwaitXPCReply
      → HIRunLoopSemaphore wait
        → __CONSIDER_WHO_REQUESTED_THIS_WAIT_BEFORE_SENDING_BUG_TO_HISERVICES__
          → psynch_cvwait   ← BLOCKED

Both call chains are blocked simultaneously waiting on each other, causing a full deadlock.

After quitting Input Source Pro and capturing a second spindump under identical conditions, the main thread shows a completely healthy idle state (mach_msg2_trap in normal event loop wait) with no IMKInputSession activity and no freeze.


Environment
Field Value
Input Source Pro Version 2.9.0 (605)
macOS Version macOS 26.3.1 (Build 25D771280a) — Tahoe beta
Affected Application Vivaldi 7.9.3970.45 (Chromium-based). Likely affects all Chromium-based browsers (Chrome, Edge, Arc, etc.) as the root cause is in Chromium's NSTextInputContext bridge, not Vivaldi specifically
Relevant Input Sources U.S. English + Chinese Simplified (Pinyin) — Input Source Pro configured to switch to Chinese when Vivaldi is focused

Additional Context

The root cause appears to be a race condition introduced or worsened in macOS Tahoe's TextInputUIMacHelper framework. When Input Source Pro calls TISSelectInputSource on app focus, it triggers IMKInputSession activate on Vivaldi's main thread. Simultaneously, Chromium's text input bridge attempts to call firstRectForCharacterRange to query cursor position from the same IME session. Both calls block on XPC waiting for the other to complete, resulting in a deadlock.

The issue does not affect:

  • Safari — uses native AppKit/WebKit text input and handles IME activation differently
  • Firefox-based browsers (e.g., Zen) — use a completely different text input stack
Ngôn ngữ chính
Swift
Star
3.6k
Fork
144
Merge trung bình
4 giờ 16 phút
Pull request đã merge (30 ngày)
3

Chuẩn bị môi trường

Dự án này không cung cấp dev container, Dockerfile hay hướng dẫn đóng góp, nên bạn cần tự thiết lập môi trường: hãy bắt đầu từ README và xem hướng dẫn đóng góp lần đầu của chúng tôi để biết các bước chung.

Bắt đầu từ đâu

  1. Đọc hết issue, rồi đọc hướng dẫn đóng góp của dự án.
  2. Bình luận trên issue rằng bạn sẽ nhận — tránh hai người làm cùng một việc.
  3. Fork repository và làm thay đổi trên một nhánh.
  4. Mở pull request có tham chiếu số hiệu của issue.

Issue khác của runjuu/InputSourcePro

Tất cả issue của runjuu/InputSourcePro

Issue tương tự

Thêm issue về Swift

Nhận issue mới trong hộp thư của bạn

Bản tóm tắt ngắn những issue GitHub phù hợp với người mới.