Intel Mac (x64) app hangs on launch, stuck in libffi in cua_driver_node_runtime.node
メンテナーはふだん 1 日以内に返信
まだ誰も着手していません。
評価
- 難易度
- 3/5
- 見積もり時間
- 1〜2日
- 初心者へのやさしさ
- 73/100
- issue の種類
- バグ
- 明瞭さ
- 明確に書かれている
- 活発さ
- 活発
- 技術スタック
- macos, typescript
- 領域
- desktop
調査の方向性
Start by reading build/entitlements.mac.plist and the macOS packaging and signing configuration that applies its entitlements. Reproduce the launch hang with the Intel x64 build and check whether the proposed entitlement fixes it; the report includes steps, a sample stack, and a successful ad-hoc re-signing test. Done when the Intel app launches and its window appears, with the chosen fix verified.
索引モデルが issue の本文から書いたものです。
説明
What happened
I downloaded the x64 build on my Intel Mac and opened it, expecting the app window to show up. It never does. The app just beachballs with the main process sitting at around 60% CPU. The server child does start and listens on 8799, but no window ever appears.
I sampled the main process to see what it was doing (stack is in the logs below). The main thread is stuck in libffi inside cua_driver_node_runtime.node, which gets loaded at startup.
My guess at what's going on: on x86_64, libffi needs writable + executable memory for its closures. The app has the hardened runtime on but only has com.apple.security.cs.allow-jit, and that only covers MAP_JIT mappings, which libffi doesn't use. So the mmap fails, the temp file fallback fails too, and it just keeps looping. That would also explain why arm64 is fine, since libffi uses static trampolines there.
Adding this to build/entitlements.mac.plist fixed it for me:
<key>com.apple.security.cs.allow-unsigned-executable-memory</key>
<true/>
To test it, I took the released x64 app, added that entitlement to its existing ones and ad-hoc re-signed it with the same hardened runtime options. After that it launched fine: the server came up, the window showed after about 17s, and ffi_closure_alloc no longer appeared when I sampled the main thread. If you'd rather not widen the entitlements, building libffi in the CUA runtime with static trampolines or MAP_JIT on x86_64 should also work. Happy to open a PR with the entitlement change if that's the approach you want.
Steps to reproduce
- Download
DuskBot-0.2.15-x64.zip(orDuskBot-intel.dmg) on an Intel Mac - Open it
- No window, app stops responding.
sample <pid>on the main process shows the stack below
Version
0.2.15 (x64)
Platform
macOS
Engine
No response
Logs or screenshots
macOS 15.7.9 (24G830), Intel MacBookPro16,1
Main thread, from `sample`:
ModuleWrap::Evaluate
napi trampoline (cua_driver_node_runtime.node)
uniffi_runtime_napi::call::call_ffi_function
uniffi_runtime_napi::callback::vtable::build_vtable_struct
uniffi_runtime_core::callback::Module::make_callback_trampoline
libffi::middle::Closure::try_new
ffi_closure_alloc
dlmalloc
dlmmap
mmap <- fails
open_temp_exec_file_dir
mkstemp / openat / fstatat <- keeps retrying forever
server.log (startup gets as far as forking the server, then nothing):
move to applications: moved, relaunching
startup HTTP cache cleared (no-persisted-version: unknown -> 0.2.15)
fork /Applications/Dusk Bot.app/Contents/Resources/server/desktop-entry.mjs port=8799
- 主要言語
- TypeScript
- スター
- 277
- フォーク
- 27
- 平均マージ
- 2時間 47分
- マージ済み PR(30日)
- 1
環境構築
このプロジェクトには開発コンテナ、Dockerfile、コントリビューションガイドがありません。まず README を読み、一般的な手順ははじめてのコントリビューションガイドを参照してください。
はじめの一歩
- issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
- 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
- リポジトリをフォークし、ブランチを切って変更します。
- issue 番号を参照したプルリクエストを送ります。
DuskBotAI/duskbot のほかの issue
-
難易度 2/5 1〜3時間 初心者へのやさしさ 72/100
メンテナーはふだん 1 日以内に返信
-
bug
難易度 2/5 1〜3時間 初心者へのやさしさ 63/100
メンテナーはふだん 1 日以内に返信
-
After uninstalling an own server, the desktop app stays on it and shows Cloudflare's Error 1033 pageオープン
難易度 3/5 1〜2日 初心者へのやさしさ 65/100
メンテナーはふだん 1 日以内に返信
-
install.sh --tailscale replaces whatever the host already serves on tailnet port 443対応中かも @viniciusbregoli が今日担当しました。 オープン
難易度 4/5 3〜5日 初心者へのやさしさ 25/100
メンテナーはふだん 1 日以内に返信
-
難易度 4/5 3〜5日 初心者へのやさしさ 48/100
メンテナーはふだん 1 日以内に返信
DuskBotAI/duskbot の issue をすべて見る
似ている issue
-
難易度 2/5 1〜3時間 初心者へのやさしさ 78/100
vercel-labs/ui#865 ·
メンテナーはふだん 1 日以内に返信
-
bug
難易度 2/5 1〜3時間 初心者へのやさしさ 63/100
outline/outline#14638 · コメント 1 件 ·
メンテナーはふだん 1 日以内に返信
-
wayfinder:grilling
難易度 2/5 1〜3時間 初心者へのやさしさ 72/100
patricktree/cup#484 ·
-
bot:ai-assisted component:platform-js status:untriaged
難易度 2/5 1〜3時間 初心者へのやさしさ 78/100
midnightntwrk/platform-js#69 ·
メンテナーはふだん 1 日以内に返信
-
bug
難易度 2/5 1〜3時間 初心者へのやさしさ 67/100
メンテナーはふだん 1 日以内に返信