Skip to content

Desktop sidecar crash: STATUS_STACK_BUFFER_OVERRUN (0xC0000409 / exit 3221226505) from @parcel/watcher std::regex_match on long paths (upstream parcel-bundler/watcher#250) #32443

Closed as not planned

Description

@rasalinga

Summary

On Windows, the OpenCode Desktop sidecar process crashes with exit code 3221226505 (0xC0000409, STATUS_STACK_BUFFER_OVERRUN), taking the local server offline and making the conversation unresponsive. Forensic analysis of the Windows minidump points the crash at the bundled native file-watcher module @parcel/watcher-win32-x64\watcher.node. The crash is triggered when the watcher's glob/regex engine processes very long filesystem paths, matching the known upstream bug parcel-bundler/watcher#250.

This looks like the same crash class as #29033 (open) and #28413 (closed) — both report the identical exit code on Windows, but neither pinpointed the underlying module. This report adds the minidump-confirmed root cause and the upstream link.

Environment

  • OpenCode version: Desktop v1.17.7 (Windows x64)
  • Operating System: Windows 11 (10.0.26100)
  • Terminal: desktop
  • The crash is not model-specific — it was observed across multiple models. The trigger is the filesystem path, not the AI model.

Symptoms

Symptom Detail
UI Local server disconnects; conversation becomes unresponsive
Sidecar exit code 3221226505 (0xC0000409, STATUS_STACK_BUFFER_OVERRUN)
Logs sidecar exited { code: 3221226505 }
Reproducibility Deterministic when long paths are written inside the watched workspace

Root cause (minidump evidence)

A Windows crash dump is generated under:

%APPDATA%\ai.opencode.desktop\Crashpad\reports\

Key facts from the dump:

Field Value
Exception code 0xe0000008 (fast-fail / stack-buffer-overrun family)
Exception location inside KERNELBASE.dll
Loaded native module @parcel\watcher-win32-x64\watcher.node

The stack overflow originates in the watcher's native code — not in the Node application logic or in user scripts. It matches the known upstream issue:

Stack overflow crash (STATUS_STACK_BUFFER_OVERRUN / 0xC0000409) in std::regex_match on long paths when using a glob ignore option — parcel-bundler/watcher#250

@parcel/watcher applies std::regex_match to filesystem paths; with sufficiently long input strings the regex engine consumes enough stack space to trip the compiler /GS buffer-security check. The crash is therefore path-length dependent.

Steps to reproduce

Warning: this will disconnect the OpenCode session. Run only in a disposable workspace.

Create a file with a very long basename inside a directory that OpenCode is watching:

$dir  = "C:\some\watched\workspace"
$long = "VERY_LONG_BASENAME_" + ("x" * 200) + "_20260101T000000Z.txt"
Set-Content -Path (Join-Path $dir $long) -Value "test"

A deep directory hierarchy combined with a very long basename (total path well beyond 260 characters) reliably trips the watcher's regex engine and crashes the sidecar within seconds.

Why it can look model-dependent

Sessions that happen to create long paths crash; sessions that don't, never see it. This creates a false correlation between the crash and a specific model. The real variable is path length, not the model.

Recommendations

  1. Upgrade or replace @parcel/watcher to a release that resolves parcel-bundler/watcher#250.
  2. Bound/normalize path length before passing paths to the watcher's glob-ignore matching, if upgrading isn't immediately possible.
  3. Add a config toggle to disable file watching for users running file-intensive tasks.
  4. Graceful degradation: when the sidecar crashes, preserve conversation state and allow reconnection without losing context.
  5. Long-path testing: exercise the bundled native watcher with paths > 260 characters on Windows.

Workaround (user-side)

  • Keep workspace file/directory basenames short.
  • Do file-intensive/intermediate work outside the watched workspace, then copy only short-named final artifacts into it.
  • Avoid printing long recursive path listings that the watcher may then process.

Related

Activity

  1. github-actions commented on Jun 15, 2026

    @github-actions
    Contributor

    This issue might be a duplicate of existing issues. Please check:

    Your report adds valuable minidump-confirmed root cause analysis pointing to @parcel/watcher's std::regex_match, which may help move #29033 forward. Consider whether this is best added as a comment to #29033 rather than a separate issue, or ask a maintainer to link/merge them.

  2. github-actions commented on Aug 15, 2026

    @github-actions
    Contributor

    To stay organized issues are automatically closed after 60 days of no activity. If the issue is still relevant please open a new one.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

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