bug(vm): per-sandbox Unix socket paths exceed macOS sun_path limit
まだ誰も着手していません。
評価
- 難易度
- 4/5
- 見積もり時間
- 3〜5日
- 初心者へのやさしさ
- 55/100
- issue の種類
- バグ
- 明瞭さ
- おおむね明確
- 活発さ
- 活発
- 技術スタック
- macos, rust
調査の方向性
まず、VM compute driver におけるサンドボックスごとのソケットパスの構築から始め、デフォルトの state_dir を使って macOS の bind 失敗を再現します。サンドボックスディレクトリがどのように作成および復元されるかを追跡し、その後、改訂後のパスが macOS の制限内に収まり、検出と永続化を維持し、run/compute-driver.sock が変更されないことを確認します。
索引モデルが issue の本文から書いたものです。
説明
User Story
As a developer running the VM compute driver on macOS, I want per-sandbox Unix socket paths to fit within the OS sun_path limit so that sandbox creation does not fail with a socket bind error.
Problem Statement
The VM driver constructs per-sandbox Unix socket paths by joining {state_dir}/sandboxes/{sandbox_id}/{socket_name}. Sandbox IDs are UUID v4 strings (36 chars), and state_dir depends on the user's home directory. On macOS, struct sockaddr_un.sun_path is 104 bytes (103 usable). With the default state_dir (~/.local/state/openshell/vm-driver), the resulting socket path reaches 107 bytes — 3 bytes over the limit — and bind() fails.
/Users/benoitf/.local/state/openshell/vm-driver/sandboxes/3eb2ad45-bead-4c2e-bd10-1a4a7f3a2721/control.sock
└─────────────────────────────────── 107 bytes ──────────────────────────────────────┘
Path length breakdown:
/Users/benoitf/.local/state/openshell/vm-driver (47)
/sandboxes/ (11)
3eb2ad45-bead-4c2e-bd10-1a4a7f3a2721 (36)
/control.sock (13)
total = 107 bytes
macOS limit = 104 bytes
over by 3 bytes
Impact / Why This Matters
When this happens, VM sandbox creation fails at the control socket bind step. The error surfaces as a low-level socket error, not as a clear path-length diagnostic.
The current workaround is to manually configure a short state_dir (e.g. /tmp/os-vm). or rename control.sock for ctl.sock for my case (as I reduced 3 extra chars)
This is non-obvious, fragile, and breaks persistence expectations. Any user whose home directory path is longer than /Users/benoitf (15 chars) would be even further over the limit.
Linux is less affected (108-byte limit) but not immune with deep state directories or longer usernames.
Acceptance Criteria
- Per-sandbox Unix socket paths fit within 103 usable bytes on macOS for any reasonable
state_dir - The fix does not break sandbox state directory layout or persistence/restore
- Existing sandbox directories remain discoverable (sandbox ID must still be recoverable from the filesystem)
- The gateway compute-driver socket path (
run/compute-driver.sock) remains unaffected
Reproduction Steps
- On macOS, start the gateway with
--compute-driver vmusing the defaultstate_dir(~/.local/state/openshell/vm-driver) - Run
openshell sandbox create --name test --from ubuntu:24.04 - Observe the sandbox creation fails at the control socket bind
Environment
- OpenShell: development build (current main branch)
- OS: macOS (Apple Silicon) —
sun_pathis 104 bytes - Runtime: VM compute driver (libkrun)
Logs
Error: bind() failed for /Users/benoitf/.local/state/openshell/vm-driver/sandboxes/3eb2ad45-bead-4c2e-bd10-1a4a7f3a2721/control.sock
- 主要言語
- Rust
- スター
- 8.7k
- フォーク
- 1.3k
- 平均マージ
- 2日 6時間
- マージ済み PR(30日)
- 236
コントリビューションガイド
はじめの一歩
- issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
- 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
- リポジトリをフォークし、ブランチを切って変更します。
- issue 番号を参照したプルリクエストを送ります。
NVIDIA/OpenShell のほかの issue
-
area:docs
難易度 1/5 1時間未満 初心者へのやさしさ 88/100
-
state:triage-needed
難易度 2/5 1〜3時間 初心者へのやさしさ 82/100
-
area:cli state:validated
難易度 2/5 1〜3時間 初心者へのやさしさ 72/100
-
state:triage-needed
難易度 1/5 1時間未満 初心者へのやさしさ 90/100
-
area:build spike state:review-ready state:stale
難易度 2/5 半日 初心者へのやさしさ 68/100
NVIDIA/OpenShell の issue をすべて見る
似ている issue
-
難易度 2/5 1〜3時間 初心者へのやさしさ 85/100
-
難易度 2/5 1〜3時間 初心者へのやさしさ 84/100
Eynzof/Hermes-CN-Desktop#610 ·
-
難易度 2/5 1〜3時間 初心者へのやさしさ 88/100
-
bug team:backend track:services-maintenance
難易度 2/5 1〜3時間 初心者へのやさしさ 78/100
cowprotocol/services#4950 ·
-
bug
難易度 2/5 1〜3時間 初心者へのやさしさ 68/100
gitbutlerapp/gitbutler#15998 · コメント 1 件 ·