claude-code icon indicating copy to clipboard operation
claude-code copied to clipboard

[BUG] Bash commands hang on Linux kernel 5.15.0 (unix_stream_data_wait)

Open tyluann opened this issue 1 month ago • 0 comments

Preflight Checklist

  • [x] I have searched existing issues 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?

Bash commands hang indefinitely on a server running Linux kernel 5.15.0. When Claude Code tries to execute any bash command (e.g., echo hello world), the spawned bash subprocess gets stuck in a sleeping state, waiting on unix_stream_data_wait. The command never completes and eventually times out with exit code 137.

The bash subprocess is waiting to receive data from a Unix socket, but the Claude main process never successfully sends the command.

What Should Happen?

Bash commands should execute normally and return output, just like on other servers with newer kernels (e.g., kernel 6.8.0).

Error Messages/Logs

Command timeout:
  Background command "Print hello world" failed with exit code 137.

  Bash process state:
  $ cat /proc/<bash_pid>/wchan
  unix_stream_data_wait

  $ cat /proc/<bash_pid>/status | grep State
  State:  S (sleeping)

  $ ls -la /proc/<bash_pid>/fd/
  0 -> 'socket:[458602073]'
  1 -> 'socket:[458602076]'
  2 -> 'socket:[458602078]'

  Process tree shows bash subprocess is spawned but stuck:
  claude(435831)─┬─bash(436488)    <-- stuck here
                 ├─{claude}(435832)
                 └─...

Steps to Reproduce

  1. SSH into a Linux server running kernel 5.15.0-139-generic
  2. Run claude
  3. Ask Claude to execute any bash command (e.g., "run echo hello world")
  4. Observe the command hangs and eventually times out

Claude Model

None

Is this a regression?

No, this never worked

Last Working Version

No response

Claude Code Version

2.0.76 (Claude Code)

Platform

Anthropic API

Operating System

Ubuntu/Debian Linux

Terminal/Shell

VS Code integrated terminal

Additional Information

Environment:

  • Claude Code version: 2.0.76
  • Node.js version: v20.19.6
  • OS: Ubuntu (kernel 5.15.0-139-generic)
  • AppArmor: unconfined
  • Seccomp: disabled

Working environment for comparison:

  • Same user, same Claude version, same Node version
  • Kernel: 6.8.0-85-generic (Ubuntu 24.04)
  • Works perfectly

Already tested (none resolved the issue):

  • Switched Node from v22 to v20
  • Disabled sandbox mode (--dangerously-skip-permissions)
  • Direct SSH connection (not VS Code terminal)
  • Cleared cache and temp files
  • Changed TMPDIR

tyluann avatar Dec 25 '25 01:12 tyluann