Skip to content

[Bug][v3.0.0-beta.15]: Bun crashed when using LSP(lsp_diagnostics) on Windows #1047

Closed

Description

@FurryWolfX

Prerequisites

  • I have searched existing issues to avoid duplicates
  • I am using the latest version of oh-my-opencode
  • I have read the documentation

Bug Description

Bun crashed when using LSP(lsp_diagnostics) on Windows

Image

Steps to Reproduce

  1. create a typescript project
  2. open opencode with omo plugin
  3. enter "test lsp tool for ts"
  4. when using lsp_diagnostics, Bun crashed

Expected Behavior

no crash

Actual Behavior

crash

Doctor Output

PS C:\Users\worph> bunx oh-my-opencode doctor

 oMoMoMoMo... Doctor


Installation
────────────────────────────────────────
  ✗ OpenCode Installation → OpenCode is not installed
  ✓ Plugin Registration → Registered

Configuration
────────────────────────────────────────
  ✓ Configuration Validity → Valid JSONC config

Authentication
────────────────────────────────────────
  ✓ Anthropic (Claude) Auth → Auth plugin available
  ○ OpenAI (ChatGPT) Auth → Auth plugin not installed
  ○ Google (Gemini) Auth → Auth plugin not installed

Dependencies
────────────────────────────────────────
  ⚠ AST-Grep CLI → Not installed (optional)
  ⚠ AST-Grep NAPI → Not installed (optional)
  ⚠ Comment Checker → Not installed (optional)

Tools & Servers
────────────────────────────────────────
  ⚠ GitHub CLI → Not installed (optional)
  ⚠ LSP Servers → No LSP servers detected
  ✓ Built-in MCP Servers → 2 built-in servers enabled
  ○ User MCP Configuration → No user MCP configuration found

Updates
────────────────────────────────────────
  ✓ Version Status → Up to date (2.14.0)

Summary
────────────────────────────────────────

  5 passed, 1 failed, 5 warnings, 3 skipped
  Total: 14 checks in 1207ms

✗ Issues detected. Please review the errors above.

PS C:\Users\worph> opencode -v
1.1.34
PS C:\Users\worph>

Error Logs

Configuration

Additional Context

No response

Operating System

Windows

OpenCode Version

1.1.34

