Skip to content

macOS Ventura: 应用启动崩溃,bootstrap_check_in Permission denied,窗口无法显示 #49

@zenbao

Description

@zenbao

问题描述

在 macOS Ventura 13.7.8(Intel MacBookPro14,3)上安装 v3.5.3 x64 版本后,应用启动即崩溃,窗口无法显示

错误日志

终端启动报错:

FATAL:mach_port_rendezvous.cc(410)] Check failed: kr == KERN_SUCCESS.
bootstrap_check_in com.anything.analyzer.MachPortRendezvousServer.<PID>: Permission denied (1100)

根因分析

  1. Release 构建未进行代码签名(code object is not signed at all
  2. electron-builder.yml 中配置了 hardenedRuntime: true
  3. 没有签名时,hardened runtime 的 entitlements(allow-jit 等)不会被 macOS 认可
  4. 导致 Mach 端口注册被系统拒绝,应用直接 SIGTRAP 崩溃

尝试过的修复

  • 右键 → 打开(Gatekeeper 绕过)— 无效
  • 移除 com.apple.quarantine 属性 — 无效
  • Ad-hoc 签名(codesign --force --deep --sign -)— 无效
  • Ad-hoc 签名 + --entitlements + --options=runtime — 需要用户自行操作,不友好

建议

请在 CI 构建流程中为 macOS 产物添加代码签名和公证(notarization),或者在 electron-builder.yml 中移除 hardenedRuntime: true

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions