Deterministic SIGSEGV on claude CLI startup (free/__newlocale/pthread_once)
Claude Code CLI: deterministic SIGSEGV on process startup
Summary
Every fresh invocation of the claude binary segfaults during startup, before
producing any output — including claude --version. Reproduced 100% of the
time (3/3 just now, plus ~20 crashes over a prior ~10-minute window). A
long-running interactive session that has already gotten past whatever
initializes on startup keeps working fine; it's new process launches that die.
Environment
- OS: Arch Linux (rolling), kernel
7.1.8-arch1-3 - Two affected installs, same crash signature on both:
- App-installed:
/home/losera/.local/share/claude/versions/2.1.243 - npm/mise-installed:
/home/losera/.local/share/mise/installs/node/22.23.2/lib/node_modules/@anthropic-ai/claude-code/bin/claude.exe
Reproduction
$ claude --version
Segmentation fault (core dumped)
No arguments needed. Also reliably triggered by the CLI's own shell integration:
the injected grep/find shell functions shell out to claude (asARGV0=ugrep/ARGV0=bfs) to provide fast search — every such invocation
crashed too, until routed around via command grep/command find.
Crash signature (from coredumpctl, identical across every occurrence)
Signal: 11 (SEGV) si_code: SEGV_MAPERR
Stack trace:
#0 free
#1 __newlocale (libc.so.6)
#2 n/a (claude.exe)
#3 n/a (libc.so.6)
#4 pthread_once (libc.so.6)
#5-8 n/a (claude.exe)
#9 n/a (libc.so.6)
#10 pthread_once (libc.so.6)
#11-15 n/a (claude.exe)
#16 __libc_start_main (libc.so.6)
#17 n/a (claude.exe)
Pattern: a pthread_once-guarded one-time initializer (__newlocale) callingfree(), crashing with SEGV_MAPERR (invalid address, not just a null
deref). Reads like a race or reentrancy bug in one-time locale
initialization — consistent with why a process that's already past init
(this interactive session) keeps running, while every new process launch
(--version, or the grep/find subprocess spawns) dies before doing anything
else.
Timeline
- 19:57:55–20:02:22 EDT — 7 crashes of the top-level
claudeprocess
(version 2.1.243), one apparently mid-interactive-session in a tmux pane.
- 20:05:19–20:08:06 EDT — crashes shift to the mise-installed
claude.exe, including via the grep/find shell-integration subprocess path.
- 20:29:26 EDT (just now) — reconfirmed live: 3/3 fresh
claude --version
invocations crash identically.
Impact
- Kills interactive sessions outright when hit mid-session.
- Breaks the CLI's own
grep/findshell integration on every call. claude --versioncannot even report a version right now on this machine.
Ruled out
- Locale env is standard, not something exotic:
LANG=en_US.UTF-8, all
LC_* inherit from it, LC_ALL unset. Not an obvious misconfiguration on
this end, despite the crash being inside __newlocale.
Not yet determined
- Root cause inside
claude.exe(frames aren/a— no symbols available
locally; raw core files are retained under
/var/lib/systemd/coredump/core.claude* if useful).
- Whether it's specific to this machine's locale/glibc configuration, or
reproducible more broadly.
7 Comments
I believe I'm hitting the same issue, after the most recent update today. Arch Linux x86-64 machine.
Same issue here, same machine.
Update: pinpointed this to a specific bad release, and found a working workaround.
Root cause of the crash storm (not just a flaky repro):
~/.local/share/claude/versions/2.1.243was auto-installed today at the exact moment the segfault storm began. Directly invoking the two previous cached versions on the same machine, same environment, is 100% clean:Same machine, same locale, same everything — only the binary differs. This strongly suggests
2.1.243itself introduced the regression rather than anything environment-specific.Workaround: repoint whichever
claudesymlink wins in yourPATHat the last known-good cached version, e.g.:Note there can be two independent launch paths that both need fixing if you have both the app-installer and an npm/mise install — in my case
~/.local/share/mise/installs/node/22/bin/claude(symlinked into@anthropic-ai/claude-code's ownbin/claude.exe) was also pinned to the same broken2.1.243and took priority inPATHover the app-installed one.Hope this narrows it down quickly — happy to pull anything else off this machine (both
2.1.243binaries and their npm package are still present locally).I can confirm this fix worked for me, so additional evidence that version .243 broke in some way
ln -sfn ~/.local/share/claude/versions/2.1.241 ~/.local/bin/claude # i did this too, but once 2.1.244 is out i will disable this symbolic link
#89371
Confirming reproduction on another distro with the same exact crash address as the OP's gdb trace (
0x1d10458infree), same call chain (free <- __newlocale <- pthread_once):Environment:
claude-code 2.1.241-1fromextra, not AUR)7.1.9-arch1-22.44uname -m:x86_64Reproduced via two independent distribution channels, both segfaulting identically:
install.sh(downloads nativelinux-x64binary) →claude-2.1.243-linux-x64 installsegfaults immediately.npm install -g @anthropic-ai/claude-code(2.1.243) →claude.exesegfaults on invocation.coredumpctlbacktrace (10 crashes collected across both channels, all identical):si_code:
SEGV_MAPERR, signal 11.Workaround: staying on
2.1.241(still installable via the AUR/native package) does not exhibit this crash — matches other reports that2.1.242/2.1.243introduced the regression.This matches the root cause already identified in #89389 (interposed mimalloc
freelacking a NULL check, hit by glibc 2.44'snewlocalepre-main init) — adding this as another confirmed data point on Arch specifically, in case distro/glibc-version breadth is useful for prioritization.