Fix assertion failure on Windows when loading varlock#254
Fix assertion failure on Windows when loading varlock#254
Conversation
|
|
@copilot try again |
|
@copilot - try again |
|
@copilot try again |
Co-authored-by: theoephraim <1158956+theoephraim@users.noreply.github.com>
|
@copilot - im not sure about removing that call to |
…tead Co-authored-by: theoephraim <1158956+theoephraim@users.noreply.github.com>
Good point! Fixed in commit 0564095 using your suggested approach - removed the two |
Fixes a critical bug on Windows where all varlock commands were failing with an assertion error:
Assertion failed: !(handle->flags & UV_HANDLE_CLOSING), file src\win\async.c, line 76.Root Cause
The issue was caused by calling
gracefulExit()twice in error handling paths incli-executable.ts:gracefulExit(1)gracefulExit(1)This double invocation caused libuv on Windows to attempt closing the same handle twice, resulting in the assertion failure.
Changes Made
Removed the two
gracefulExit(1)calls from within the error handling branches. Now all known error paths fall through to a singlegracefulExit(1)call at the end of the catch block.gracefulExit()is only called once per execution path:gracefulExit()gracefulExit(1)onceThis approach provides cleaner code structure where all known errors converge to a single exit point.
Testing
load,--help) - no assertion failuresThe fix is minimal and surgical, addressing exactly the root cause without any side effects.
Original prompt
💡 You can make Copilot smarter by setting up custom instructions, customizing its development environment and configuring Model Context Protocol (MCP) servers. Learn more Copilot coding agent tips in the docs.