Skip to content

git.exe 2.56.0.windows.2: access violation in start_command while launching rebase commit editor #6475

Done

Description

@totalrodesign

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 --continue

Debugger 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

  1. dscho commented on Oct 9, 2026

    @dscho
    Member

    Unfortunately, I cannot reproduce this:

    PS D:\repros> git init git-editor-crash-6475
    Initialized empty Git repository in D:/repros/git-editor-crash-6475/.git/
    PS D:\repros> cd git-editor-crash-6475
    PS D:\repros\git-editor-crash-6475> git config user.name Repro
    PS D:\repros\git-editor-crash-6475> git config user.email repro@example.invalid
    PS D:\repros\git-editor-crash-6475> 'base' | Set-Content f.txt
    PS D:\repros\git-editor-crash-6475> git add f.txt
    PS D:\repros\git-editor-crash-6475> git commit -m base
    [main (root-commit) 10ad3b5] base
     1 file changed, 1 insertion(+)
     create mode 100644 f.txt
    PS D:\repros\git-editor-crash-6475> git switch -c topic
    Switched to a new branch 'topic'
    PS D:\repros\git-editor-crash-6475> 'topic' | Set-Content f.txt
    PS D:\repros\git-editor-crash-6475> git commit -am topic
    [topic 55a221d] topic
     1 file changed, 1 insertion(+), 1 deletion(-)
    PS D:\repros\git-editor-crash-6475> git switch main
    Switched to branch 'main'
    PS D:\repros\git-editor-crash-6475> 'main' | Set-Content f.txt
    PS D:\repros\git-editor-crash-6475> git commit -am main
    [main b319a1b] main
     1 file changed, 1 insertion(+), 1 deletion(-)
    PS D:\repros\git-editor-crash-6475> git switch topic
    Switched to branch 'topic'
    PS D:\repros\git-editor-crash-6475> git rebase main
    Auto-merging f.txt
    CONFLICT (content): Merge conflict in f.txt
    error: could not apply 55a221d... topic
    hint: Resolve all conflicts manually, mark them as resolved with
    hint: "git add/rm <conflicted_files>", then run "git rebase --continue".
    hint: You can instead skip this commit: run "git rebase --skip".
    hint: To abort and get back to the state before "git rebase", run "git rebase --abort".
    hint: Disable this message with "git config set advice.mergeConflict false"
    Recorded preimage for 'f.txt'
    Could not apply 55a221d... # topic
    PS D:\repros\git-editor-crash-6475> 'resolved' | Set-Content f.txt
    PS D:\repros\git-editor-crash-6475> git add f.txt
    PS D:\repros\git-editor-crash-6475> $env:GIT_EDITOR = 'vim'
    PS D:\repros\git-editor-crash-6475> git rebase --continue
    Recorded resolution for 'f.txt'.
    [detached HEAD b671792] topic
     1 file changed, 1 insertion(+), 1 deletion(-)
    Successfully rebased and updated refs/heads/topic.
    PS D:\repros\git-editor-crash-6475>

    I'm also on Windows version 10.0.26300.9457.

  2. dscho commented on Oct 9, 2026

    @dscho
    Member

    git_exe!start_command+0x8fc

    Would be interesting to match that up to a concrete source code line.

    For what it's worth:

    PS D:\repros\git-editor-crash-6475> cmd /c ver
    
    Microsoft Windows [Version 10.0.26300.9457]
    PS D:\repros\git-editor-crash-6475> cmd /c where git.exe
    C:\Program Files\Git\cmd\git.exe
    PS D:\repros\git-editor-crash-6475> git version
    git version 2.56.0.windows.2
    PS D:\repros\git-editor-crash-6475>
  3. totalrodesign commented on Oct 9, 2026

    @totalrodesign
    Author

    Thanks for testing this. The crashing host has the same Windows build, 10.0.26300.9457, and Git for Windows 2.56.0.windows.2.

    With the official UCRT64 git.pdb whose GUID and age match the dump, git_exe!start_command+0x8fc (git.exe+0x29113c) resolves to the inlined convert_slashes(char *path) loop at compat/mingw.h:38. The faulting instruction is movzx edx, byte ptr [rax], reading address zero. Its caller is git_shell_path() at run-command.c:282-283:

    char *p = locate_in_PATH("sh");
    convert_slashes(p);

    The immediately preceding call is mingw_locate_in_PATH("sh"); the returned pointer was null when convert_slashes dereferenced it. path_lookup() can return null if PATH is unavailable or no suitable sh is 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 was git 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 from locate_in_PATH("sh")?

  4. dscho commented on Oct 9, 2026

    @dscho
    Member

    4. The immediately preceding call is mingw_locate_in_PATH("sh"); the returned pointer was null when convert_slashes dereferenced it.

    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 with C:/Program Files/Git/usr/bin/sh.exe, and the Git wrapper at C:\Program Files\cmd\git.exe ensures that /usr/bin is in the PATH.

  5. totalrodesign commented on Oct 9, 2026

    @totalrodesign
    Author

    One useful distinction from a later recurrence: a rebase continuation selected a full path to Git for Windows' true.exe as GIT_EDITOR. The matching-build dump again reported a null read at git.exe+0x29113c with start_command → launch_specified_editor → cmd_commit on 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 full true.exe path contains spaces/backslashes; prepare_shell_cmd() therefore takes the shell path and can reach git_shell_path(). I tested the literal GIT_EDITOR=: and GIT_SEQUENCE_EDITOR=: in a disposable Git 2.56.0.windows.2 repository: commit -e -m, conflicted rebase --continue, and default rebase -i completed 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.

  6. dscho commented on Oct 11, 2026

    @dscho
    Member

    One useful distinction from a later recurrence: a rebase continuation selected a full path to Git for Windows' true.exe as GIT_EDITOR.

    I tried this: git rebase -i HEAD^, inserted b before the first line after changing edit to reword. Then I set $env:GIT_EDITOR = ""C:\Program Files\Git\usr\bin\true.exe"" and ran git rebase --continue. Successfully, no crash.

    I still cannot explain why locate_in_PATH("sh") returned null on the crashing process.

    It would be really necessary to find out. You need to inspect the PATH before git rebase --continue, or in an exec statement.

  7. added this to the Next release milestone on Nov 26, 2026
  8. dscho commented on Nov 26, 2026

    @dscho
    Member

    /add relnote bug In some sandboxes (as AI agents increasingly use), Git for Windows' sh.exe is hidden, inadvertently causing git.exe to crash. This bug has been fixed by showing a proper error message instead.

    The workflow run was started

  9. added a commit that references this issue on Nov 26, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions