anthropics / anthropics/claude-code

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

Ouverte
#89,536 1 commentaire 0 réactions 0 personnes assignées Voir sur GitHub
area:core area:packaging bug duplicate has repro platform:linux regression
Langage dominant
Python
Étoiles
145k
Forks
23.1k
Métriques de merge des PR
Métriques de PR en attente

Description

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

Guide de contribution

Aucun guide de contribution indexé pour ce dépôt

Piste de recherche

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.

Rédigé par le modèle d'indexation à partir du texte de l'issue.

Évaluation

Stack technique
bun, linux
Domaine
cli, operating-systems
Type d'issue
Bug
Difficulté
5/5
Temps estimé
Plus d'une semaine
Activité
Active
Clarté
À clarifier
Accessibilité débutants
25/100

Recevez les nouvelles issues par e-mail

Un résumé court des issues GitHub adaptées aux débutants.