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

[Bug report] Crash when creating patch

From
JPJohannes Postler <johannes.postler@txture.io>
Date
Nov 4, 2020, 10:18 UTC
Message-ID
<CAO9fQ5pm2vCGrnj59QZg-fJ8VpnrsNoaVXRqd_Lsuw6rEaN3XQ@mail.gmail.com>

Dear git-team, I was trying to create a patch file of a commit to another directory. However, git crashed like that:

[josi@localhost typescript]$ git format-patch -1 236a9 --output=/home/josi/tmp/patches/txt-6117.patch 0001-Txture-Core-Implemented-whitelisting-for-groovy-scri.patch free(): invalid pointer Aborted (core dumped)

While I'm not entirely sure I interpreted the man page correctly, I think the crash shouldn't happen anyway.

I'm using git 2.28.0, but my colleague is experiencing the same issue with git 2.25.1. Please find attached the output of git bugreport and some more debug files that were collected by Fedora's ABRT. Please let me know if you need any other output of ABRT.

Best regards, johannes

Johannes Postler DevOps & Consulting

Txture - The Cloud Transformation Platform Grabenweg 68 A-6020 Innsbruck johannes.postler@txture.io www.txture.io

Thank you for filling out a Git bug report! Please answer the following questions to help us understand your issue.

What did you do before the bug happened? (Steps to reproduce your issue) I tried to create a patch file of a commit in another directory using the following command: [josi@localhost typescript]$ git format-patch -1 236a9 --output=/home/josi/tmp/patches/txt-6117.patch

What did you expect to happen? (Expected behavior) I expected a patch file at the location specified in --output

What happened instead? (Actual behavior) git crashed: 0001-Txture-Core-Implemented-whitelisting-for-groovy-scri.patch free(): invalid pointer Aborted (core dumped)

What's different between what you expected and what actually happened? I didn't expect the crash :D

Anything else you want to add:
I do have a full core dump recorded by ABRT (Fedora). Please let me know at johannes.postler@txture.io if you need thaThe following is the backtrace according to ABRT:
{   "signal": 6
,   "executable": "/usr/bin/git"
,   "stacktrace":
      [ {   "crash_thread": true
        ,   "frames":
              [ {   "address": 139721002875845
                ,   "build_id": "2602cd2de6dc672a5ec4378ace0b4a68ea5b13ea"
                ,   "build_id_offset": 252869
                ,   "function_name": "raise"
                ,   "file_name": "/lib64/libc.so.6"
                }
              , {   "address": 139721002780836
                ,   "build_id": "2602cd2de6dc672a5ec4378ace0b4a68ea5b13ea"
                ,   "build_id_offset": 157860
                ,   "function_name": "abort"
                ,   "file_name": "/lib64/libc.so.6"
                }
              , {   "address": 139721003147559
                ,   "build_id": "2602cd2de6dc672a5ec4378ace0b4a68ea5b13ea"
                ,   "build_id_offset": 524583
                ,   "function_name": "__libc_message"
                ,   "file_name": "/lib64/libc.so.6"
                }
              , {   "address": 139721003179548
                ,   "build_id": "2602cd2de6dc672a5ec4378ace0b4a68ea5b13ea"
                ,   "build_id_offset": 556572
                ,   "function_name": ".annobin_top_check.start"
                ,   "file_name": "/lib64/libc.so.6"
                }
              , {   "address": 139721003186412
                ,   "build_id": "2602cd2de6dc672a5ec4378ace0b4a68ea5b13ea"
                ,   "build_id_offset": 563436
                ,   "function_name": "_int_free"
                ,   "file_name": "/lib64/libc.so.6"
                }
              , {   "address": 139721003104931
                ,   "build_id": "2602cd2de6dc672a5ec4378ace0b4a68ea5b13ea"
                ,   "build_id_offset": 481955
                ,   "function_name": "fclose@@GLIBC_2.2.5"
                ,   "file_name": "/lib64/libc.so.6"
                }
              , {   "address": 94420595460270
                ,   "build_id": "ba2b8ad417de884d751cd7503b17e9ce357b2dcf"
                ,   "build_id_offset": 538798
                ,   "function_name": "cmd_format_patch"
                ,   "file_name": "/usr/bin/git"
                }
              , {   "address": 94420595060875
                ,   "build_id": "ba2b8ad417de884d751cd7503b17e9ce357b2dcf"
                ,   "build_id_offset": 139403
                ,   "function_name": "handle_builtin.lto_priv.0"
                ,   "file_name": "/usr/bin/git"
                }
              , {   "address": 94420595041051
                ,   "build_id": "ba2b8ad417de884d751cd7503b17e9ce357b2dcf"
                ,   "build_id_offset": 119579
                ,   "function_name": "main"
                ,   "file_name": "/usr/bin/git"
                } ]
        } ]
}

Please review the rest of the bug report below. You can delete any lines you don't wish to share.

[System Info] git version: git version 2.28.0 cpu: x86_64 no commit associated with this build sizeof-long: 8 sizeof-size_t: 8 shell-path: /bin/sh uname: Linux 5.8.16-300.fc33.x86_64 #1 SMP Mon Oct 19 13:18:33 UTC 2020 x86_64 compiler info: gnuc: 10.2 libc info: glibc: 2.32 $SHELL (typically, interactive shell): /bin/bash

[Enabled Hooks] applypatch-msg pre-applypatch post-applypatch pre-commit pre-merge-commit prepare-commit-msg commit-msg post-commit pre-rebase post-checkout post-merge pre-push pre-receive update post-receive post-update push-to-checkout pre-auto-gc post-rewrite sendemail-validate

Next: Jeff King
Message 1 of 17 in “[Bug report] Crash when creating patch”
  1. Johannes PostlerNov 4, 2020
  2. Jeff KingNov 4, 2020
  3. 1/3 format-patch: refactor output selectionJeff King, Nov 4, 2020
  4. Eric SunshineNov 4, 2020
  5. Jeff KingNov 4, 2020
  6. 2/3 format-patch: tie file-opening logic to output_directoryJeff King, Nov 4, 2020
  7. Eric SunshineNov 4, 2020
  8. 3/3 format-patch: support --output optionJeff King, Nov 4, 2020
  9. Eric SunshineNov 4, 2020
  10. Jeff KingNov 4, 2020
  11. Eric SunshineNov 4, 2020
  12. Junio C HamanoNov 4, 2020
  13. format-patch --outputJeff King, Nov 4, 2020
  14. 1/3 format-patch: refactor output selectionJeff King, Nov 4, 2020
  15. 2/3 format-patch: tie file-opening logic to output_directoryJeff King, Nov 4, 2020
  16. 3/3 format-patch: support --output optionJeff King, Nov 4, 2020
  17. Johannes PostlerNov 5, 2020

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.