git@vger.kernel.org mailing list mirror (one of many)
 help / color / mirror / code / Atom feed
* "git am" crash (builtin/apply.c:2108) + small repro
@ 2012-10-01 18:33 Alexey Spiridonov
  2012-10-03 11:27 ` Nguyen Thai Ngoc Duy
  0 siblings, 1 reply; 7+ messages in thread
From: Alexey Spiridonov @ 2012-10-01 18:33 UTC (permalink / raw)
  To: git

[-- Attachment #1: Type: text/plain, Size: 1152 bytes --]

This reproduces in trunk, 1.7.8.4, and 1.7.9.5.

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

[-- Attachment #2: crashy.patch --]
[-- Type: application/octet-stream, Size: 504 bytes --]

From ab376a1d76b1605443b4d7eb9197be333b037f16 Mon Sep 17 00:00:00 2001
From: lesha <snarkmaster@gmail.com>
Date: Wed, 26 Sep 2012 10:58:43 -0700
Subject: Git crash bug

---

diff --git a/meep/spork/__init__.py b/meep/spork/__init__.py
index 9d869c9..ef120c7 100644
--- a/meep/spork/__init__.py
+++ b/meep/spork/__init__.py
@@ -1,7 +1,9 @@
 from __future__ import absolute_import
 
+from bar import Boo
+
 from .baz import Bork
 
-Boo.mooFooCow(Bork)
+Boo.mooCow(Bork)
   
   
\ No newline at end of file

[-- Attachment #3: __init__.py --]
[-- Type: application/octet-stream, Size: 84 bytes --]

from __future__ import absolute_import

from .baz import Bork

Boo.mooFooCow(Bork)


^ permalink raw reply related	[flat|nested] 7+ messages in thread

end of thread, other threads:[~2012-11-14 22:50 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2012-10-01 18:33 "git am" crash (builtin/apply.c:2108) + small repro Alexey Spiridonov
2012-10-03 11:27 ` Nguyen Thai Ngoc Duy
2012-10-03 15:44   ` Alexey Spiridonov
2012-10-07  3:33     ` Nguyen Thai Ngoc Duy
2012-10-12 21:35       ` Junio C Hamano
     [not found]         ` <7vlifb2tfp.fsf@alter.siamese.dyndns.org>
2012-11-05 22:55           ` Alexey Spiridonov
2012-11-14 22:50             ` Junio C Hamano

Code repositories for project(s) associated with this public inbox

	https://80x24.org/mirrors/git.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).