{"thread":{"id":"24291","subject":"fatal: internal error in diff-resolve-rename-copy","startedAt":"2010-07-05T12:05:09Z","lastAt":"2010-07-07T08:13:44Z","messageCount":4,"participants":["Michael J Gruber","Alex Riesen"],"isPatch":false,"patchVersion":null,"patchTotal":null},"messages":[{"id":"144812","messageId":"4C31CA75.9010709@drmicha.warpmail.net","threadId":"24291","inReplyTo":null,"subject":"fatal: internal error in diff-resolve-rename-copy","fromName":"Michael J Gruber","fromEmail":"git@drmicha.warpmail.net","sentAt":"2010-07-05T12:05:09Z","receivedAt":"2010-07-05T12:05:09Z","isPatch":false,"sender":{"key":"git@grubix.eu","avatar":"https://avatars.githubusercontent.com/u/233215?v=4"},"body":"Hi there,\n\ncan someone help me with understanding or debugging the following? With\n\"log -p --stat\" I get that strange fatal error. (With GIT_FLUSH=0 it\nappears upfront.)\n\nWithout \"-p --stat\" the log is displayed without a fatal error (same 3\ncommits), but with \"-p\" or \"--stat\" (or both) it's fatal.\n\nI suspect the error is out right before the problematic commit, which is\nshown with an empty diffstat.\n\nI did this from a subdir, but the same happens from the root of the\nworktree.\n\ngit show on the last commit \"7896762\" shows the creation of a binary\nblob \"Formular_Lehrverpflichtung_SS09.odt\", and \"show --stat\" gives the\nexpected stat. What problem could log -p --stat have?\n\nMichael\n\nGIT_FLUSH=1 git log -p  --stat --follow   Formular\\ Lehrverpflichtung\\\nSS\\ 2009_FakIII.odt\ncommit b7a1918f2712fdd8f0de3fa08510ef5f2b9e4428\nAuthor: Michael J Gruber <gruber@m>\nDate:   Thu Feb 18 16:40:37 2010 +0100\n\n    clean up\n---\n .../Formular Lehrverpflichtung SS 2009_FakIII.odt  |  Bin 13951 ->\n13951 bytes\n 1 files changed, 0 insertions(+), 0 deletions(-)\n\ndiff --git a/Formular Lehrverpflichtung SS 2009_FakIII.odt\nb/LVVO/Formular Lehrverpflichtung SS 2009_FakIII.odt\nsimilarity index 100%\nrename from Formular Lehrverpflichtung SS 2009_FakIII.odt\nrename to LVVO/Formular Lehrverpflichtung SS 2009_FakIII.odt\n\ncommit 223e14515f1d2f50d0985e8b2d100e47e0bdde81\nAuthor: Michael J Gruber <gruber@m>\nDate:   Wed Jul 8 16:39:10 2009 +0200\n\n    make LVVO names uniform\n---\n ...> Formular Lehrverpflichtung SS 2009_FakIII.odt |  Bin 13951 ->\n13951 bytes\n 1 files changed, 0 insertions(+), 0 deletions(-)\n\ndiff --git a/Formular_Lehrverpflichtung_SS09.odt b/Formular\nLehrverpflichtung SS 2009_FakIII.odt\nsimilarity index 100%\nrename from Formular_Lehrverpflichtung_SS09.odt\nrename to Formular Lehrverpflichtung SS 2009_FakIII.odt\nfatal: internal error in diff-resolve-rename-copy\n\ncommit 78967623b839ec174e2ed3cb4bf30e27b4d38481\nAuthor: Michael J Gruber <gruber@m>\nDate:   Wed Jul 8 16:37:29 2009 +0200\n\n    Lehrverpflichtung SS09\n---\n"},{"id":"144836","messageId":"AANLkTimyZnvIs9XCwxKLxisum5KllXwrPygkCidC1CnH@mail.gmail.com","threadId":"24291","inReplyTo":"4C31CA75.9010709@drmicha.warpmail.net","subject":"Re: fatal: internal error in diff-resolve-rename-copy","fromName":"Alex Riesen","fromEmail":"raa.lkml@gmail.com","sentAt":"2010-07-05T18:20:18Z","receivedAt":"2010-07-05T18:20:18Z","isPatch":false,"sender":{"key":"raa.lkml@gmail.com","avatar":"https://avatars.githubusercontent.com/u/324101?v=4"},"body":"On Mon, Jul 5, 2010 at 14:05, Michael J Gruber <git@drmicha.warpmail.net> wrote:\n> can someone help me with understanding or debugging the following? With\n> \"log -p --stat\" I get that strange fatal error. (With GIT_FLUSH=0 it\n> appears upfront.)\n>\n> Without \"-p --stat\" the log is displayed without a fatal error (same 3\n> commits), but with \"-p\" or \"--stat\" (or both) it's fatal.\n\nCould you run the case under valgrind? (I suspect a corruption of diff\ndata structures)\n"},{"id":"144911","messageId":"4C3341EA.7070901@drmicha.warpmail.net","threadId":"24291","inReplyTo":"AANLkTimyZnvIs9XCwxKLxisum5KllXwrPygkCidC1CnH@mail.gmail.com","subject":"Re: fatal: internal error in diff-resolve-rename-copy","fromName":"Michael J Gruber","fromEmail":"git@drmicha.warpmail.net","sentAt":"2010-07-06T14:47:06Z","receivedAt":"2010-07-06T14:47:06Z","isPatch":false,"sender":{"key":"git@grubix.eu","avatar":"https://avatars.githubusercontent.com/u/233215?v=4"},"body":"Alex Riesen venit, vidit, dixit 05.07.2010 20:20:\n> On Mon, Jul 5, 2010 at 14:05, Michael J Gruber <git@drmicha.warpmail.net> wrote:\n>> can someone help me with understanding or debugging the following? With\n>> \"log -p --stat\" I get that strange fatal error. (With GIT_FLUSH=0 it\n>> appears upfront.)\n>>\n>> Without \"-p --stat\" the log is displayed without a fatal error (same 3\n>> commits), but with \"-p\" or \"--stat\" (or both) it's fatal.\n> \n> Could you run the case under valgrind? (I suspect a corruption of diff\n> data structures)\n\nI have zero experience with valgrind. Running the reported command with\nthe same suppressions as the test suite does, but with full leak check,\nI get the following report on stderr. Do you see anything suspicious in\nthere? Should I run valgrind with -v?\n\nMichael\n\n==3379== Memcheck, a memory error detector\n==3379== Copyright (C) 2002-2009, and GNU GPL'd, by Julian Seward et al.\n==3379== Using Valgrind-3.5.0 and LibVEX; rerun with -h for copyright info\n==3379== Command: git log --stat --follow LVVO/Formular\\\nLehrverpflichtung\\ SS\\ 2009_FakIII.odt\n==3379==\nfatal: internal error in diff-resolve-rename-copy\n==3379==\n==3379== HEAP SUMMARY:\n==3379==     in use at exit: 1,611,768 bytes in 148 blocks\n==3379==   total heap usage: 12,842 allocs, 12,694 frees, 29,235,398\nbytes allocated\n==3379==\n==3379== 4 bytes in 1 blocks are definitely lost in loss record 4 of 76\n==3379==    at 0x4A0515D: malloc (vg_replace_malloc.c:195)\n==3379==    by 0x311087FE01: strdup (in /lib64/libc-2.12.so)\n==3379==    by 0x4C3838: xstrdup (wrapper.c:22)\n==3379==    by 0x46BBE0: git_config_string (config.c:406)\n==3379==    by 0x46D082: git_config_from_file (config.c:185)\n==3379==    by 0x46D4D5: git_config (config.c:802)\n==3379==    by 0x491DAF: git_pager (pager.c:61)\n==3379==    by 0x491DF4: setup_pager (pager.c:76)\n==3379==    by 0x4041B8: handle_internal_command (git.c:262)\n==3379==    by 0x4043C1: main (git.c:467)\n==3379==\n{\n   <insert_a_suppression_name_here>\n   Memcheck:Leak\n   fun:malloc\n   fun:strdup\n   fun:xstrdup\n   fun:git_config_string\n   fun:git_config_from_file\n   fun:git_config\n   fun:git_pager\n   fun:setup_pager\n   fun:handle_internal_command\n   fun:main\n}\n==3379== 16 bytes in 1 blocks are possibly lost in loss record 13 of 76\n==3379==    at 0x4A0515D: malloc (vg_replace_malloc.c:195)\n==3379==    by 0x4C36E5: xmalloc (wrapper.c:34)\n==3379==    by 0x46A6CD: commit_list_insert (commit.c:320)\n==3379==    by 0x46B031: parse_commit_buffer (commit.c:272)\n==3379==    by 0x46B22F: parse_commit (commit.c:309)\n==3379==    by 0x4A9A2A: add_parents_to_list (revision.c:517)\n==3379==    by 0x4A9E40: get_revision_1 (revision.c:2016)\n==3379==    by 0x4A9EEA: get_revision_internal (revision.c:2121)\n==3379==    by 0x4AA150: get_revision (revision.c:2202)\n==3379==    by 0x4315DD: cmd_log_walk (log.c:264)\n==3379==    by 0x43172B: cmd_log (log.c:515)\n==3379==    by 0x4041E0: handle_internal_command (git.c:269)\n==3379==\n{\n   <insert_a_suppression_name_here>\n   Memcheck:Leak\n   fun:malloc\n   fun:xmalloc\n   fun:commit_list_insert\n   fun:parse_commit_buffer\n   fun:parse_commit\n   fun:add_parents_to_list\n   fun:get_revision_1\n   fun:get_revision_internal\n   fun:get_revision\n   fun:cmd_log_walk\n   fun:cmd_log\n   fun:handle_internal_command\n}\n==3379== 27 bytes in 1 blocks are definitely lost in loss record 25 of 76\n==3379==    at 0x4A0515D: malloc (vg_replace_malloc.c:195)\n==3379==    by 0x4A051D7: realloc (vg_replace_malloc.c:476)\n==3379==    by 0x4C364D: xrealloc (wrapper.c:80)\n==3379==    by 0x4B53C7: strbuf_grow (strbuf.c:70)\n==3379==    by 0x4B5733: strbuf_add (strbuf.c:183)\n==3379==    by 0x49406F: expand_user_path (path.c:328)\n==3379==    by 0x46C0C0: git_config_pathname (config.c:414)\n==3379==    by 0x46D082: git_config_from_file (config.c:185)\n==3379==    by 0x46D4D5: git_config (config.c:802)\n==3379==    by 0x491DAF: git_pager (pager.c:61)\n==3379==    by 0x491DF4: setup_pager (pager.c:76)\n==3379==    by 0x4041B8: handle_internal_command (git.c:262)\n==3379==\n{\n   <insert_a_suppression_name_here>\n   Memcheck:Leak\n   fun:malloc\n   fun:realloc\n   fun:xrealloc\n   fun:strbuf_grow\n   fun:strbuf_add\n   fun:expand_user_path\n   fun:git_config_pathname\n   fun:git_config_from_file\n   fun:git_config\n   fun:git_pager\n   fun:setup_pager\n   fun:handle_internal_command\n}\n==3379== 46 bytes in 1 blocks are definitely lost in loss record 33 of 76\n==3379==    at 0x4A0515D: malloc (vg_replace_malloc.c:195)\n==3379==    by 0x311087FE01: strdup (in /lib64/libc-2.12.so)\n==3379==    by 0x4C3838: xstrdup (wrapper.c:22)\n==3379==    by 0x4BD99F: diff_tree_sha1 (tree-diff.c:377)\n==3379==    by 0x4897EA: log_tree_commit (log-tree.c:542)\n==3379==    by 0x4315BA: cmd_log_walk (log.c:265)\n==3379==    by 0x43172B: cmd_log (log.c:515)\n==3379==    by 0x4041E0: handle_internal_command (git.c:269)\n==3379==    by 0x4043C1: main (git.c:467)\n==3379==\n{\n   <insert_a_suppression_name_here>\n   Memcheck:Leak\n   fun:malloc\n   fun:strdup\n   fun:xstrdup\n   fun:diff_tree_sha1\n   fun:log_tree_commit\n   fun:cmd_log_walk\n   fun:cmd_log\n   fun:handle_internal_command\n   fun:main\n}\n==3379== 51 bytes in 1 blocks are definitely lost in loss record 37 of 76\n==3379==    at 0x4A0515D: malloc (vg_replace_malloc.c:195)\n==3379==    by 0x4C36E5: xmalloc (wrapper.c:34)\n==3379==    by 0x4AD45F: prefix_path (setup.c:10)\n==3379==    by 0x4AD5EA: get_pathspec (setup.c:147)\n==3379==    by 0x4A8BD0: setup_revisions (revision.c:1594)\n==3379==    by 0x431113: cmd_log_init (log.c:78)\n==3379==    by 0x431723: cmd_log (log.c:514)\n==3379==    by 0x4041E0: handle_internal_command (git.c:269)\n==3379==    by 0x4043C1: main (git.c:467)\n==3379==\n{\n   <insert_a_suppression_name_here>\n   Memcheck:Leak\n   fun:malloc\n   fun:xmalloc\n   fun:prefix_path\n   fun:get_pathspec\n   fun:setup_revisions\n   fun:cmd_log_init\n   fun:cmd_log\n   fun:handle_internal_command\n   fun:main\n}\n==3379== 65 bytes in 1 blocks are definitely lost in loss record 40 of 76\n==3379==    at 0x4A0515D: malloc (vg_replace_malloc.c:195)\n==3379==    by 0x4A051D7: realloc (vg_replace_malloc.c:476)\n==3379==    by 0x4C364D: xrealloc (wrapper.c:80)\n==3379==    by 0x4B53C7: strbuf_grow (strbuf.c:70)\n==3379==    by 0x4B5B5A: strbuf_addf (strbuf.c:201)\n==3379==    by 0x4816DF: system_path (exec_cmd.c:37)\n==3379==    by 0x481801: setup_path (exec_cmd.c:104)\n==3379==    by 0x4043B0: main (git.c:533)\n==3379==\n{\n   <insert_a_suppression_name_here>\n   Memcheck:Leak\n   fun:malloc\n   fun:realloc\n   fun:xrealloc\n   fun:strbuf_grow\n   fun:strbuf_addf\n   fun:system_path\n   fun:setup_path\n   fun:main\n}\n==3379== 192 bytes in 1 blocks are definitely lost in loss record 56 of 76\n==3379==    at 0x4A0515D: malloc (vg_replace_malloc.c:195)\n==3379==    by 0x4A051D7: realloc (vg_replace_malloc.c:476)\n==3379==    by 0x4C364D: xrealloc (wrapper.c:80)\n==3379==    by 0x476812: diff_q (diff.c:3297)\n==3379==    by 0x476869: diff_queue (diff.c:3311)\n==3379==    by 0x477125: diff_addremove (diff.c:4150)\n==3379==    by 0x4BD082: show_entry (tree-diff.c:255)\n==3379==    by 0x4BD168: show_entry (tree-diff.c:217)\n==3379==    by 0x4BD4A5: diff_tree (tree-diff.c:299)\n==3379==    by 0x4BD79A: diff_tree_sha1 (tree-diff.c:414)\n==3379==    by 0x4897EA: log_tree_commit (log-tree.c:542)\n==3379==    by 0x4315BA: cmd_log_walk (log.c:265)\n==3379==\n{\n   <insert_a_suppression_name_here>\n   Memcheck:Leak\n   fun:malloc\n   fun:realloc\n   fun:xrealloc\n   fun:diff_q\n   fun:diff_queue\n   fun:diff_addremove\n   fun:show_entry\n   fun:show_entry\n   fun:diff_tree\n   fun:diff_tree_sha1\n   fun:log_tree_commit\n   fun:cmd_log_walk\n}\n==3379== 384 bytes in 2 blocks are definitely lost in loss record 58 of 76\n==3379==    at 0x4A0515D: malloc (vg_replace_malloc.c:195)\n==3379==    by 0x4A051D7: realloc (vg_replace_malloc.c:476)\n==3379==    by 0x4C364D: xrealloc (wrapper.c:80)\n==3379==    by 0x476812: diff_q (diff.c:3297)\n==3379==    by 0x476869: diff_queue (diff.c:3311)\n==3379==    by 0x477125: diff_addremove (diff.c:4150)\n==3379==    by 0x4BD082: show_entry (tree-diff.c:255)\n==3379==    by 0x4BD4A5: diff_tree (tree-diff.c:299)\n==3379==    by 0x4BD79A: diff_tree_sha1 (tree-diff.c:414)\n==3379==    by 0x4897EA: log_tree_commit (log-tree.c:542)\n==3379==    by 0x4315BA: cmd_log_walk (log.c:265)\n==3379==    by 0x43172B: cmd_log (log.c:515)\n==3379==\n{\n   <insert_a_suppression_name_here>\n   Memcheck:Leak\n   fun:malloc\n   fun:realloc\n   fun:xrealloc\n   fun:diff_q\n   fun:diff_queue\n   fun:diff_addremove\n   fun:show_entry\n   fun:diff_tree\n   fun:diff_tree_sha1\n   fun:log_tree_commit\n   fun:cmd_log_walk\n   fun:cmd_log\n}\n==3379== 545 bytes in 2 blocks are possibly lost in loss record 60 of 76\n==3379==    at 0x4A0515D: malloc (vg_replace_malloc.c:195)\n==3379==    by 0x4C36E5: xmalloc (wrapper.c:34)\n==3379==    by 0x4C377E: xmallocz (wrapper.c:56)\n==3379==    by 0x4AE627: unpack_sha1_file (sha1_file.c:1170)\n==3379==    by 0x4B2200: read_object (sha1_file.c:2074)\n==3379==    by 0x4B226E: read_sha1_file_repl (sha1_file.c:2088)\n==3379==    by 0x46B1E7: parse_commit (cache.h:721)\n==3379==    by 0x4A9A2A: add_parents_to_list (revision.c:517)\n==3379==    by 0x4A9E40: get_revision_1 (revision.c:2016)\n==3379==    by 0x4A9EEA: get_revision_internal (revision.c:2121)\n==3379==    by 0x4AA150: get_revision (revision.c:2202)\n==3379==    by 0x4315DD: cmd_log_walk (log.c:264)\n==3379==\n{\n   <insert_a_suppression_name_here>\n   Memcheck:Leak\n   fun:malloc\n   fun:xmalloc\n   fun:xmallocz\n   fun:unpack_sha1_file\n   fun:read_object\n   fun:read_sha1_file_repl\n   fun:parse_commit\n   fun:add_parents_to_list\n   fun:get_revision_1\n   fun:get_revision_internal\n   fun:get_revision\n   fun:cmd_log_walk\n}\n==3379== LEAK SUMMARY:\n==3379==    definitely lost: 769 bytes in 8 blocks\n==3379==    indirectly lost: 0 bytes in 0 blocks\n==3379==      possibly lost: 561 bytes in 3 blocks\n==3379==    still reachable: 1,610,438 bytes in 137 blocks\n==3379==         suppressed: 0 bytes in 0 blocks\n==3379== Reachable blocks (those to which a pointer was found) are not\nshown.\n==3379== To see them, rerun with: --leak-check=full --show-reachable=yes\n==3379==\n==3379== For counts of detected and suppressed errors, rerun with: -v\n==3379== ERROR SUMMARY: 9 errors from 9 contexts (suppressed: 6 from 6)\n"},{"id":"145009","messageId":"AANLkTimoNMYgP8-Wv0xZG0Ge7LpDZHblKSop8bozdfjY@mail.gmail.com","threadId":"24291","inReplyTo":"4C3341EA.7070901@drmicha.warpmail.net","subject":"Re: fatal: internal error in diff-resolve-rename-copy","fromName":"Alex Riesen","fromEmail":"raa.lkml@gmail.com","sentAt":"2010-07-07T08:13:44Z","receivedAt":"2010-07-07T08:13:44Z","isPatch":false,"sender":{"key":"raa.lkml@gmail.com","avatar":"https://avatars.githubusercontent.com/u/324101?v=4"},"body":"On Tue, Jul 6, 2010 at 16:47, Michael J Gruber <git@drmicha.warpmail.net> wrote:\n> Alex Riesen venit, vidit, dixit 05.07.2010 20:20:\n>> On Mon, Jul 5, 2010 at 14:05, Michael J Gruber <git@drmicha.warpmail.net> wrote:\n>>> can someone help me with understanding or debugging the following? With\n>>> \"log -p --stat\" I get that strange fatal error. (With GIT_FLUSH=0 it\n>>> appears upfront.)\n>>>\n>>> Without \"-p --stat\" the log is displayed without a fatal error (same 3\n>>> commits), but with \"-p\" or \"--stat\" (or both) it's fatal.\n>>\n>> Could you run the case under valgrind? (I suspect a corruption of diff\n>> data structures)\n>\n> I have zero experience with valgrind. Running the reported command with\n> the same suppressions as the test suite does, but with full leak check,\n> I get the following report on stderr. Do you see anything suspicious in\n> there? Should I run valgrind with -v?\n\nNo, I afraid it wont help. Memory access errors are always reported and these\n(\"use of uninitialized value\", in particular) were what I hoped to see here.\n\nIn this case something left the diff_filepair unset after allocation (hence the\n\"internal error\". Should have been \"Oops, we have a bug\"): value 0 (as\nseen in the check_pair_status, where the message comes from) is just\nwhat the structure gets initialized by allocation.\n\nUnless the repository is private (otherwise I'd like to take a look at it),\nI'd suggest to put a breakpoint at the message point and try to figure\nout how come the diff_filepair->status was left unset or why the diff\ncode is interested in its value (maybe it shouldn't be, in this case).\n"}]}