github / github/copilot-cli

CLI segfaults (SIGSEGV) on startup on Linux hosts with ASLR disabled (kernel.randomize_va_space=0)

Đang mở
#4,171 0 bình luận 0 reaction 0 người được giao Xem trên GitHub
area:installation area:platform-linux
Ngôn ngữ chính
Shell
Star
11.2k
Fork
1.9k
Merge trung bình
14 giờ 16 phút
Pull request đã merge (30 ngày)
6

Mô tả

## Description

On corporate Linux workstations (SLES 15 SP4, kernel 5.14.21, glibc 2.31, x86_64) where ASLR is disabled system-wide via `kernel.randomize_va_space = 0` (a common hardened-security baseline in some enterprise environments), the `copilot` binary crashes immediately with `SIGSEGV` on every invocation, including `copilot --version` and `copilot --help`. No output is produced at all before the crash.

The Node wrapper that launches the native binary reports:
```
GitHub Copilot native binary at .../node_modules/@github/copilot-linux-x64/copilot was terminated by signal SIGSEGV.
GitHub Copilot CLI: no platform package found. Reinstall with `npm install -g @github/copilot` to fetch the package for your platform.
```
This message is misleading — it suggests a missing/corrupt platform package, but the real cause is unrelated to installation integrity.

## Steps to Reproduce
1. On a Linux x86_64 host, disable ASLR: `sudo sysctl -w kernel.randomize_va_space=0`
2. Install/run `copilot --version` (or `--help`)
3. Observe immediate segfault (exit code 139), no output

## Diagnosis performed
- Confirmed with a completely fresh, checksum-validated download (rules out corrupted install)
- Reproduced on multiple different physical hosts sharing the same OS/security baseline (rules out single-machine hardware fault)
- Reproduced on both the current release (v1.0.71/v1.0.72) and a release from ~2.5 months earlier (v1.0.40) (rules out a recent regression)
- `ldd` on the binary shows all shared libraries resolve correctly (rules out missing-library issue)
- `strace` shows the process issuing a self-directed `tgkill(pid, pid, SIGSEGV)` very early during startup, consistent with a V8 sandbox/memory-reservation initialization failure that depends on ASLR being active
- `NODE_OPTIONS="--jitless"` and other V8 flags do not prevent the crash (crash happens before/independent of JIT)
- Re-enabling ASLR requires root (`sysctl -w kernel.randomize_va_space=2`); this is not something an unprivileged CLI user can work around

## Expected Behavior
Ideally the CLI would either:
1. Run correctly with ASLR disabled (e.g., build V8 without the sandbox feature, or handle the reservation failure gracefully), or
2. At minimum, detect this condition and print an accurate, actionable error message (e.g., "ASLR is disabled on this system; GitHub Copilot CLI's V8 runtime requires ASLR to be enabled") instead of the generic "no platform package found" message, which sends users down the wrong troubleshooting path (reinstalling, which does not help).

## Environment
- OS: SUSE Linux Enterprise Server 15 SP4
- Kernel: 5.14.21-150400.24.158-default
- glibc: 2.31
- Arch: x86_64 (Xeon W-3245, AVX-512 capable)
- CLI versions tested: v1.0.40, v1.0.71, v1.0.72
- `kernel.randomize_va_space`: 0 (disabled by corporate security policy)

## Additional context
This affects an entire fleet of shared corporate Linux workstations that use a common hardened security baseline with ASLR disabled, blocking all Copilot CLI usage on those machines. We're separately requesting our IT team re-enable ASLR, but filing this so the CLI can (a) fail with a clearer error message and (b) ideally be made resilient to this configuration, since disabling ASLR is a real (if debatable) practice in some hardened/regulated environments.

Hướng dẫn đóng góp

Mở hướng dẫn đóng góp

Hướng nghiên cứu

Bắt đầu với Node wrapper khởi chạy binary copilot native, sau đó tái hiện lỗi với kernel.randomize_va_space=0 bằng copilot --version hoặc --help. Sử dụng hành vi strace tgkill đã được báo cáo để điều tra lỗi xảy ra sớm trong quá trình khởi tạo V8. Được coi là hoàn tất khi CLI chạy được với ASLR bị vô hiệu hóa hoặc báo cáo một lỗi liên quan đến ASLR chính xác và có thể xử lý, thay vì thông báo gây hiểu lầm về gói nền tảng.

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

Đánh giá

Công nghệ
node.js
Lĩnh vực
cli, operating-systems
Loại issue
Lỗi
Độ khó
5/5
Thời gian dự kiến
Hơn một tuần
Mức độ hoạt động
Ít trao đổi
Độ rõ ràng
Khá rõ ràng
Mức phù hợp với người mới
35/100

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.