anthropics / anthropics/claude-code
[BUG] v2.1.243 native binary segfaults on startup — NULL deref in free() called from __newlocale
- Ngôn ngữ chính
- Python
- Star
- 145k
- Fork
- 23.1k
- Chỉ số merge pull request
- Chỉ số pull request đang chờ
Mô tả
### Preflight Checklist
- [x] I have searched [existing issues](https://github.com/anthropics/claude-code/issues?q=is%3Aissue%20state%3Aopen%20label%3Abug) and this hasn't been reported yet
- [x] This is a single bug report (please file separate reports for different bugs)
- [x] I am using the latest version of Claude Code
### What's Wrong?
Environment
- OS: CachyOS (Arch-based), kernel 7.2.0-1-cachyos
- Arch: x86_64
- glibc: 2.44 (ldd (GNU libc) 2.44)
- Install method: native/standalone installer (~/.local/share/claude/versions/, curl install script)
- Locale: en_AU.UTF-8 — ruled out as the cause, see below
Summary
Every launch of v2.1.243 (fresh downloads via both the background auto-updater and a manual curl -fsSL https://claude.ai/install.sh | bash re-run) segfaults immediately, including the installer's own
internal "$binary_path" install step, so a clean install is impossible. v2.1.241, v2.1.240, and v2.1.239 all launch fine on the same machine.
Crash details
dmesg shows the identical crash on every invocation, same instruction pointer, different PIDs/cores:
claude[10989]: segfault at 0 ip 0000000001d10458 sp 00007ffccf885140 error 4 in 2.1.243[1b0f458,1953000+3b33000] likely on CPU 4 (core 24, socket 0)
error 4 = user-mode read fault at address 0 — a NULL pointer dereference, not a write/exec fault. Fully deterministic: same ip across 5+ separate crashes on different CPU cores.
Backtrace (via coredumpctl gdb claude)
Stack trace of thread 11965:
#0 0x0000000001d10458 free (2.1.243 + 0x1b10458)
#1 0x00007fc5f603a1ab __newlocale (libc.so.6 + 0x3a1ab)
#2 0x0000000001abd282 n/a (2.1.243 + 0x18bd282)
#3 0x00007fc5f60b2584 n/a (libc.so.6 + 0xb2584)
#4 0x00007fc5f60b26a9 pthread_once (libc.so.6 + 0xb26a9)
#5 0x0000000001abc2d2 n/a (2.1.243 + 0x18bc2d2)
#6 0x0000000001ace6cf n/a (2.1.243 + 0x18ce6cf)
#7 0x0000000001abdc0a n/a (2.1.243 + 0x18bdc0a)
#8 0x0000000001abe9c4 n/a (2.1.243 + 0x18be9c4)
#9 0x00007fc5f60b2584 n/a (libc.so.6 + 0xb2584)
#10 0x00007fc5f60b26a9 pthread_once (libc.so.6 + 0xb26a9)
#11 0x0000000001abea15 n/a (2.1.243 + 0x18bea15)
#12 0x0000000001abead7 n/a (2.1.243 + 0x18bead7)
#13 0x0000000001abb922 n/a (2.1.243 + 0x18bb922)
#14 0x0000000001abb724 n/a (2.1.243 + 0x18bb724)
#15 0x0000000001aadadd n/a (2.1.243 + 0x18adadd)
#16 0x00007fc5f6027e23 __libc_start_main (libc.so.6 + 0x27e23)
#17 0x0000000001953a2e n/a (2.1.243 + 0x1753a2e)
Notably, frame #0's free resolves to an address inside the app binary (2.1.243 + 0x1b10458), not inside libc.so.6, even though it's called from glibc's own __newlocale (libc.so.6 + 0x3a1ab). This looks
like the binary statically links a custom allocator (mimalloc or similar — the pthread_once-driven lazy-init pattern in frames #4–#15 is consistent with a Bun-built single executable) that globally
overrides the free symbol. When glibc's internal __newlocale frees memory it allocated through its own internal path, that call gets intercepted by the app's custom allocator instead of glibc's real
one, which has no valid metadata for a block it never allocated — hence the NULL deref.
Ruling out other causes
- Not a corrupted download: reproduced identically across the original auto-update, a deleted-and-redownloaded copy, and a second full curl | bash reinstall.
- Not architecture/library mismatch: file confirms valid x86_64 ELF; ldd resolves every shared library with no missing symbols.
- Not disk/memory exhaustion: 20Gi free RAM, 46Gi swap, 188G free disk at time of crash.
- Not locale-specific: reproduced identically with LC_ALL=C forced for the entire install pipeline (LC_ALL=C bash -c 'curl -fsSL https://claude.ai/install.sh | bash'), ruling out en_AU.UTF-8 as the
trigger. Given the crash is in glibc's locale-init path, the likely trigger is this machine's newer glibc (2.44) exposing an allocator-interposition edge case that older/more common glibc versions
don't hit.
Workaround in use
Symlinked ~/.local/bin/claude back to the working 2.1.241 binary and set DISABLE_AUTOUPDATER=1 in ~/.claude/settings.json to stop the updater from overwriting it with the broken build again.
### What Should Happen?
claude 2.1.243 should not fail installing nor fail to launch
### Error Messages/Logs
```shell
```
### Steps to Reproduce
Let claude auto-update or manual update via `curl -fsSL https://claude.ai/install.sh | bash`
### Claude Model
None
### Is this a regression?
Yes, this worked in a previous version
### Last Working Version
2.1.241
### Claude Code Version
2.1.241 (Claude Code)
### Platform
Anthropic API
### Operating System
Other Linux
### Terminal/Shell
Other
### Additional Information
Cachyos, GNOME Console 50.0
Hướng dẫn đóng góp
Chưa lập chỉ mục được hướng dẫn đóng góp cho kho mã nguồn này
Hướng nghiên cứu
Reproduce the failure using the native standalone installer (`curl ... | bash`) on CachyOS with glibc 2.44, then inspect the v2.1.243 startup path around `__newlocale` and the binary's overridden `free`; compare with v2.1.241. Done means the installer completes and v2.1.243 launches on the reported environment without the NULL dereference.
Do mô hình lập chỉ mục viết ra từ nội dung của issue.
Đánh giá
- Công nghệ
- linux
- 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
- Sôi nổi
- Độ rõ ràng
- Khá rõ ràng
- Mức phù hợp với người mới
- 35/100