anthropics / anthropics/claude-code

Claude Code 2.1.243 segfaults on startup — glibc 2.44 / Arch Linux (mimalloc/newlocale allocator conflict)

未关闭
#89,394 5 条评论 14 个 reaction 已指派 0 人 在 GitHub 查看
area:packaging duplicate has repro platform:linux regression
主要语言
Python
星标
145k
派生
23.1k
PR 合并指标
PR 指标待抓取

描述

## Claude Code 2.1.243 segfaults on startup (glibc 2.44 / bleeding-edge Arch Linux)

### Summary
The `claude` CLI binary for version **2.1.243** segfaults immediately on every invocation (`claude --version`, `claude install`), including during fresh installs via `curl -fsSL https://claude.ai/install.sh | bash`. Reproduced 5 times across independently downloaded copies of the binary (different timestamps, different temp paths), so this isn't a corrupted/truncated download.

Versions **2.1.238** and **2.1.239** run fine on the same machine, so this is specific to the 2.1.243 build, not a general system incompatibility.

### Environment
- OS: Arch Linux (rolling release)
- Kernel: `7.1.9-arch1-2` (`#1 SMP PREEMPT_DYNAMIC Fri, 21 Aug 2026`)
- glibc: **2.44** (`ldd (GNU libc) 2.44`)
- Arch: x86_64, CPU supports avx2/sse4_2
- Node: v22.18.0 (unrelated — `claude` ships as a standalone bundled/native binary, not a node script)
- Install method: native (`curl -fsSL https://claude.ai/install.sh | bash`)

### Steps to reproduce
1. On the environment above, run:
```
curl -fsSL https://claude.ai/install.sh | bash
```
2. The installer downloads the 2.1.243 binary and runs `"$binary_path" install`, which segfaults immediately (exit 139).
3. Alternatively, if 2.1.243 is already installed, simply running `claude --version` segfaults.

### Crash backtrace (via `coredumpctl`)
```
Signal: 11 (SEGV) si_code: SEGV_MAPERR
Command Line: claude-2.1.243-linux-x64 install

Stack trace of thread:
#0 free (claude-2.1.243-linux-x64 + 0x1b10458)
#1 __newlocale (libc.so.6 + 0x3530a)
#2 n/a (claude-2.1.243-linux-x64 + 0x18bd282)
#3 n/a (libc.so.6 + 0x9d7fc)
#4 pthread_once (libc.so.6 + 0x9d879)
#5 n/a (claude-2.1.243-linux-x64 + 0x18bc2d2)
#6 n/a (claude-2.1.243-linux-x64 + 0x18ce6cf)
#7 n/a (claude-2.1.243-linux-x64 + 0x18bdc0a)
#8 n/a (claude-2.1.243-linux-x64 + 0x18be9c4)
#9 n/a (libc.so.6 + 0x9d7fc)
#10 pthread_once (libc.so.6 + 0x9d879)
#11 n/a (claude-2.1.243-linux-x64 + 0x18bea15)
#12 n/a (claude-2.1.243-linux-x64 + 0x18bead7)
#13 n/a (claude-2.1.243-linux-x64 + 0x18bb922)
#14 n/a (claude-2.1.243-linux-x64 + 0x18bb724)
#15 n/a (claude-2.1.243-linux-x64 + 0x18adadd)
#16 __libc_start_main (libc.so.6 + 0x27892)
#17 n/a (claude-2.1.243-linux-x64 + 0x1753a2e)
```

### Suspected cause
The crash is a `free()` call made *from inside glibc's `__newlocale()`* (locale initialization, reached via `pthread_once`), landing in a `free` symbol that resolves to an address inside the `claude` binary itself rather than glibc's own allocator. This is consistent with the binary bundling/statically linking its own allocator (Claude Code is built with Bun, which bundles mimalloc and exports global `malloc`/`free`/`calloc`/`realloc` symbols that override the dynamic linker's normal resolution).

If glibc's `__newlocale()` internals changed in 2.44 (very recent — this is a rolling-release Arch box, likely ahead of whatever glibc the 2.1.243 build was tested against), an allocation made through one allocator could end up being freed through the bundled one, which wouldn't recognize the pointer, causing SEGV_MAPERR.

This smells like a Bun/glibc allocator-interposition compatibility issue rather than anything specific to Claude Code's own logic, but filing here since it's the shipped binary that's affected.

### Impact / workaround
- Every install/launch of 2.1.243 crashes — full outage of the CLI on this system class (bleeding-edge glibc).
- Workaround: pinned back to the previously-installed 2.1.239 binary (`~/.local/share/claude/versions/2.1.239`, still present locally) and set `"autoUpdates": false` in `~/.claude/settings.json` to avoid the updater re-fetching the broken build.

### Ask
- Please check whether 2.1.243's build pipeline changed Bun/runtime version or allocator config relative to 2.1.239/2.1.238.
- A glibc-2.44 compatibility fix (or reverting whatever changed) would unblock rolling-release Linux users on this build.

贡献指南

这个仓库没有索引到贡献指南

调研方向

Start by reproducing on the stated Arch Linux/glibc 2.44 environment with `claude --version` or the install command, and compare against versions 2.1.238 and 2.1.239. Read the coredump backtrace, especially the `free()` and `__newlocale()` frames, and investigate the issue’s suspected Bun/mimalloc allocator interaction. Done means 2.1.243 launches and installs successfully in the reported environment.

由索引模型根据 Issue 内容生成。

评估

技术栈
bun, linux
领域
cli, operating-systems
Issue 类型
缺陷
难度
4/5
预计耗时
3-5 天
活跃度
活跃
描述清晰度
基本清楚
新手友好度
35/100

把新 issue 发到你的邮箱

精选适合新手参与的 GitHub issue 摘要。