Activity

  1. FurryWolfX commented on Jan 24, 2026

    @FurryWolfX
    Author

    It's works good in WSL

  2. changed the title [-][Bug]: Bun crashed when using LSP(lsp_diagnostics) on Windows[/-] [+][Bug][v3.0.0-beta.15]: Bun crashed when using LSP(lsp_diagnostics) on Windows[/+] on Jan 24, 2026
  3. code-yeongyu commented on Jan 24, 2026

    @code-yeongyu
    Owner

    @sisyphus-dev-ai debug this ulw

  4. self-assigned this
    on Jan 24, 2026
  5. added a commit that references this issue on Jan 24, 2026
    0abd23a
  6. sisyphus-dev-ai commented on Jan 24, 2026

    @sisyphus-dev-ai
    Collaborator

    Debug Analysis Complete

    Root Cause Identified

    This is a known Bun bug on Windows, not an oh-my-opencode issue.

    Bun v1.3.5 and earlier have a segmentation fault bug when spawning processes via Bun.spawn(). Since LSP tools spawn language server processes, this triggers the crash.

    Evidence

    • oven-sh/bun#25798 - "Segmentation fault at address 0x0 on Windows x64 in Bun v1.3.5"
    • oven-sh/bun#21044 - "Opencode in windows crashes with segfault" (similar issue, was closed but regressed)
    • Fix released in Bun v1.3.6 (January 13, 2026): "Fixed: Rare crash in Bun Shell impacting opencode"

    Immediate Solution

    Upgrade Bun to v1.3.6 or later:

    powershell -c "irm bun.sh/install.ps1|iex"

    Workaround

    Use WSL instead of native Windows (as you noted, "It's works good in WSL").

    Fix PR

    I've created a fix that adds a helpful version check instead of letting Bun crash:

    PR #1053: fix(lsp): add Bun version check for Windows LSP segfault bug

    This will give Windows users a clear error message with upgrade instructions instead of a cryptic crash.


    @FurryWolfX Can you confirm if upgrading to Bun v1.3.6+ resolves the crash for you?

  7. added a commit that references this issue on Jan 24, 2026
    d157940
  8. FurryWolfX commented on Jan 24, 2026

    @FurryWolfX
    Author

    my bun is 1.3.6, but the bun in opencode is 1.3.5

  9. FurryWolfX commented on Jan 24, 2026

    @FurryWolfX
    Author
    Image

    @code-yeongyu I'm running opencode from source code, bun is now 1.3.6, but it still crashes, it seems the cause is not the bun version issue.

  10. FurryWolfX commented on Jan 24, 2026

    @FurryWolfX
    Author
    Bun v1.3.6 ([`d530ed9`](<https://github.com/oven-sh/bun/tree/d530ed993d62be7c7f8f01a3d52627b6845dfd93>)) on windows x86_64 [RunCommand]
    
    Segmentation fault at address 0x4BE0E1E0140
    
    - *1 unknown/js code*
    - [`interpreter.zig:1248`](<https://github.com/oven-sh/bun/blob/d530ed993d62be7c7f8f01a3d52627b6845dfd93/src/shell/interpreter.zig#L1248>): `deinitFromFinalizer`
    - [`ZigGeneratedClasses.zig:20066`](<https://github.com/oven-sh/bun/blob/d530ed993d62be7c7f8f01a3d52627b6845dfd93//var/lib/buildkite-agent/build/build/release/codegen/ZigGeneratedClasses.zig#L20066>): `ShellInterpreterClass__finalize`
    - [`memory:3426`](<https://github.com/oven-sh/bun/blob/d530ed993d62be7c7f8f01a3d52627b6845dfd93/C:/Program Files/Microsoft Visual Studio/2022/Community/VC/Tools/MSVC/14.44.35207/include/memory#L3426>): `std::unique_ptr<WTF::EmbeddedFixedVector<JSC::WriteBarrier<JSC::Unknown,WTF::RawValueTraits<JSC::Unknown> >,WTF::FastMalloc>,std::default_delete<WTF::EmbeddedFixedVector<JSC::WriteBarrier<JSC::Unknown,WTF::RawValueTraits<JSC::Unknown> >,WTF::FastMalloc> > >::~unique_ptr`
    - [`PreciseAllocation.h:155`](<https://github.com/oven-sh/WebKit/blob/1d0216219a3c52cb85195f48f19ba7d5db747ff7/Source/JavaScriptCore/heap/PreciseAllocation.h#L155>): `JSC::PreciseAllocation::isLowerTierPrecise`
    - [`MarkedSpace.cpp:256`](<https://github.com/oven-sh/WebKit/blob/1d0216219a3c52cb85195f48f19ba7d5db747ff7/Source/JavaScriptCore/heap/MarkedSpace.cpp#L256>): `JSC::MarkedSpace::sweepPreciseAllocations`
    - [`memory:3461`](<https://github.com/oven-sh/bun/blob/d530ed993d62be7c7f8f01a3d52627b6845dfd93/C:/Program Files/Microsoft Visual Studio/2022/Enterprise/VC/Tools/MSVC/14.44.35207/include/memory#L3461>): `std::unique_ptr<JSC::IsoSubspace,std::default_delete<JSC::IsoSubspace> >::operator bool`
    - [`Heap.cpp:2222`](<https://github.com/oven-sh/WebKit/blob/1d0216219a3c52cb85195f48f19ba7d5db747ff7/Source/JavaScriptCore/heap/Heap.cpp#L2222>): `JSC::Heap::handleNeedFinalize`
    - [`Heap.cpp:2230`](<https://github.com/oven-sh/WebKit/blob/1d0216219a3c52cb85195f48f19ba7d5db747ff7/Source/JavaScriptCore/heap/Heap.cpp#L2230>): `JSC::Heap::handleNeedFinalize`
    - [`Heap.cpp:1806`](<https://github.com/oven-sh/WebKit/blob/1d0216219a3c52cb85195f48f19ba7d5db747ff7/Source/JavaScriptCore/heap/Heap.cpp#L1806>): `JSC::Heap::changePhase`
    - [`Heap.cpp:1430`](<https://github.com/oven-sh/WebKit/blob/1d0216219a3c52cb85195f48f19ba7d5db747ff7/Source/JavaScriptCore/heap/Heap.cpp#L1430>): `JSC::Heap::runCurrentPhase`
    - [`Heap.cpp:2059`](<https://github.com/oven-sh/WebKit/blob/1d0216219a3c52cb85195f48f19ba7d5db747ff7/Source/JavaScriptCore/heap/Heap.cpp#L2059>): `JSC::Heap::collectInMutatorThread::<lambda_2>::operator()`
    - [`ScopedLambda.h:58`](<https://github.com/oven-sh/WebKit/blob/1d0216219a3c52cb85195f48f19ba7d5db747ff7/Source/WTF/wtf/ScopedLambda.h#L58>): `WTF::ScopedLambda<void (...)>::operator()`
    - [`CollectingScope.h:43`](<https://github.com/oven-sh/WebKit/blob/1d0216219a3c52cb85195f48f19ba7d5db747ff7/Source/JavaScriptCore/heap/CollectingScope.h#L43>): `JSC::CollectingScope::~CollectingScope`
    - [`Heap.cpp:2039`](<https://github.com/oven-sh/WebKit/blob/1d0216219a3c52cb85195f48f19ba7d5db747ff7/Source/JavaScriptCore/heap/Heap.cpp#L2039>): `JSC::Heap::stopIfNecessarySlow`
    - [`HeapInlines.h:224`](<https://github.com/oven-sh/bun/blob/d530ed993d62be7c7f8f01a3d52627b6845dfd93/C:/buildkite-agent/build/build/release/cache/webkit-1d0216219a3c52cb/include/JavaScriptCore/HeapInlines.h#L224>): `JSC::Heap::reportExtraMemoryAllocated`
    - [`JSValue.zig:878`](<https://github.com/oven-sh/bun/blob/d530ed993d62be7c7f8f01a3d52627b6845dfd93/src/bun.js/bindings/JSValue.zig#L878>): `isEmptyOrUndefinedOrNull`
    - [`Response.zig:407`](<https://github.com/oven-sh/bun/blob/d530ed993d62be7c7f8f01a3d52627b6845dfd93/src/bun.js/webcore/Response.zig#L407>): `makeMaybePooled`
    - [`Strong.zig:50`](<https://github.com/oven-sh/bun/blob/d530ed993d62be7c7f8f01a3d52627b6845dfd93/src/bun.js/Strong.zig#L50>): `create`
    - [`event_loop.zig:497`](<https://github.com/oven-sh/bun/blob/d530ed993d62be7c7f8f01a3d52627b6845dfd93/src/bun.js/event_loop.zig#L497>): `tick`
    
    Features: spawn, transpiler\_cache, tsconfig, tsconfig\_paths, virtual\_modules, workers\_spawned, napi\_module\_register, process\_dlopen, Bun.stderr, Bun.stdin, Bun.stdout, abort\_signal, bunfig, fetch, jsc, macros, shell, shell
    
  11. LCZcn96 commented on Jan 24, 2026

    @LCZcn96

    Same issue, bun version is also 1.3.6.

  12. litaoliang commented on Jan 24, 2026

    @litaoliang

    Same issue, bun version is also 1.3.6....

  13. Brisbanehuang commented on Jan 25, 2026

    @Brisbanehuang

    Same problem, hope it can be fixed

  14. oldjs commented on Jan 25, 2026

    @oldjs

    Same issue

  15. Charmnut commented on Jan 26, 2026

    @Charmnut

    Same issue, bun version is also 1.3.6....

  16. felix-ma commented on Jan 26, 2026

    @felix-ma

    同样的问题,bun版本也是1.3.6

  17. rapancristian commented on Jan 27, 2026

    @rapancristian

    same issue. bun 1.3.6

  18. EchoCyan commented on Jan 27, 2026

    @EchoCyan

    same issue

  19. Bluboks commented on Jan 27, 2026

    @Bluboks

    same here. Should I go with WSL?

  20. code-yeongyu commented on Jan 27, 2026

    @code-yeongyu
    Owner

    Closing as fixed - commit d157940 adds Bun version check before LSP server spawn to prevent segfault crashes on Windows with Bun v1.3.5 and earlier. Please update to the latest version. Thanks for the detailed bug report!

  21. added a commit that references this issue on Feb 3, 2026
    9adf349
  22. added a commit that references this issue on Feb 5, 2026
    8ff9c24
  23. WangNingkai commented on Feb 11, 2026

    @WangNingkai
    Image When I annotate the omo plug-in, the opencode web starts normally, otherwise the opencode web cannot be started.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

bugSomething isn't working

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions