anthropics / anthropics/claude-code

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

Open
#89,536 1 comment 0 reactions 0 assignees View on GitHub
area:core area:packaging bug duplicate has repro platform:linux regression
Dominant language
Python
Stars
145k
Forks
23.1k
PR merge metrics
PR metrics pending

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.

Contributor guide

No contributing guide indexed for this repository

Research direction

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.

Written by the indexing model from the issue text.

Assessment

Tech stack
bun, linux
Domain
cli, operating-systems
Issue type
Bug
Difficulty
5/5
Estimated time
Over a week
Activity status
Active
Clarity
Needs clarification
Newbie friendliness
25/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.