You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Commit 7187500
Browse filesBrowse the repository at this point in the historyBrowse files
fix(win): escape spawned command-line args so the index worker gets valid argv
Fixes the Windows-only smoke-windows (standard + ui) failure in the release dry
run, where index_repository reported outcome=exit_nonzero and "Indexing worker
crashed on a file" on big_templated.hpp. It is not the DeusData#424 allocator class and
not big_templated.hpp — the file parses fine; the worker never reaches it.
This is the Windows residual of DeusData#838. That issue fixed the CLI parser to accept
the supervisor's raw-JSON-positional + --response-out flag layout, verified with a
PowerShell repro where the JSON argument arrives intact. But the real supervisor
spawns the worker via CreateProcessA, whose command-line re-parse strips the JSON's
quotes, so on Windows the now-fixed parser still receives corrupted JSON.
On Windows the index supervisor spawns the worker as
`<self> cli --index-worker index_repository <args_json> ...`, but cbm_run_win
built the CreateProcess command line by wrapping each argv element in bare quotes
with no escaping. Windows re-parses that single string back into argv and strips
the inner quotes, so the JSON argument {"repo_path":"..."} arrived at the child as
{repo_path:...} — invalid JSON. The worker exited non-zero at arg parse
("repo_path is required"); the supervisor classified exit_nonzero and blamed the
last-marked file (big_templated.hpp), producing the misleading crash message.
POSIX is unaffected: cbm_run_posix passes the argv array straight to execv with no
re-parse, which is why only smoke-windows was red while Linux/macOS indexed the
same fixture fine.
Fix: cbm_build_win_cmdline() applies the Microsoft C runtime quoting rules
(quote-wrap + escape embedded quotes and their preceding backslash runs) so the
child re-parses byte-identical argv. It is defined unconditionally (pure string
logic, no Windows headers) and unit-tested on every platform via a round-trip
against a reference CommandLineToArgvW parser.
Also in this change (from a full Windows quoting audit of the tree):
- ui/http_server.c: the UI index spawn had a byte-for-byte duplicate of the same
bug (its own "%s" cmdline). Route it through cbm_build_win_cmdline too.
- pipeline/artifact.c: the two `git -C '%s'` shell-outs were single-quoted and
unvalidated — broken for spaced repo paths on cmd.exe and the only unguarded git
interpolation in the tree. Validate repo_path (cbm_validate_shell_arg + the
Windows % ! ^ guard) and use double quotes + the per-platform null device,
matching git_context.c (the best-hardened git shell-out).
- mcp/index_supervisor.c: log the worker's raw exit_code and KEEP its log on any
failure (delete only on a clean run). Previously the log was always deleted and
only outcome+signal were logged, so a non-zero worker left nothing to diagnose —
the CI blind spot that hid this bug behind a generic message.
Verified on a CLANG64 build (the toolchain CI ships): the supervised
big_templated.hpp fixture now indexes clean (reap outcome=clean exit_code=0);
subprocess suite 11/11, affected suites (artifact, git_context, index_resilience,
ui, httpd, mcp, security, str_util) 322/322 green.
Refs: DeusData#838, DeusData#423
Co-Authored-By: Claude Opus 4.8 (1M context) <[email protected]>
Signed-off-by: Flipper <[email protected]>
0 commit comments