Skip to content

FAILED: Rebase shears/seen (#26233949716)#183

Draft
gitforwindowshelper[bot] wants to merge 13 commits into
base/shears/seen-26233949716from
shears/seen-26233949716
Draft

FAILED: Rebase shears/seen (#26233949716)#183
gitforwindowshelper[bot] wants to merge 13 commits into
base/shears/seen-26233949716from
shears/seen-26233949716

Conversation

@gitforwindowshelper
Copy link
Copy Markdown

Workflow run failed to rebase shears/seen.

Rebase Summary: seen

From: b3ace5ede4 (??? t5563: add tests for http.emptyAuth with Negotiate, 2026-04-27) (4df73b349a..b3ace5ede4)

FAILED: 8f7e2b2 (object-file.c: use size_t for header lengths, 2021-11-12)

Unexpected AI decision: ''. Full output:

● Check if patch was upstreamed (shell)
  │ cd "/home/runner/work/git-for-windows-automation/git-for-windows-automation/
  │ git/rebase-worktree-seen" && git range-diff REBASE_HEAD^! REBASE_HEAD.. 2>&1
  │ | head -50
  └ 42 lines...

The range-diff shows `1: 8f7e2b284e < -: ----------` meaning no upstream equivalent. Let me look at the patch and conflicts.

● Find conflict markers (shell)
  │ cd "/home/runner/work/git-for-windows-automation/git-for-windows-automation/
  │ git/rebase-worktree-seen" && grep -n "^<<<<<<<\|^=======\|^>>>>>>>"
  │ object-file.c object-file.h
  └ 10 lines...

● View the patch (shell)
  │ cd "/home/runner/work/git-for-windows-automation/git-for-windows-automation/
  │ git/rebase-worktree-seen" && git show REBASE_HEAD --stat && echo "---" &&
  │ git show REBASE_HEAD | head -80
  └ 108 lines...

● Read object-file.c
  │ ~/work/git-for-windows-automation/git-for-windows-automation/git/rebase-work
  │ tree-seen/object-file.c
  └ L325:345 (20 lines read)

● Read object-file.c
  │ ~/work/git-for-windows-automation/git-for-windows-automation/git/rebase-work
  │ tree-seen/object-file.c
  └ L930:985 (56 lines read)

● Read object-file.h
  │ ~/work/git-for-windows-automation/git-for-windows-automation/git/rebase-work
  │ tree-seen/object-file.h
  └ L32:56 (25 lines read)

● Check HEAD header declarations (shell)
  │ cd "/home/runner/work/git-for-windows-automation/git-for-windows-automation/
  │ git/rebase-worktree-seen" && git show HEAD:object-file.h | grep -n
  │ "odb_source_loose_write" | head -10
  └ 2 lines...

● Check HEAD state of functions (shell)
  │ cd "/home/runner/work/git-for-windows-automation/git-for-windows-automation/
  │ git/rebase-worktree-seen" && git show HEAD:object-file.c | grep -n
  │ "write_object_file_prepare\|odb_source_loose_write_object\|hash_object_file"
  │ | head -20
  └ 9 lines...

● Check HEAD write_object_file_prepare signature (shell)
  │ cd "/home/runner/work/git-for-windows-automation/git-for-windows-automation/
  │ git/rebase-worktree-seen" && git show HEAD:object-file.c | sed -n '327,335p'
  └ 9 lines...

● Check HEAD hash_object_file (shell)
  │ cd "/home/runner/work/git-for-windows-automation/git-for-windows-automation/
  │ git/rebase-worktree-seen" && git show HEAD:object-file.c | sed -n '472,482p'
  └ 12 lines...

● Find where function moved (shell)
  │ cd "/home/runner/work/git-for-windows-automation/git-for-windows-automation/
  │ git/rebase-worktree-seen" && git show HEAD -- odb/ 2>/dev/null | head -5;
  │ grep -rl "odb_source_loose_write_object" --include="*.c" --include="*.h" .
  │ 2>/dev/null | grep -v "\.git"
  └ 4 lines...

● Check function in new location (shell)
  │ cd "/home/runner/work/git-for-windows-automation/git-for-windows-automation/
  │ git/rebase-worktree-seen" && git show HEAD:odb/source-loose.c | grep -n
  │ "odb_source_loose_write_object\|unsigned long\|size_t" | head -20
  └ 21 lines...

● Check write_object signature in new location (shell)
  │ cd "/home/runner/work/git-for-windows-automation/git-for-windows-automation/
  │ git/rebase-worktree-seen" && git show HEAD:odb/source-loose.c | grep -n -A3
  │ "odb_source_loose_write_object"
  └ 16 lines...

● Check if other changes applied (shell)
  │ cd "/home/runner/work/git-for-windows-automation/git-for-windows-automation/
  │ git/rebase-worktree-seen" && grep -n "hash_object_body\|hash_object_file"
  │ object-file.c | head -20
  └ 11 lines...

● Read object-file.c
  │ ~/work/git-for-windows-automation/git-for-windows-automation/git/rebase-work
  │ tree-seen/object-file.c
  └ L318:322 (5 lines read)

● Read object-file.c
  │ ~/work/git-for-windows-automation/git-for-windows-automation/git/rebase-work
  │ tree-seen/object-file.c
  └ L479:490 (11 lines read)

Good - `hash_object_body` got `size_t *hdrlen` applied, and `hash_object_file` got both `size_t len` and `size_t hdrlen` applied. Now I need to resolve the three conflicts:

1. **Conflict 1**: Make `write_object_file_prepare` non-static (HEAD) + use `size_t` (patch)
2. **Conflict 2**: Remove the function (already moved to odb/source-loose.c in HEAD)
3. **Header conflict**: Keep HEAD's version (declarations removed since function is now static elsewhere)

I also need to apply the `size_t` change to `odb/source-loose.c` where the function now lives.

● Edit object-file.c +2 -9
  └ ~/work/git-for-windows-automation/git-for-windows-automation/git/rebase-work
    tree-seen/object-file.c

● Edit object-file.h -16
  └ ~/work/git-for-windows-automation/git-for-windows-automation/git/rebase-work
    tree-seen/object-file.h

✗ Edit object-file.c
  │ ~/work/git-for-windows-automation/git-for-windows-automation/git/rebase-work
  │ tree-seen/object-file.c
  └ Invalid inputs: new_str is required

● Read object-file.c
  │ ~/work/git-for-windows-automation/git-for-windows-automation/git/rebase-work
  │ tree-seen/object-file.c
  └ L934:940 (7 lines read)

The conflict markers are still there. Let me see the full region:

● Read object-file.c
  │ ~/work/git-for-windows-automation/git-for-windows-automation/git/rebase-work
  │ tree-seen/object-file.c
  └ L926:975 (50 lines read)

● Edit object-file.c -42
  └ ~/work/git-for-windows-automation/git-for-windows-automation/git/rebase-work
    tree-seen/object-file.c

Now apply the `size_t` change to `odb/source-loose.c` where the function was moved:

● Read source-loose.c
  │ ~/work/git-for-windows-automation/git-for-windows-automation/git/rebase-work
  │ tree-seen/odb/source-loose.c
  └ L593:610 (18 lines read)

● Edit source-loose.c +2 -2
  └ ~/work/git-for-windows-automation/git-for-windows-automation/git/rebase-work
    tree-seen/odb/source-loose.c

Now let me also check the `hash_object_body` function - its `len` parameter should also be `size_t` per the patch but let me verify:

● Read object-file.c
  │ ~/work/git-for-windows-automation/git-for-windows-automation/git/rebase-work
  │ tree-seen/object-file.c
  └ L318:322 (5 lines read)

The original patch didn't change `hash_object_body`'s `len` parameter (only `hdrlen`), and `hdrlen` was already applied. Good. Now let me verify no conflict markers remain and stage:

● Verify no remaining conflict markers (shell)
  │ cd "/home/runner/work/git-for-windows-automation/git-for-windows-automation/
  │ git/rebase-worktree-seen" && grep -n "^<<<<<<<\|^=======\|^>>>>>>>"
  │ object-file.c object-file.h odb/source-loose.c
  └ 1 line...

No conflict markers remain. Now let me also check the `write_object_file_prepare` declaration in the header since it changed from `static` to non-static and now uses `size_t`:

● Check header declaration (shell)
  │ cd "/home/runner/work/git-for-windows-automation/git-for-windows-automation/
  │ git/rebase-worktree-seen" && grep -n "write_object_file_prepare"
  │ object-file.h
  └ 2 lines...

● Read object-file.h
  │ ~/work/git-for-windows-automation/git-for-windows-automation/git/rebase-work
  │ tree-seen/object-file.h
  └ L136:140 (5 lines read)

This declaration also needs to be updated to match the implementation:

● Edit object-file.h +2 -2
  └ ~/work/git-for-windows-automation/git-for-windows-automation/git/rebase-work
    tree-seen/object-file.h

Now stage all the changes:

● Stage resolved files (shell)
  │ cd "/home/runner/work/git-for-windows-automation/git-for-windows-automation/
  │ git/rebase-worktree-seen" && git add object-file.c object-file.h
  │ odb/source-loose.c
  └ 1 line...

Let me do a quick sanity check on the extra blank line I may have introduced:

● Read object-file.c
  │ ~/work/git-for-windows-automation/git-for-windows-automation/git/rebase-work
  │ tree-seen/object-file.c
  └ L926:934 (9 lines read)

Extra blank lines. Let me clean that up:

● Edit object-file.c -2
  └ ~/work/git-for-windows-automation/git-for-windows-automation/git/rebase-work
    tree-seen/object-file.c

● Re-stage after cleanup (shell)
  │ cd "/home/runner/work/git-for-windows-automation/git-for-windows-automation/
  │ git/rebase-worktree-seen" && git add object-file.c
  └ 1 line...

continue -- resolved size_t changes: applied patch's unsigned long→size_t conversions to write_object_file_prepare (kept non-static per HEAD), updated declaration in object-file.h, applied same changes to odb_source_loose_write_object in odb/source-loose.c where it was moved by upstream, and dropped the duplicate function body from object-file.c



Changes   +6 -73
AI Credits88.8 (3m 0s)
Tokens    ↑ 911.0k (870.2k cached) • ↓ 7.9k

dscho and others added 13 commits May 21, 2026 14:57
Every once in a while I need to verify that Microsoft Git's test suite
passes for changes that are not yet meant for public consumption, and
since it was (made) too difficult to keep up a working Azure Pipeline
definition, I have to use GitHub Actions in a private GitHub repository
for that purpose.

In these tests, basically all Dockerized CI jobs fail consistently. The
symptom is something like:

  error: cannot create async thread: Resource temporarily unavailable

in the middle of a test, typically in the t5xxx-t6xxx range. The first
such error is immediately followed by plenty more of these errors, and
not a single test succeeds afterwards.

At first, I thought that maybe the massive parallelism I enjoy there is
the problem, and I thought that the cgroups limits might be shared
between the many containers that run on essentially the same physical
machine. But even reducing the matrix to just a single of those
Dockerized jobs runs into the very same problems.

The underlying reason seems to be a substantial difference in the hosted
runners that execute these Dockerized jobs: forcing the PID limit of the
container to a high number lets the jobs pass, even when running the
complete matrix of all 13 Dockerized jobs concurrently. But that's not
the only difference: The jobs seem to take a lot longer in these
containers than, say, in the containers made available to
https://github.com/git/git.

When forcing a PID limit of 64k in that private repository, the jobs
completed successfully, but they also took a lot longer, between 2x to
2.5x longer, i.e. painfully much longer. Reducing the PID limit to 16k,
the CI jobs still passed, but took an equally long amount of time.
Reducing the PID limit to 8k caused the errors to reappear.

Here are the numbers from three example runs, the first one forcing the
PID and nproc limit to 65536, the second one to 16384, the third run is
from the public git/git repository:

Job                           | 64k     | 16k     | reference
------------------------------|---------|---------|---------
almalinux-8                   | 19m 3s  | 16m 0s  | 9m 36s
debian-11                     | 20m 31s | 20m 3s  | 8m 5s
fedora-breaking-changes-meson | 16m 29s | 19m 19s | 9m 40s
linux-asan-ubsan              | 1h 10m  | 1h 11m  | 34m 36s
linux-breaking-changes        | 25m 39s | 25m 58s | 13m 15s
linux-leaks                   | 1h 9m   | 1h 10m  | 33m 30s
linux-meson                   | 28m 9s  | 27m 4s  | 13m 45s
linux-musl-meson              | 16m 32s | 13m 39s | 8m 6s
linux-reftable-leaks          | 1h 13m  | 1h 13m  | 34m 34s
linux-reftable                | 26m 2s  | 25m 48s | 13m 31s
linux-sha256                  | 26m 12s | 26m 3s  | 12m 36s
linux-TEST-vars               | 26m 5s  | 25m 21s | 13m 25s
linux32                       | 21m 16s | 19m 57s | 10m 44s

It does not look as if the PID limit is the reason for the longer
runtime, seeing as the 64k vs 16k timings deviate no more than as is
usual with GitHub workflows. So let's go for 16k.

Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
On Windows, symbolic links come in two flavors: file symlinks and
directory symlinks.  Since Git was born on Linux where this distinction
does not exist, Git for Windows has to auto-detect the type by looking
at the target.  When the target does not yet exist at symlink creation
time, Git for Windows creates a "phantom" file symlink and later, once
checkout is complete, calls `CreateFileW()` on the target to check
whether it is actually a directory.

If the symlink target is a UNC path (e.g. `\\attacker\share`), this
auto-detection triggers an SMB connection to the remote host.  Windows
performs NTLM authentication by default for such connections, which
means a crafted repository can exfiltrate the cloning user's NTLMv2
hash to an attacker-controlled server without any user interaction
beyond `git clone -c core.symlinks=true <url>`.

There are ways to specify UNC paths that start with only a single
backslash (e.g. `\??\UNC\host\share`); All of them do start like
that, though, so let's use that as a tell-tale that we should skip
the auto-detection in `process_phantom_symlink()`. The symlink is
then left as a file symlink (the `mklink` default), and a warning is
emitted suggesting the user set the `symlink` gitattribute to `dir`
if a directory symlink is needed.  When the attribute is already set,
auto-detection is never invoked in the first place, so that code path
is unaffected.

This is the same class of vulnerability as CVE-2025-66413
(GHSA-hv9c-4jm9-jh3x)
and follows the same general mitigation pattern that MinTTY adopted for
ANSI escape sequences referencing network share paths
(GHSA-jf4m-m6rv-p6c5).

Note that there are legitimate paths starting with a single backslash
that are _not_ network paths: drive-less absolute paths are interpreted
as relative to the current working directory's drive. In practice, these
are highly uncommon (and brittle, just one working directory change
away from breaking). In any case, the only consequence is now that the
symlink type of those has to be specified via Git attributes, is all.

Reported-by: Justin Lee <jessdhoctor@gmail.com>
Addresses: CVE-2026-32631
Addresses: GHSA-9j5h-h4m7-85hx
Assisted-by: Claude Opus 4.6
Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
This fixes two issues, one specific to running CI for embargoed releases.

Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
This merges the fix for CVE-2026-32631 into the v2.53.x release branch.

Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
When a Unix socket is initialized, the current directory's path is
stored so that the cleanup code can `chdir()` back to where it was
before exit.

If the path that needs to be stored exceeds the default size of the
`sun_path` attribute of `struct sockaddr_un` (which is defined as a
108-sized byte array on Linux), a larger buffer needs to be allocated so
that it can hold the path, and it is the responsibility of the
`unix_sockaddr_cleanup()` function to release that allocated memory.

In Git's CI, this stack allocation is not necessary because the code is
checked out to `/home/runner/work/git/git`. Concatenate the path
`t/trash directory.t0301-credential-cache/.cache/git/credential/socket`
and a terminating NUL, and you end up with 96 bytes, 12 shy of the
default `sun_path` size.

However, I use worktrees with slightly longer paths:
`/home/me/projects/git/yes/i/nest/worktrees/to/organize/them/` is more
in line with what I have. When I recently tried to locally reproduce a
failure of the `linux-leaks` CI job, this t0301 test failed (where it
had not failed in CI).

The reason: When `credential-cache` tries to reach its daemon initially
by calling `unix_sockaddr_init()`, it is expected that the daemon cannot
be reached (the idea is to spin up the daemon in that case and try
again). However, when this first call to `unix_sockaddr_init()` fails,
the code returns early from the `unix_stream_connect()` function
_without_ giving the cleanup code a chance to run, skipping the
deallocation of above-mentioned path.

The fix is easy: do not return early but instead go directly to the
cleanup code.

Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
In some implementations, `regexec_buf()` assumes that it is fed lines;
Without `REG_NOTEOL` it thinks the end of the buffer is the end of a
line. Which makes sense, but trips up this case because we are not
feeding lines, but rather a whole buffer. So the final newline is not
the start of an empty line, but the true end of the buffer.

This causes an interesting bug:

  $ echo content >file.txt
  $ git grep --no-index -n '^$' file.txt
  file.txt:2:

This bug is fixed by making the end of the buffer consistently the end
of the final line.

The patch was applied from
https://lore.kernel.org/git/20250113062601.GD767856@coredump.intra.peff.net/

Reported-by: Olly Betts <olly@survex.com>
Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
These fixes have been sent to the Git mailing list but have not been
picked up by the Git project yet.

Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
On LLP64 systems, such as Windows, the size of `long`, `int`, etc. is
only 32 bits (for backward compatibility). Git's use of `unsigned long`
for file memory sizes in many places, rather than size_t, limits the
handling of large files on LLP64 systems (commonly given as `>4GB`).

Provide a minimum test for handling a >4GB file. The `hash-object`
command, with the  `--literally` and without `-w` option avoids
writing the object, either loose or packed. This avoids the code paths
hitting the `bigFileThreshold` config test code, the zlib code, and the
pack code.

Subsequent patches will walk the test's call chain, converting types to
`size_t` (which is larger in LLP64 data models) where appropriate.

Signed-off-by: Philip Oakley <philipoakley@iee.email>
Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
@gitforwindowshelper
Copy link
Copy Markdown
Author

Artifacts: release assets

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants