Skip to content

[BUG] Claude Code crashes with SIGABRT during shutdown due to MCP server termination failure #7718

Closed as not planned

Description

@jgspratt

Preflight Checklist

  • I have searched existing issues and this hasn't been reported yet
  • This is a single bug report (please file separate reports for different bugs)
  • I am using the latest version of Claude Code

What's Wrong?

Claude Code crashes with SIGABRT during shutdown when attempting to terminate MCP (Model Context Protocol) servers. The crash occurs during the cleanup phase when the application cannot properly shut down connected MCP servers, leading to a Node.js assertion failure during stdio cleanup.

What Should Happen?

Claude Code should exit cleanly after properly terminating all MCP server processes and cleaning up resources.

Error Messages/Logs

SIGINT failed, sending SIGTERM to MCP server process
  Error sending SIGTERM:
  SIGTERM failed, sending SIGKILL to MCP server process
  Error sending SIGKILL:
  Error terminating process:
  Error closing client:
  Cleanup timeout reached, stopping process monitoring

  Process terminates with SIGABRT and generates core dump (261MB core file).

Steps to Reproduce

  1. Start Claude Code with MCP servers configured
  2. Use Claude Code normally (any operations)
  3. Exit Claude Code (Ctrl+C, quit command, or other exit method)
  4. Application crashes during shutdown process with core dump

Claude Model

Sonnet (default)

Is this a regression?

I don't know

Last Working Version

No response

Claude Code Version

1.0.113

Platform

Anthropic API

Operating System

Ubuntu/Debian Linux

Terminal/Shell

VS Code integrated terminal

Additional Information

Stack trace analysis:

  • Crash point: node::ResetStdio() during exit cleanup
  • Signal: SIGABRT (assertion failure)
  • Root cause: MCP servers failed to terminate (SIGINT → SIGTERM → SIGKILL all failed)
  • Node.js cleanup assertion failed when trying to reset stdio during exit

Technical details:

  • Executable: /usr/bin/node (Claude Code)
  • Core dump shows uncaught exception during shutdown sequence
  • MCP server termination timeout reached before clean exit

Activity

  1. navvye commented on Oct 13, 2025

    @navvye

    Facing the same error

  2. kasnet commented on Oct 14, 2025

    @kasnet

    The same error

  3. jgspratt commented on Oct 15, 2025

    @jgspratt
    Author

    Claude Code Crash Report

    Summary

    Claude Code crashed with SIGABRT during error cleanup. This appears to be a Node.js core bug where node::ResetStdio() fires an assertion during legitimate error scenarios.

    Environment

    • Claude Code CLI: @anthropic-ai/claude-code
    • Node.js: v20.19.5
    • Platform: Linux x86_64
    • Signal: SIGABRT (Aborted)

    Root Cause

    1. Write error (EIO) → stream closed during active output
    2. Uncaught exception handler triggered exit
    3. Exit cleanup called node::ResetStdio()
    4. Assertion failed → SIGABRT
    

    Stack Trace (gdb analysis)

    Thread 1 (crashed):
    #5  node::Assert(node::AssertionInfo const&)
    #6  node::ResetStdio() [clone .part.0]        ← ASSERTION FAILED
    #7  node::TrapWebAssemblyOrContinue(...)
    ...
    #16 __run_exit_handlers()                      ← During exit cleanup
    #17 __GI_exit()
    #18 node::DefaultProcessExitHandlerInternal()
    #19 node::Environment::Exit()
    #20 node::errors::TriggerUncaughtException()   ← Original error handler
    ...
    #30 node::ReportWritesToJSStreamListener::OnStreamAfterReqFinished()
    #31 node::WriteWrap::OnDone(int)               ← Original write error (EIO)

    The assertion fired twice - once during exit, then again while trying to dump the first assertion failure.

    Reproduction

    • Terminal/stream closed while Claude Code was streaming output
    • High volume of data being written at time of disconnect
    • Race condition between output generation and stream closure

    Expected Behavior

    Node.js should handle stream closure gracefully during exit, not trigger assertions. Write errors (EIO, EPIPE) are normal when terminals disconnect.

    Actual Behavior

    Process aborted with SIGABRT and 317MB core dump.

    Suggested Fix

    Add defensive checks before stream writes:

    if (stream.writable && !stream.destroyed) {
      stream.write(data);
    }

    This prevents the EIO error that triggers the problematic exit path.

    Note

    This may be more appropriate as a Node.js issue rather than Claude Code, since the assertion is in Node.js core code. However, Claude Code could work around it with the defensive checks above.

  4. MarkDeVerno commented on Dec 3, 2025

    @MarkDeVerno

    We’ve reproduced this with setting_sources enabled; see detailed analysis in #1935. Also relates to cancel scope bug in #8999

  5. github-actions commented on Jan 4, 2026

    @github-actions

    This issue has been inactive for 30 days. If the issue is still occurring, please comment to let us know. Otherwise, this issue will be automatically closed in 30 days for housekeeping purposes.

  6. loneranger98 commented on Jan 22, 2026

    @loneranger98

    2026-01-22 15:21:14.434 [info] From claude: ============================================================
    Bun v1.3.6 (d530ed99) Linux x64 (baseline)
    Linux Kernel v6.1.25 | glibc v2.35
    CPU: sse42 popcnt
    Args: "/home/ashu/.vscode/extensions/anthropic.claude-code-2.1.15-linux-x64/resources/native-binary/claude" "--output-format" "stream-json" "--verbose" "--input-format" "stream-json" "--max-thinking-tokens" "31999" "--model" "defa"...
    Features: Bun.stderr(2) Bun.stdin(2) Bun.stdout(2) fetch(47) jsc no_avx2 no_avx spawn(16) standalone_executable
    Builtins: "bun:main" "node:assert" "node:async_hooks" "node:buffer" "node:child_process" "node:constants" "node:crypto" "node:domain" "node:events" "node:fs" "node:fs/promises" "node:http" "node:https" "node:module" "node:net" "node:os" "node:path" "node:path/posix" "node:path/win32" "node:perf_hooks" "node:process" "node:querystring" "node:stream" "node:timers/promises" "node:tls" "node:tty" "node:url" "node:util
    2026-01-22 15:21:14.703 [info] Closing Claude on channel: hm0ylw07d2j
    2026-01-22 15:21:14.706 [error] Error from Claude (on channel hm0ylw07d2j): Error: Claude Code process terminated by signal SIGABRT
    2026-01-22 15:21:20.094 [info] Received message from webview: {"type":"request","requestId":"uhqdcl8omc","request":{"type":"open_output_panel"}}

  7. github-actions commented on Feb 28, 2026

    @github-actions

    Closing for now — inactive for too long. Please open a new issue if this is still relevant.

  8. github-actions commented on Mar 7, 2026

    @github-actions

    This issue has been automatically locked since it was closed and has not had any activity for 7 days. If you're experiencing a similar issue, please file a new issue and reference this one if it's relevant.

  9. locked as resolved and limited conversation to collaborators on Mar 7, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    area:corearea:mcpbugSomething isn't workinghas reproHas detailed reproduction stepsplatform:linuxIssue specifically occurs on LinuxstaleIssue is inactive

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions