git/list[1] front-page[2] threads[3] people[4] search[5] about
 

Re: "git am" crash (builtin/apply.c:2108) + small repro

From
Nguyen Thai Ngoc Duy <pclouds@gmail.com>
Date
Oct 3, 2012, 11:27 UTC
Message-ID
<CACsJy8B9NDmGnopoFEAA0T4mgG+54npYnbb_d4tihRNB=xrGnw@mail.gmail.com>
In-Reply-To
<CAOKKMFG4JsNyMY7=SB6EuR8_GnpAu-ysH02J5pwD1cNzUgaieQ@mail.gmail.com>
On Tue, Oct 2, 2012 at 1:33 AM, Alexey Spiridonov <snarkmaster@gmail.com> wrote:
> This reproduces in trunk, 1.7.8.4, and 1.7.9.5.

fwiw, I cannot reproduce it (git-apply does not crash). I tried both versions and 1.8.0-rc1. Just in case the attached files are somehow corrupted, this is sha1sum from my side:

3d4711cd15d9617e0d3a52bbcd7def898c12c328 crashy.patch fd63cc32338823f216a6684ce5118a69113968c8 meep/spork/__init__.py

Show 35 quoted lines
> I suspect this has to do with a whitespace + no trailing newline
> issues. The patch was generated by 1.7.9.5. I mangled it by hand to
> get it to be small, but the initial crash happened on a large,
> real-world output of "git format-patch".
>
> Error messages:
>
> ~/GIT-AM-CRASH$ ../git/git am crashy.patch
> Applying: Git crash bug
> git: builtin/apply.c:2108: update_pre_post_images: Assertion
> `fixed_preimage.nr == preimage->nr' failed.
> /home/lesha/GIT-AM-CRASH/../git/git-am: line 811: 23819 Aborted
>          git apply --index "$dotest/patch"
> Patch failed at 0001 Git crash bug
> The copy of the patch that failed is found in:
>    /home/lesha/GIT-AM-CRASH/.git/rebase-apply/patch
> When you have resolved this problem, run "git am --resolved".
> If you prefer to skip this patch, run "git am --skip" instead.
> To restore the original branch and stop patching, run "git am --abort".
>
> Repro steps:
>
> mkdir GIT-AM-CRASH
> cd GIT-AM-CRASH
> # download files into this directory
> git init .
> mkdir -p meep/spork
> mv __init__.py meep/spork
> git add meep/spork/__init__.py
> git ci -am 'moo'
> git am crashy.patch
>
> Hope this helps!
>
> Alexey
-- 
Duy
Previous: Alexey SpiridonovNext: Alexey Spiridonov
Message 2 of 7 in “"git am" crash (builtin/apply.c:2108) + small repro”
  1. Alexey SpiridonovOct 1, 2012
  2. Nguyen Thai Ngoc DuyOct 3, 2012
  3. Alexey SpiridonovOct 3, 2012
  4. Nguyen Thai Ngoc DuyOct 7, 2012
  5. Junio C HamanoOct 12, 2012
  6. Alexey SpiridonovNov 5, 2012
  7. Junio C HamanoNov 14, 2012

Read the whole thread, see it on lore, or plain text.

$ cat FOOTERMessages come from the public archive at lore.kernel.org/git, fetched every hour. The front page is chosen and written each morning by an AI editor and can be wrong; the threads themselves are the record. About and API. For agents: an MCP server at https://gitlist.dev/mcp, and any thread, story or person page as Markdown by adding .md to its URL (or sending Accept: text/markdown). Details in /llms.txt.