Skip to content

[Bug] --mcp-stdio mode crashes (exit 4294967295) when stdin receives EOF #3428

@sdasari-mdvip

Description

@sdasari-mdvip

Summary

When DAB is running in --mcp-stdio mode and stdin is closed (EOF), DAB exits with code 4294967295 (0xFFFFFFFF / -1) instead of shutting down gracefully. This causes MCP health checks to always report the server as disconnected, because health-check tools (e.g. claude mcp list) intentionally close stdin after the initialize handshake.

Environment

  • DAB version: 1.7.92
  • OS: Windows 11 Enterprise
  • Transport: --mcp-stdio
  • MCP client: Claude Code 2.1.98

Steps to Reproduce

# Send initialize, then immediately close stdin
echo '{"jsonrpc":"2.0","method":"initialize","params":{"protocolVersion":"2025-06-18","capabilities":{},"clientInfo":{"name":"test","version":"1"}},"id":1}' \
  | dab start --config dab-config.json --mcp-stdio
echo "Exit code: $?"

After DAB finishes startup and sends the initialize response, stdin reaches EOF (because echo exits). DAB exits with code 4294967295 instead of 0.

Expected Behavior

DAB should handle stdin EOF gracefully:

  1. Stop accepting new requests.
  2. Finish any in-progress requests.
  3. Exit with code 0.

Actual Behavior

DAB exits with code 4294967295 (unhandled exception / abnormal termination) when stdin closes.

Impact

MCP health-check tools close stdin after receiving the initialize response (standard probe behavior). DAB's crash on EOF causes every health check to report ✗ Failed to connect, even when the server is fully functional and responds correctly to the initialize request.

In a real session (where stdin stays open), this crash does not occur — but it breaks all automated connectivity checks and monitoring.

Suggested Fix

In --mcp-stdio mode, add a graceful stdin-EOF handler: catch the ObjectDisposedException / IOException on the stdin read loop and exit cleanly with code 0 rather than propagating an unhandled exception.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions