anthropics / anthropics/claude-code

Claude Code 2.1.243 segfaults on startup in __newlocale on glibc 2.44 (Bun/mimalloc build)

Offen
#89,536 1 Kommentar 0 Reaktionen 0 zugewiesene Personen Auf GitHub ansehen
area:core area:packaging bug duplicate has repro platform:linux regression
Vorherrschende Sprache
Python
Sterne
145k
Forks
23.1k
PR-Merge-Kennzahlen
PR-Kennzahlen ausstehend

Beschreibung

### 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?

Claude Code 2.1.243 crashes with SIGSEGV (SEGV_MAPERR) on every startup, before reading any input, on Arch Linux with glibc 2.44. Any invocation segfaults — `claude`, `claude --version`, `claude doctor`.

The crash is in glibc's `__newlocale` calling `free` into the bundled mimalloc allocator during process init (under pthread_once, under __libc_start_main). This started after the glibc 2.43 → 2.44 upgrade (2026-07-28).

Ruled out:
- Not the locale: `LC_ALL=C.UTF-8 claude --version` also segfaults; locale is C.UTF-8 throughout and valid.
- Not ELF symbol interposition: `nm -D` does not export `free`, so glibc can't resolve to mimalloc's `free` via the dynamic scope. The mimalloc override is applied at runtime, not via dynsym.

Reinstalling to 2.1.245 fixes it. Filing to document the affected range and confirm the fix intentionally covers the glibc-2.44 / mimalloc-init path.

### What Should Happen?

Claude Code should start normally on glibc 2.44 without crashing during locale initialization.

### Error Messages/Logs

```shell
Signal: 11 (SEGV) si_code: SEGV_MAPERR
Executable: ~/.local/share/claude/versions/2.1.243

Stack trace of thread 2722:
#0 0x0000000001d10458 free (2.1.243 + 0x1b10458) <- bundled mimalloc
#1 0x00007f...530a __newlocale (libc.so.6 + 0x3530a)
#2 0x0000000001abd282 n/a (2.1.243 + 0x18bd282)
#3 0x00007f...d69c n/a (libc.so.6 + 0x9d69c)
#4 0x00007f...d719 pthread_once (libc.so.6 + 0x9d719)
#16 0x00007f...7892 __libc_start_main (libc.so.6 + 0x27892)
#17 0x0000000001953a2e n/a (2.1.243 + 0x1753a2e)

# Diagnostics
$ nm -D .../2.1.243 | grep -E ' T (malloc|free|calloc|realloc)$'
(empty — allocator not exported dynamically)
$ nm .../2.1.243 | grep -E ' [Tt] free$'
0000000001d10430 T free (mimalloc, in .symtab)
$ ldd .../2.1.243
libc.so.6 => /usr/lib/libc.so.6
```

### Steps to Reproduce

1. Arch Linux with glibc 2.44 (upgraded from 2.43).
2. Install Claude Code 2.1.243 (Bun-compiled native binary).
3. Run `claude --version` (or any invocation).
4. Process crashes immediately: "Segmentation fault (core dumped)".

100% reproducible. `LC_ALL=C.UTF-8` does not help.

### Claude Model

None

### Is this a regression?

Yes, this worked in a previous version

### Last Working Version

unknown — no earlier build on disk to bisect

### Claude Code Version

2.1.245 (Claude Code)

### Platform

Anthropic API

### Operating System

Other Linux

### Terminal/Shell

Other

### Additional Information

- glibc: 2.44+r5+g7cba77790f32-1 (upgraded from 2.43 on 2026-07-28)
- Binary: ELF 64-bit, dynamically linked to libc.so.6, Bun-compiled with static mimalloc, not stripped.
- Likely cause: glibc 2.44 changed internal alloc/free behavior in __newlocale; the bundled mimalloc runtime intercepts that free and receives a pointer it never allocated → SEGV_MAPERR before init completes. Any build compiled/tested against glibc ≤ 2.43 appears affected; 2.1.245 resolves it.
- Workaround for other affected users: reinstall via `curl -fsSL https://claude.ai/install.sh | bash`.
- I can attach the full raw `coredumpctl info` and the .zst core on request.

Beitragsleitfaden

Für dieses Repository ist kein Beitragsleitfaden indexiert

Rechercherichtung

No source file or test is identified. Reproduce `claude --version` on Arch Linux with glibc 2.44, inspect the reported coredump and `nm`/`ldd` diagnostics, then compare versions 2.1.243 and 2.1.245; done means confirming the affected range and that startup succeeds through locale initialization.

Vom Indexierungsmodell aus dem Issue-Text verfasst.

Bewertung

Tech-Stack
bun, linux
Bereich
cli, operating-systems
Issue-Typ
Bug
Schwierigkeit
5/5
Geschätzter Aufwand
Über eine Woche
Aktivitätsstatus
Aktiv
Klarheit
Muss geklärt werden
Anfängerfreundlichkeit
25/100

Neue Issues direkt in Ihr Postfach

Eine kurze Übersicht über anfängerfreundliche GitHub-Issues.