From mboxrd@z Thu Jan 1 00:00:00 1970 From: Alexey Spiridonov Subject: "git am" crash (builtin/apply.c:2108) + small repro Date: Mon, 1 Oct 2012 11:33:42 -0700 Message-ID: Mime-Version: 1.0 Content-Type: multipart/mixed; boundary=20cf303b3eb31eb0ae04cb03a536 To: git@vger.kernel.org X-From: git-owner@vger.kernel.org Mon Oct 01 20:34:07 2012 Return-path: Envelope-to: gcvg-git-2@plane.gmane.org Received: from vger.kernel.org ([209.132.180.67]) by plane.gmane.org with esmtp (Exim 4.69) (envelope-from ) id 1TIkoV-0002xf-Ha for gcvg-git-2@plane.gmane.org; Mon, 01 Oct 2012 20:33:55 +0200 Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751705Ab2JASdo (ORCPT ); Mon, 1 Oct 2012 14:33:44 -0400 Received: from mail-qa0-f46.google.com ([209.85.216.46]:62640 "EHLO mail-qa0-f46.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751922Ab2JASdn (ORCPT ); Mon, 1 Oct 2012 14:33:43 -0400 Received: by mail-qa0-f46.google.com with SMTP id c26so118962qad.19 for ; Mon, 01 Oct 2012 11:33:42 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:date:message-id:subject:from:to:content-type; bh=CZtJcSICS+Yn47Gv2p9IiMpPCrbzj0y7d8+sGLM/lmc=; b=gOUORILM8WTTFl31RpHvjGRwLS9PekHI15Oq6YK8K+MHnd7foXAhGuaTWwEbMq3hyc N0bFi6y0VXVUlnhwqDyYbKkX2bJbubkCZioCV8Cr0dvBbkIRHUc2qwCic4KRkopcwYr/ ypDeyHY5S/ImEDb9X6axG3eaVCzm/t34vsMnz70b0QzoHUBg94CPel91Eq1vST29HBTV 2SauSNK6sUXgNCk7999rYkiPZumW7wPo0qx6JpWRDUgUmH9NThuLcffF5okDFY2ARX/y UXWYObaPmVVZ7dnY8uC7seAJDwX+ONZSY4RvG/bMCvQ+9C6PY3ns0mT0PUZpNjhC4otW xRGw== Received: by 10.224.181.198 with SMTP id bz6mr37263714qab.97.1349116422434; Mon, 01 Oct 2012 11:33:42 -0700 (PDT) Received: by 10.49.95.225 with HTTP; Mon, 1 Oct 2012 11:33:42 -0700 (PDT) Sender: git-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: git@vger.kernel.org Archived-At: --20cf303b3eb31eb0ae04cb03a536 Content-Type: text/plain; charset=ISO-8859-1 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 --20cf303b3eb31eb0ae04cb03a536 Content-Type: application/octet-stream; name="crashy.patch" Content-Disposition: attachment; filename="crashy.patch" Content-Transfer-Encoding: base64 X-Attachment-Id: f_h7rwv4yf0 RnJvbSBhYjM3NmExZDc2YjE2MDU0NDNiNGQ3ZWI5MTk3YmUzMzNiMDM3ZjE2IE1vbiBTZXAgMTcg MDA6MDA6MDAgMjAwMQpGcm9tOiBsZXNoYSA8c25hcmttYXN0ZXJAZ21haWwuY29tPgpEYXRlOiBX ZWQsIDI2IFNlcCAyMDEyIDEwOjU4OjQzIC0wNzAwClN1YmplY3Q6IEdpdCBjcmFzaCBidWcKCi0t LQoKZGlmZiAtLWdpdCBhL21lZXAvc3BvcmsvX19pbml0X18ucHkgYi9tZWVwL3Nwb3JrL19faW5p dF9fLnB5CmluZGV4IDlkODY5YzkuLmVmMTIwYzcgMTAwNjQ0Ci0tLSBhL21lZXAvc3BvcmsvX19p bml0X18ucHkKKysrIGIvbWVlcC9zcG9yay9fX2luaXRfXy5weQpAQCAtMSw3ICsxLDkgQEAKIGZy b20gX19mdXR1cmVfXyBpbXBvcnQgYWJzb2x1dGVfaW1wb3J0CiAKK2Zyb20gYmFyIGltcG9ydCBC b28KKwogZnJvbSAuYmF6IGltcG9ydCBCb3JrCiAKLUJvby5tb29Gb29Db3coQm9yaykKK0Jvby5t b29Db3coQm9yaykKICAgCiAgIApcIE5vIG5ld2xpbmUgYXQgZW5kIG9mIGZpbGUK --20cf303b3eb31eb0ae04cb03a536 Content-Type: application/octet-stream; name="__init__.py" Content-Disposition: attachment; filename="__init__.py" Content-Transfer-Encoding: base64 X-Attachment-Id: f_h7rwv97p1 ZnJvbSBfX2Z1dHVyZV9fIGltcG9ydCBhYnNvbHV0ZV9pbXBvcnQKCmZyb20gLmJheiBpbXBvcnQg Qm9yawoKQm9vLm1vb0Zvb0NvdyhCb3JrKQoK --20cf303b3eb31eb0ae04cb03a536--