Repository navigation
Description
Git for Windows version
git version 2.56.0.windows.2, x86_64, built from cc4dbf752a05efdc0e04e71fd3e8110d11bdd35c. System installation at C:\Program Files\Git; installer Editor Option was VIM. The effective editor override at the moment of the crash was not recovered.
Windows and shell
Windows 11 Home, x86_64, build 10.0.26300.9457. The rebase was orchestrated from a PowerShell/Codex task. The dump identifies the child git.exe command; the immediate parent command was not captured.
Observed command and behavior
The crashing child command, with the private worktree path redacted, was:
git commit -n --no-gpg-sign -F <worktree-gitdir>/rebase-merge/message -e --allow-empty
This ran during a rebase. Git should launch the configured editor to confirm the replayed commit message and then finish without a process crash. Instead, git.exe had an access violation, 0xC0000005, reading address 0x0.
Small path exerciser
The following disposable-repository recipe exercises a rebase conflict followed by an editor-backed commit. It is not yet confirmed to reproduce the crash in isolation. Run it interactively and save/exit Vim when prompted.
$git = 'C:\Program Files\Git\cmd\git.exe'
New-Item -ItemType Directory git-editor-repro | Out-Null
Set-Location git-editor-repro
& $git init -b main
& $git config user.name Repro
& $git config user.email repro@example.invalid
'base' | Set-Content f.txt
& $git add f.txt
& $git commit -m base
& $git switch -c topic
'topic' | Set-Content f.txt
& $git commit -am topic
& $git switch main
'main' | Set-Content f.txt
& $git commit -am main
& $git switch topic
& $git rebase main # expect a conflict in f.txt
'resolved' | Set-Content f.txt
& $git add f.txt
$env:GIT_EDITOR = 'vim'
& $git rebase --continueDebugger evidence
Microsoft-signed WinDbg/CDB opened the completed ProcDump AeDebug file. The installed git.exe matched the dump module's PE size, timestamp, and checksum. The official v2.56.0.windows.2 UCRT64 PDB archive had SHA-256 3e78910b6a2f7da26e0d61bcb285ae1c54e1ded245944758501869e1ec9aec69; its ucrt64/bin/git.pdb GUID 4CB9821A-11A9-46FA-9F9B-680236AB44D9, age 1, matched the dump exactly.
The exception was at git_exe!start_command+0x8fc (git.exe+0x29113c). The crashing thread stack was:
git_exe!start_command+0x8fc
git_exe!launch_specified_editor+0x198
git_exe!cmd_commit+0x186f
git_exe!handle_builtin+0x1e8
git_exe!cmd_main+0x3ca
git_exe!main+0x22
git_exe!wmain+0x2ae
kernel32!BaseThreadInitThunk+0x17
ntdll!RtlUserThreadStart+0x2c
No promisor or lazy-fetch function appears on this crashing stack. The underlying cause of the null read is not established. Earlier Git crashes lacked dumps, so I am not asserting that they share this cause.
I searched open and closed issues for launch_specified_editor, start_command, rebase/editor/access violation, and 2.56.0. The closest issue I found, #6459, concerns a MinGit ARM64 BusyBox editor-command failure and appears distinct from this x86_64 access violation.
The repository is private. I have not uploaded the dump because it contains private process and repository data; I can share focused debugger output if useful.
Activity
dscho commentedon Oct 9, 2026
Unfortunately, I cannot reproduce this:
I'm also on Windows version 10.0.26300.9457.
dscho commentedon Oct 9, 2026
Would be interesting to match that up to a concrete source code line.
For what it's worth:
totalrodesign commentedon Oct 9, 2026
Thanks for testing this. The crashing host has the same Windows build,
10.0.26300.9457, and Git for Windows2.56.0.windows.2.With the official UCRT64
git.pdbwhose GUID and age match the dump,git_exe!start_command+0x8fc(git.exe+0x29113c) resolves to the inlinedconvert_slashes(char *path)loop atcompat/mingw.h:38. The faulting instruction ismovzx edx, byte ptr [rax], reading address zero. Its caller isgit_shell_path()atrun-command.c:282-283:The immediately preceding call is
mingw_locate_in_PATH("sh"); the returned pointer was null whenconvert_slashesdereferenced it.path_lookup()can return null ifPATHis unavailable or no suitableshis found. We have not inspected the crashed process environment, so we cannot establish why the lookup failed. The generic rebase reproduction is therefore unconfirmed. The captured command wasgit commit -n --no-gpg-sign -F <rebase-message> -e --allow-empty.We have selected a noninteractive editor for subsequent lane Git commands and are monitoring for recurrence; this does not establish that the underlying crash is fixed. Would
git_shell_path()need to handle a null result fromlocate_in_PATH("sh")?dscho commentedon Oct 9, 2026
Oh, this rings a bell: #6358 tries to address exactly that.
My big question, though, is: how can this be
NULL? Git for Windows comes withC:/Program Files/Git/usr/bin/sh.exe, and the Git wrapper atC:\Program Files\cmd\git.exeensures that/usr/binis in thePATH.totalrodesign commentedon Oct 9, 2026
One useful distinction from a later recurrence: a rebase continuation selected a full path to Git for Windows'
true.exeasGIT_EDITOR. The matching-build dump again reported a null read atgit.exe+0x29113cwithstart_command → launch_specified_editor → cmd_commiton the stack. This is not evidence that the deeper cause is identical, but it shows that simply choosing an executable that exits successfully did not avoid the editor-launch route.In v2.56,
launch_specified_editor()skips spawning only when the editor value is exactly:. A fulltrue.exepath contains spaces/backslashes;prepare_shell_cmd()therefore takes the shell path and can reachgit_shell_path(). I tested the literalGIT_EDITOR=:andGIT_SEQUENCE_EDITOR=:in a disposable Git 2.56.0.windows.2 repository:commit -e -m, conflictedrebase --continue, and defaultrebase -icompleted with zero editor-class child starts in trace2. We plan to use that as a narrow mitigation, with a warning that it accepts an interactive-rebase todo unchanged.I still cannot explain why
locate_in_PATH("sh")returned null on the crashing process. I have not printed or inspected that process's environment, and the isolated probe did not reproduce the crash. This follow-up does not change the reported root-cause uncertainty or imply a promisor/lazy-fetch link.dscho commentedon Oct 11, 2026
I tried this:
git rebase -i HEAD^, insertedbbefore the first line after changingedittoreword. Then I set$env:GIT_EDITOR = ""C:\Program Files\Git\usr\bin\true.exe""and rangit rebase --continue. Successfully, no crash.It would be really necessary to find out. You need to inspect the
PATHbeforegit rebase --continue, or in anexecstatement.resolve-git-stacktrace: make crash frame resolution reusable
Add a helper to resolve Git for Windows crash frames (#754)
run-command: avoid NULL dereference for missing Windows shell
dscho commentedon Nov 26, 2026
/add relnote bug In some sandboxes (as AI agents increasingly use), Git for Windows'
sh.exeis hidden, inadvertently causinggit.exeto crash. This bug has been fixed by showing a proper error message instead.The workflow run was started
run-command: avoid NULL dereference for missing Windows shell (#6358)
Add a release note (bug)