{"thread":{"id":"27089","subject":"Intermittent Failures in t1450-fsck","startedAt":"2011-04-13T17:11:59Z","lastAt":"2011-05-11T11:43:47Z","messageCount":10,"participants":["Brian Gernhardt","Jeff King"],"isPatch":false,"patchVersion":null,"patchTotal":null},"messages":[{"id":"165759","messageId":"115C364B-E910-4A9C-949E-3B10E5E6116C@silverinsanity.com","threadId":"27089","inReplyTo":null,"subject":"Intermittent Failures in t1450-fsck","fromName":"Brian Gernhardt","fromEmail":"benji@silverinsanity.com","sentAt":"2011-04-13T17:11:59Z","receivedAt":"2011-04-13T17:11:59Z","isPatch":false,"sender":{"key":"benji@silverinsanity.com","avatar":"https://gravatar.com/avatar/e06c101dbc25c68114d859b4a9ec7cf8a2c52fd2b0270ef0eac0e2e63ff22311?d=mp&s=160"},"body":"t1450-fsck fails in test 10 \"tag pointing to something else than its type\", but only if I run it as part of the full test suite (with either `make test` or `make prove`).  If I run the test separately, it passes.\n\nThe output from running with GIT_TEST_OPTS=\"-v\" is:\n\nexpecting success: \n\tsha=$(echo blob | git hash-object -w --stdin) &&\n\ttest_when_finished \"remove_object $sha\" &&\n\tcat >wrong-tag <<-EOF &&\n\tobject $sha\n\ttype commit\n\ttag wrong\n\ttagger T A Gger <tagger@example.com> 1234567890 -0000\n\n\tThis is an invalid tag.\n\tEOF\n\n\ttag=$(git hash-object -t tag -w --stdin <wrong-tag) &&\n\ttest_when_finished \"remove_object $tag\" &&\n\techo $tag >.git/refs/tags/wrong &&\n\ttest_when_finished \"git update-ref -d refs/tags/wrong\" &&\n\ttest_must_fail git fsck --tags 2>out &&\n\tcat out &&\n\tgrep \"error in tag.*broken links\" out\n\ntagged commit 63499e4ea8e096b831515ceb1d5a7593e4d87ae5 (wrong) in 66f6581d549f70e05ca586bc2df5c15a95662c36\nmissing commit 63499e4ea8e096b831515ceb1d5a7593e4d87ae5\nerror: Object 63499e4ea8e096b831515ceb1d5a7593e4d87ae5 is a commit, not a blob\nerror: 63499e4ea8e096b831515ceb1d5a7593e4d87ae5: object corrupt or missing\nnot ok - 10 tag pointing to something else than its type\n"},{"id":"167084","messageId":"2838BCC7-FB14-401B-9498-D0FB78C98D91@silverinsanity.com","threadId":"27089","inReplyTo":"115C364B-E910-4A9C-949E-3B10E5E6116C@silverinsanity.com","subject":"Re: Intermittent Failures in t1450-fsck (Bisected)","fromName":"Brian Gernhardt","fromEmail":"benji@silverinsanity.com","sentAt":"2011-05-05T06:46:52Z","receivedAt":"2011-05-05T06:46:52Z","isPatch":false,"sender":{"key":"benji@silverinsanity.com","avatar":"https://gravatar.com/avatar/e06c101dbc25c68114d859b4a9ec7cf8a2c52fd2b0270ef0eac0e2e63ff22311?d=mp&s=160"},"body":"I finally managed to pin down what triggers the bug and bisect it to its beginning.\n\nI see this failure only when the test suite is run in parallel.  (make -j or -j in GIT_PROVE_OPTS)\n\nThe bug starts happening in \"e96c19c: config: support values longer than 1023 bytes\".\n\nI have no idea why this commit causes failures in a test for fsck, but commits before it were merged work and commits after do not.  (Its direct ancestors work as well.)  Even more telling, reverting it on top of next causes the test to pass again.\n\n~~ Brian\n\nOn Apr 13, 2011, at 1:11 PM, Brian Gernhardt wrote:\n\n> t1450-fsck fails in test 10 \"tag pointing to something else than its type\", but only if I run it as part of the full test suite (with either `make test` or `make prove`).  If I run the test separately, it passes.\n> \n> The output from running with GIT_TEST_OPTS=\"-v\" is:\n> \n> expecting success: \n> \tsha=$(echo blob | git hash-object -w --stdin) &&\n> \ttest_when_finished \"remove_object $sha\" &&\n> \tcat >wrong-tag <<-EOF &&\n> \tobject $sha\n> \ttype commit\n> \ttag wrong\n> \ttagger T A Gger <tagger@example.com> 1234567890 -0000\n> \n> \tThis is an invalid tag.\n> \tEOF\n> \n> \ttag=$(git hash-object -t tag -w --stdin <wrong-tag) &&\n> \ttest_when_finished \"remove_object $tag\" &&\n> \techo $tag >.git/refs/tags/wrong &&\n> \ttest_when_finished \"git update-ref -d refs/tags/wrong\" &&\n> \ttest_must_fail git fsck --tags 2>out &&\n> \tcat out &&\n> \tgrep \"error in tag.*broken links\" out\n> \n> tagged commit 63499e4ea8e096b831515ceb1d5a7593e4d87ae5 (wrong) in 66f6581d549f70e05ca586bc2df5c15a95662c36\n> missing commit 63499e4ea8e096b831515ceb1d5a7593e4d87ae5\n> error: Object 63499e4ea8e096b831515ceb1d5a7593e4d87ae5 is a commit, not a blob\n> error: 63499e4ea8e096b831515ceb1d5a7593e4d87ae5: object corrupt or missing\n> not ok - 10 tag pointing to something else than its type\n> \n> --\n> To unsubscribe from this list: send the line \"unsubscribe git\" in\n> the body of a message to majordomo@vger.kernel.org\n> More majordomo info at  http://vger.kernel.org/majordomo-info.html\n"},{"id":"167099","messageId":"20110505093226.GA29595@sigill.intra.peff.net","threadId":"27089","inReplyTo":"2838BCC7-FB14-401B-9498-D0FB78C98D91@silverinsanity.com","subject":"Re: Intermittent Failures in t1450-fsck (Bisected)","fromName":"Jeff King","fromEmail":"peff@peff.net","sentAt":"2011-05-05T09:32:26Z","receivedAt":"2011-05-05T09:32:26Z","isPatch":false,"sender":{"key":"peff@peff.net","avatar":"https://avatars.githubusercontent.com/u/45925?v=4"},"body":"On Thu, May 05, 2011 at 02:46:52AM -0400, Brian Gernhardt wrote:\n\n> I finally managed to pin down what triggers the bug and bisect it to\n> its beginning.\n> \n> I see this failure only when the test suite is run in parallel.  (make\n> -j or -j in GIT_PROVE_OPTS)\n> \n> The bug starts happening in \"e96c19c: config: support values longer than 1023 bytes\".\n\nI'm slightly confused. Commit e96c19c predates the test that you\nreported as failing here:\n\n> > t1450-fsck fails in test 10 \"tag pointing to something else than its type\", but only if I run it as part of the full test suite (with either `make test` or `make prove`).  If I run the test separately, it passes.\n> > \n> > The output from running with GIT_TEST_OPTS=\"-v\" is:\n> > \n> > expecting success: \n> > \tsha=$(echo blob | git hash-object -w --stdin) &&\n> > \ttest_when_finished \"remove_object $sha\" &&\n> > \tcat >wrong-tag <<-EOF &&\n> > \tobject $sha\n> > \ttype commit\n> > \ttag wrong\n> > \ttagger T A Gger <tagger@example.com> 1234567890 -0000\n> > \n> > \tThis is an invalid tag.\n> > \tEOF\n> > \n> > \ttag=$(git hash-object -t tag -w --stdin <wrong-tag) &&\n> > \ttest_when_finished \"remove_object $tag\" &&\n> > \techo $tag >.git/refs/tags/wrong &&\n> > \ttest_when_finished \"git update-ref -d refs/tags/wrong\" &&\n> > \ttest_must_fail git fsck --tags 2>out &&\n> > \tcat out &&\n> > \tgrep \"error in tag.*broken links\" out\n> > \n> > tagged commit 63499e4ea8e096b831515ceb1d5a7593e4d87ae5 (wrong) in 66f6581d549f70e05ca586bc2df5c15a95662c36\n> > missing commit 63499e4ea8e096b831515ceb1d5a7593e4d87ae5\n> > error: Object 63499e4ea8e096b831515ceb1d5a7593e4d87ae5 is a commit, not a blob\n> > error: 63499e4ea8e096b831515ceb1d5a7593e4d87ae5: object corrupt or missing\n> > not ok - 10 tag pointing to something else than its type\n\nSo how did you bisect down to it? You said reverting e96c19c fixes it,\nwhich does seem like strong evidence, but what I am wondering is if a\n_different_ test in t1450 fails at e96c19c. That would point to\nsomething else funny going on.\n\nDouble weird is that my output for t1450.10 is totally different from\nthat.  Which commit are you testing on?\n\nGiven that the problem seems racy and intermittent, have you tried\nrunning under valgrind?\n\n-Peff\n"},{"id":"167176","messageId":"60194977-A4A9-4E18-9878-C1CDE77B75C2@silverinsanity.com","threadId":"27089","inReplyTo":"20110505093226.GA29595@sigill.intra.peff.net","subject":"Re: Intermittent Failures in t1450-fsck (Bisected)","fromName":"Brian Gernhardt","fromEmail":"benji@silverinsanity.com","sentAt":"2011-05-05T20:04:33Z","receivedAt":"2011-05-05T20:04:33Z","isPatch":false,"sender":{"key":"benji@silverinsanity.com","avatar":"https://gravatar.com/avatar/e06c101dbc25c68114d859b4a9ec7cf8a2c52fd2b0270ef0eac0e2e63ff22311?d=mp&s=160"},"body":"\nOn May 5, 2011, at 5:32 AM, Jeff King wrote:\n\n> On Thu, May 05, 2011 at 02:46:52AM -0400, Brian Gernhardt wrote:\n>>> t1450-fsck fails in test 10 \"tag pointing to something else than its type\", but only if I run it as part of the full test suite (with either `make test` or `make prove`).  If I run the test separately, it passes.\n>>> \n>>> The output from running with GIT_TEST_OPTS=\"-v\" is:\n>>> \n>>> expecting success: \n>>> \tsha=$(echo blob | git hash-object -w --stdin) &&\n>>> \ttest_when_finished \"remove_object $sha\" &&\n>>> \tcat >wrong-tag <<-EOF &&\n>>> \tobject $sha\n>>> \ttype commit\n>>> \ttag wrong\n>>> \ttagger T A Gger <tagger@example.com> 1234567890 -0000\n>>> \n>>> \tThis is an invalid tag.\n>>> \tEOF\n>>> \n>>> \ttag=$(git hash-object -t tag -w --stdin <wrong-tag) &&\n>>> \ttest_when_finished \"remove_object $tag\" &&\n>>> \techo $tag >.git/refs/tags/wrong &&\n>>> \ttest_when_finished \"git update-ref -d refs/tags/wrong\" &&\n>>> \ttest_must_fail git fsck --tags 2>out &&\n>>> \tcat out &&\n>>> \tgrep \"error in tag.*broken links\" out\n>>> \n>>> tagged commit 63499e4ea8e096b831515ceb1d5a7593e4d87ae5 (wrong) in 66f6581d549f70e05ca586bc2df5c15a95662c36\n>>> missing commit 63499e4ea8e096b831515ceb1d5a7593e4d87ae5\n>>> error: Object 63499e4ea8e096b831515ceb1d5a7593e4d87ae5 is a commit, not a blob\n>>> error: 63499e4ea8e096b831515ceb1d5a7593e4d87ae5: object corrupt or missing\n>>> not ok - 10 tag pointing to something else than its type\n> \n> So how did you bisect down to it? You said reverting e96c19c fixes it,\n> which does seem like strong evidence, but what I am wondering is if a\n> _different_ test in t1450 fails at e96c19c. That would point to\n> something else funny going on.\n\nI actually bisected the test failure to \"c5a5f12e: Merge branch 'ef/maint-strbuf-init'\", and then rebased e96c19c on top of 2a2dbd2 to see what actually caused the error.  I re-ran it like this again today and got the exact same error.\n\n> Double weird is that my output for t1450.10 is totally different from\n> that.  Which commit are you testing on?\n\nThe original e-mail was from next at that point.  The output from the rebased version and current next (76e37e2) is identical.\n\n> Given that the problem seems racy and intermittent, have you tried\n> running under valgrind?\n\nThis is on my OS X laptop and last I knew valgrind was very buggy on OS X, so I've never tried it.  I'll install it now and see if I can get anything useful out of it.\n\n~~ Brian"},{"id":"167188","messageId":"20110505210317.GE1770@sigill.intra.peff.net","threadId":"27089","inReplyTo":"60194977-A4A9-4E18-9878-C1CDE77B75C2@silverinsanity.com","subject":"Re: Intermittent Failures in t1450-fsck (Bisected)","fromName":"Jeff King","fromEmail":"peff@peff.net","sentAt":"2011-05-05T21:03:17Z","receivedAt":"2011-05-05T21:03:17Z","isPatch":false,"sender":{"key":"peff@peff.net","avatar":"https://avatars.githubusercontent.com/u/45925?v=4"},"body":"On Thu, May 05, 2011 at 04:04:33PM -0400, Brian Gernhardt wrote:\n\n> The original e-mail was from next at that point.  The output from the\n> rebased version and current next (76e37e2) is identical.\n\nThanks. The weird thing is that running t1450 on 76e37e2 gives me this\noutput:\n\nbroken link from     tag 66f6581d549f70e05ca586bc2df5c15a95662c36\nbroken link from unknown unknown\ndangling blob 63499e4ea8e096b831515ceb1d5a7593e4d87ae5\nerror: Object 63499e4ea8e096b831515ceb1d5a7593e4d87ae5 is a blob, not a commit\nerror in tag 66f6581d549f70e05ca586bc2df5c15a95662c36: broken links\nerror in tag 66f6581d549f70e05ca586bc2df5c15a95662c36: could not load tagged object\nerror in tag 66f6581d549f70e05ca586bc2df5c15a95662c36: broken links\n\nwhereas from your original email, you had:\n\n> >>> tagged commit 63499e4ea8e096b831515ceb1d5a7593e4d87ae5 (wrong) in 66f6581d549f70e05ca586bc2df5c15a95662c36\n> >>> missing commit 63499e4ea8e096b831515ceb1d5a7593e4d87ae5\n> >>> error: Object 63499e4ea8e096b831515ceb1d5a7593e4d87ae5 is a commit, not a blob\n> >>> error: 63499e4ea8e096b831515ceb1d5a7593e4d87ae5: object corrupt or missing\n\nwhich is weird. We do call \"remove_object $sha\", but only inside\ntest_when_finished. I wonder if there is some bug with\ntest_when_finished on your platform. Have you tried instrumenting the\nremove_object function to print a message when it is run? That might\ngive us a clue if it is accidentally being run early.\n\n> This is on my OS X laptop and last I knew valgrind was very buggy on\n> OS X, so I've never tried it.  I'll install it now and see if I can\n> get anything useful out of it.\n\nI've tried but been unable to reproduce on Linux, so it seems like\nsomething OS X specific.\n\n-Peff\n"},{"id":"167190","messageId":"1A288BE9-F001-4CAD-8A89-4B4D6F0F246B@silverinsanity.com","threadId":"27089","inReplyTo":"60194977-A4A9-4E18-9878-C1CDE77B75C2@silverinsanity.com","subject":"Re: Intermittent Failures in t1450-fsck (Bisected)","fromName":"Brian Gernhardt","fromEmail":"benji@silverinsanity.com","sentAt":"2011-05-05T21:07:54Z","receivedAt":"2011-05-05T21:07:54Z","isPatch":false,"sender":{"key":"benji@silverinsanity.com","avatar":"https://gravatar.com/avatar/e06c101dbc25c68114d859b4a9ec7cf8a2c52fd2b0270ef0eac0e2e63ff22311?d=mp&s=160"},"body":"\nOn May 5, 2011, at 4:04 PM, Brian Gernhardt wrote:\n\n> On May 5, 2011, at 5:32 AM, Jeff King wrote:\n> \n>> Given that the problem seems racy and intermittent, have you tried\n>> running under valgrind?\n> \n> This is on my OS X laptop and last I knew valgrind was very buggy on OS X, so I've never tried it.  I'll install it now and see if I can get anything useful out of it.\n\nI will note the test _reliably_ fails when run in parallel with other tests.\n\nUnder valgrind I get the following error.  I will note that attempting to run the full test suite with valgrind gives lots of similar errors in many tests.  (All conditional jump in deflate, allocated in write_loose_object.)\n\n==14187== Conditional jump or move depends on uninitialised value(s)\n==14187==    at 0x100209B3B: deflateEnd (in /usr/lib/libz.1.2.3.dylib)\n==14187==    by 0x10020ABF6: deflateSetDictionary (in /usr/lib/libz.1.2.3.dylib)\n==14187==    by 0x10020B914: deflate (in /usr/lib/libz.1.2.3.dylib)\n==14187==    by 0x1000FA631: write_loose_object (in /Users/brian/dev/git/t/valgrind/../../git)\n==14187==    by 0x1000FA8C8: write_sha1_file (in /Users/brian/dev/git/t/valgrind/../../git)\n==14187==    by 0x1000FACFB: index_mem (in /Users/brian/dev/git/t/valgrind/../../git)\n==14187==    by 0x1000FAE95: index_fd (in /Users/brian/dev/git/t/valgrind/../../git)\n==14187==    by 0x100038258: hash_fd (in /Users/brian/dev/git/t/valgrind/../../git)\n==14187==    by 0x1000386AA: cmd_hash_object (in /Users/brian/dev/git/t/valgrind/../../git)\n==14187==    by 0x1000016BC: run_builtin (in /Users/brian/dev/git/t/valgrind/../../git)\n==14187==    by 0x10000186E: handle_internal_command (in /Users/brian/dev/git/t/valgrind/../../git)\n==14187==    by 0x10000195F: run_argv (in /Users/brian/dev/git/t/valgrind/../../git)\n==14187==  Uninitialised value was created by a heap allocation\n==14187==    at 0x1001F5345: malloc (vg_replace_malloc.c:236)\n==14187==    by 0x10020A0FB: deflateInit2_ (in /usr/lib/libz.1.2.3.dylib)\n==14187==    by 0x10020A264: deflateInit_ (in /usr/lib/libz.1.2.3.dylib)\n==14187==    by 0x1000FA588: write_loose_object (in /Users/brian/dev/git/t/valgrind/../../git)\n==14187==    by 0x1000FA8C8: write_sha1_file (in /Users/brian/dev/git/t/valgrind/../../git)\n==14187==    by 0x1000FACFB: index_mem (in /Users/brian/dev/git/t/valgrind/../../git)\n==14187==    by 0x1000FAE95: index_fd (in /Users/brian/dev/git/t/valgrind/../../git)\n==14187==    by 0x100038258: hash_fd (in /Users/brian/dev/git/t/valgrind/../../git)\n==14187==    by 0x1000386AA: cmd_hash_object (in /Users/brian/dev/git/t/valgrind/../../git)\n==14187==    by 0x1000016BC: run_builtin (in /Users/brian/dev/git/t/valgrind/../../git)\n==14187==    by 0x10000186E: handle_internal_command (in /Users/brian/dev/git/t/valgrind/../../git)\n==14187==    by 0x10000195F: run_argv (in /Users/brian/dev/git/t/valgrind/../../git)\n==14187== \n{\n   <insert_a_suppression_name_here>\n   Memcheck:Cond\n   fun:deflateEnd\n   fun:deflateSetDictionary\n   fun:deflate\n   fun:write_loose_object\n   fun:write_sha1_file\n   fun:index_mem\n   fun:index_fd\n   fun:hash_fd\n   fun:cmd_hash_object\n   fun:run_builtin\n   fun:handle_internal_command\n   fun:run_argv\n}\n"},{"id":"167191","messageId":"20110505211736.GA7256@sigill.intra.peff.net","threadId":"27089","inReplyTo":"1A288BE9-F001-4CAD-8A89-4B4D6F0F246B@silverinsanity.com","subject":"Re: Intermittent Failures in t1450-fsck (Bisected)","fromName":"Jeff King","fromEmail":"peff@peff.net","sentAt":"2011-05-05T21:17:36Z","receivedAt":"2011-05-05T21:17:36Z","isPatch":false,"sender":{"key":"peff@peff.net","avatar":"https://avatars.githubusercontent.com/u/45925?v=4"},"body":"On Thu, May 05, 2011 at 05:07:54PM -0400, Brian Gernhardt wrote:\n\n> On May 5, 2011, at 4:04 PM, Brian Gernhardt wrote:\n> \n> > On May 5, 2011, at 5:32 AM, Jeff King wrote:\n> > \n> >> Given that the problem seems racy and intermittent, have you tried\n> >> running under valgrind?\n> > \n> > This is on my OS X laptop and last I knew valgrind was very buggy on OS X, so I've never tried it.  I'll install it now and see if I can get anything useful out of it.\n> \n> I will note the test _reliably_ fails when run in parallel with other tests.\n\nIt might be interference from another test, though in general they\nshould all be in their own little sandboxes. It could just be a race\ncondition that gets triggered more reliably when the system is under\nload.\n\n> Under valgrind I get the following error.  I will note that attempting\n> to run the full test suite with valgrind gives lots of similar errors\n> in many tests.  (All conditional jump in deflate, allocated in\n> write_loose_object.)\n\nThis is probably a false positive. On Linux we see these in libz because\nit has some weird optimized loop that can read past the end of the\nbuffer (though I have usually see it in the inflate code path, not\ndeflate).\n\n-Peff\n"},{"id":"167195","messageId":"E577B7D7-423E-4E9E-AE47-30E4DB4D21BC@silverinsanity.com","threadId":"27089","inReplyTo":"20110505210317.GE1770@sigill.intra.peff.net","subject":"Re: Intermittent Failures in t1450-fsck (Bisected)","fromName":"Brian Gernhardt","fromEmail":"benji@silverinsanity.com","sentAt":"2011-05-05T21:58:26Z","receivedAt":"2011-05-05T21:58:26Z","isPatch":false,"sender":{"key":"benji@silverinsanity.com","avatar":"https://gravatar.com/avatar/e06c101dbc25c68114d859b4a9ec7cf8a2c52fd2b0270ef0eac0e2e63ff22311?d=mp&s=160"},"body":"\nOn May 5, 2011, at 5:03 PM, Jeff King wrote:\n\n> On Thu, May 05, 2011 at 04:04:33PM -0400, Brian Gernhardt wrote:\n> \n>> The original e-mail was from next at that point.  The output from the\n>> rebased version and current next (76e37e2) is identical.\n> \n> Thanks. The weird thing is that running t1450 on 76e37e2 gives me this\n> output:\n> \n> broken link from     tag 66f6581d549f70e05ca586bc2df5c15a95662c36\n> broken link from unknown unknown\n> dangling blob 63499e4ea8e096b831515ceb1d5a7593e4d87ae5\n> error: Object 63499e4ea8e096b831515ceb1d5a7593e4d87ae5 is a blob, not a commit\n> error in tag 66f6581d549f70e05ca586bc2df5c15a95662c36: broken links\n> error in tag 66f6581d549f70e05ca586bc2df5c15a95662c36: could not load tagged object\n> error in tag 66f6581d549f70e05ca586bc2df5c15a95662c36: broken links\n> \n> whereas from your original email, you had:\n> \n>>>>> tagged commit 63499e4ea8e096b831515ceb1d5a7593e4d87ae5 (wrong) in 66f6581d549f70e05ca586bc2df5c15a95662c36\n>>>>> missing commit 63499e4ea8e096b831515ceb1d5a7593e4d87ae5\n>>>>> error: Object 63499e4ea8e096b831515ceb1d5a7593e4d87ae5 is a commit, not a blob\n>>>>> error: 63499e4ea8e096b831515ceb1d5a7593e4d87ae5: object corrupt or missing\n> \n> which is weird. We do call \"remove_object $sha\", but only inside\n> test_when_finished. I wonder if there is some bug with\n> test_when_finished on your platform. Have you tried instrumenting the\n> remove_object function to print a message when it is run? That might\n> give us a clue if it is accidentally being run early.\n\nI've done so, and the output is at the end of the e-mail.  I also added calls to `git show` to see if the objects could still be read.\n\n>> This is on my OS X laptop and last I knew valgrind was very buggy on\n>> OS X, so I've never tried it.  I'll install it now and see if I can\n>> get anything useful out of it.\n> \n> I've tried but been unable to reproduce on Linux, so it seems like\n> something OS X specific.\n\nQuite possibly.  My /bin/sh is GNU bash 3.2.48(1), so I don't know if that makes a difference.\n\nI've actually nailed it down to something even more specific than \"OS X\".  It's failing when I run it on a ramdisk.\n\ngit/t$ dev=`hdiutil attach -nomount ram://512000`\ngit/t$ diskutil erasevolume HFS+ Git_Test $dev\nStarted erase on disk1\nUnmounting disk\nErasing\nInitialized /dev/rdisk1 as a 250 MB HFS Plus volume\nMounting disk\nFinished erase on disk1 Git_Test\ngit/t$ ./t1450-fsck.sh -v --root=/Volumes/Git_Test  # Fails\n\n~~ Brian\n\nexpecting success: \n\tsha=$(echo blob | git hash-object -w --stdin) &&\n\ttest_when_finished \"remove_object $sha\" &&\n\tcat >wrong-tag <<-EOF &&\n\tobject $sha\n\ttype commit\n\ttag wrong\n\ttagger T A Gger <tagger@example.com> 1234567890 -0000\n\n\tThis is an invalid tag.\n\tEOF\n\n\ttag=$(git hash-object -t tag -w --stdin <wrong-tag) &&\n\ttest_when_finished \"remove_object $tag\" &&\n\techo $tag >.git/refs/tags/wrong &&\n\tgit show $blob &&\n\tgit show $tag &&\n\ttest_when_finished \"git update-ref -d refs/tags/wrong\" &&\n\ttest_must_fail git fsck --tags 2>out &&\n\tcat out &&\n\tgrep \"error in tag.*broken links\" out\n\ncommit c9145d6720f85544cc4bb6009a2e541660aa156b\nAuthor: A U Thor <author@example.com>\nDate:   Thu Apr 7 15:14:13 2005 -0700\n\n    B\n\ndiff --git a/fileB b/fileB\nnew file mode 100644\nindex 0000000..f719efd\n--- /dev/null\n+++ b/fileB\n@@ -0,0 +1 @@\n+two\ntag wrong\nTagger: T A Gger <tagger@example.com>\nDate:   Fri Feb 13 23:31:30 2009 +0000\n\nThis is an invalid tag.\nerror: Object 63499e4ea8e096b831515ceb1d5a7593e4d87ae5 is a commit, not a blob\nerror: Could not read object 63499e4ea8e096b831515ceb1d5a7593e4d87ae5\nremoving 66f6581d549f70e05ca586bc2df5c15a95662c36\nremoving 63499e4ea8e096b831515ceb1d5a7593e4d87ae5\nnot ok - 10 tag pointing to something else than its type\n#\t\n#\t\tsha=$(echo blob | git hash-object -w --stdin) &&\n#\t\ttest_when_finished \"remove_object $sha\" &&\n#\t\tcat >wrong-tag <<-EOF &&\n#\t\tobject $sha\n#\t\ttype commit\n#\t\ttag wrong\n#\t\ttagger T A Gger <tagger@example.com> 1234567890 -0000\n#\t\n#\t\tThis is an invalid tag.\n#\t\tEOF\n#\t\n#\t\ttag=$(git hash-object -t tag -w --stdin <wrong-tag) &&\n#\t\ttest_when_finished \"remove_object $tag\" &&\n#\t\techo $tag >.git/refs/tags/wrong &&\n#\t\tgit show $blob &&\n#\t\tgit show $tag &&\n#\t\ttest_when_finished \"git update-ref -d refs/tags/wrong\" &&\n#\t\ttest_must_fail git fsck --tags 2>out &&\n#\t\tcat out &&\n#\t\tgrep \"error in tag.*broken links\" out\n#\t\n\nexpecting success: \n\tgit fsck >actual 2>&1 &&\n\ttest_cmp empty actual\n\n--- empty\t2011-05-05 21:56:11.000000000 +0000\n+++ actual\t2011-05-05 21:56:12.000000000 +0000\n@@ -0,0 +1 @@\n+error: refs/tags/wrong does not point to a valid object!\nnot ok - 11 cleaned up\n#\t\n#\t\tgit fsck >actual 2>&1 &&\n#\t\ttest_cmp empty actual\n#\t\n\n# failed 2 among 11 test(s)\n1..11\n"},{"id":"167336","messageId":"A3947D3B-B434-4C13-A069-6B3C731DABF0@silverinsanity.com","threadId":"27089","inReplyTo":"E577B7D7-423E-4E9E-AE47-30E4DB4D21BC@silverinsanity.com","subject":"Re: Intermittent Failures in t1450-fsck (Bisected)","fromName":"Brian Gernhardt","fromEmail":"benji@silverinsanity.com","sentAt":"2011-05-07T20:25:28Z","receivedAt":"2011-05-07T20:25:28Z","isPatch":false,"sender":{"key":"benji@silverinsanity.com","avatar":"https://gravatar.com/avatar/e06c101dbc25c68114d859b4a9ec7cf8a2c52fd2b0270ef0eac0e2e63ff22311?d=mp&s=160"},"body":"\nOn May 5, 2011, at 5:58 PM, Brian Gernhardt wrote:\n\n> I've actually nailed it down to something even more specific than \"OS X\".  It's failing when I run it on a ramdisk.\n>> \n\nI've tried to narrow it down even further.  I cut the test down to just the setup and failing test. Then I removed all \"test_when_finished\" and replaced the \"test_must_fail\" with \"!\" so I can directly copy/paste the test into a window.  When the test runs, it fails.  When I run it manually, even with using /bin/sh and eval, it succeeds.  Can anybody else think of what difference there might be between a shell and the test script that I should test?  (I did remember to set GIT_EXEC_PATH and my PATH to run the same version as the script is.)\n\nThere's some _very_ weird triggering condition involved here and I'm hoping to narrow it down so I can set some useful breakpoints in gdb and see what's going on inside.\n\nOutput follows:\n\nt$ dev=`hdiutil attach -nomount ram://200000`\nt$ diskutil erasevolume HFS+ Git_Test $dev\nStarted erase on disk1\nUnmounting disk\nErasing\nInitialized /dev/rdisk1 as a 100 MB HFS Plus volume\nMounting disk\nFinished erase on disk1 Git_Test\nt$ ./t1450-fsck.sh -i -v --root=/Volumes/Git_Test\nInitialized empty Git repository in /Volumes/Git_Test/trash directory.t1450-fsck/.git/\nexpecting success: \n\tgit config gc.auto 0 &&\n\tgit config i18n.commitencoding ISO-8859-1 &&\n\ttest_commit A fileA one &&\n\tgit config --unset i18n.commitencoding &&\n\tgit checkout HEAD^0 &&\n\ttest_commit B fileB two &&\n\tgit tag -d A B &&\n\tgit reflog expire --expire=now --all &&\n\t>empty\n\n[master (root-commit) 1347563] A\n Author: A U Thor <author@example.com>\n 1 files changed, 1 insertions(+), 0 deletions(-)\n create mode 100644 fileA\nNote: checking out 'HEAD^0'.\n\nYou are in 'detached HEAD' state. You can look around, make experimental\nchanges and commit them, and you can discard any commits you make in this\nstate without impacting any branches by performing another checkout.\n\nIf you want to create a new branch to retain commits you create, you may\ndo so (now or later) by using -b with the checkout command again. Example:\n\n  git checkout -b new_branch_name\n\nHEAD is now at 1347563... A\n[detached HEAD c9145d6] B\n Author: A U Thor <author@example.com>\n 1 files changed, 1 insertions(+), 0 deletions(-)\n create mode 100644 fileB\nDeleted tag 'A' (was 1347563)\nDeleted tag 'B' (was c9145d6)\nok 1 - setup\n\nexpecting success: \n\tsha1_file() {\n\t\techo \"$*\" | sed \"s#..#.git/objects/&/#\"\n\t} &&\n\n\tremove_object() {\n\t\tfile=$(sha1_file \"$*\") &&\n\t\ttest -e \"$file\" &&\n\t\trm -f \"$file\"\n\t}\n\nok 2 - setup: helpers for corruption tests\n\nexpecting success: \n\tsha=$(echo blob | git hash-object -w --stdin) &&\n\tcat >wrong-tag <<-EOF &&\n\tobject $sha\n\ttype commit\n\ttag wrong\n\ttagger T A Gger <tagger@example.com> 1234567890 -0000\n\n\tThis is an invalid tag.\n\tEOF\n\n\ttag=$(git hash-object -t tag -w --stdin <wrong-tag) &&\n\techo $tag >.git/refs/tags/wrong &&\n\t! git fsck --tags 2>out &&\n\tcat out &&\n\tgrep \"error in tag.*broken links\" out\n\ntagged commit 63499e4ea8e096b831515ceb1d5a7593e4d87ae5 (wrong) in 66f6581d549f70e05ca586bc2df5c15a95662c36\nmissing commit 63499e4ea8e096b831515ceb1d5a7593e4d87ae5\nerror: Object 63499e4ea8e096b831515ceb1d5a7593e4d87ae5 is a commit, not a blob\nerror: 63499e4ea8e096b831515ceb1d5a7593e4d87ae5: object corrupt or missing\nnot ok - 3 tag pointing to something else than its type\n#\t\n#\t\tsha=$(echo blob | git hash-object -w --stdin) &&\n#\t\tcat >wrong-tag <<-EOF &&\n#\t\tobject $sha\n#\t\ttype commit\n#\t\ttag wrong\n#\t\ttagger T A Gger <tagger@example.com> 1234567890 -0000\n#\t\n#\t\tThis is an invalid tag.\n#\t\tEOF\n#\t\n#\t\ttag=$(git hash-object -t tag -w --stdin <wrong-tag) &&\n#\t\techo $tag >.git/refs/tags/wrong &&\n#\t\t! git fsck --tags 2>out &&\n#\t\tcat out &&\n#\t\tgrep \"error in tag.*broken links\" out\n#\t\nt$ /bin/sh\nsh-3.2$ cd /Volumes/Git_Test/trash\\ directory.t1450-fsck\nsh-3.2$ rm .git/objects/63/499e4ea8e096b831515ceb1d5a7593e4d87ae5 .git/objects/66/f6581d549f70e05ca586bc2df5c15a95662c36 \noverride r--r--r--  brian/brian for .git/objects/63/499e4ea8e096b831515ceb1d5a7593e4d87ae5? y\noverride r--r--r--  brian/brian for .git/objects/66/f6581d549f70e05ca586bc2df5c15a95662c36? y\nsh-3.2$ export GIT_EXEC_PATH=$HOME/dev/git\nsh-3.2$ export PATH=$HOME/dev/git:$PATH\nsh-3.2$ eval '\n> sha=$(echo blob | git hash-object -w --stdin) &&\n> cat >wrong-tag <<-EOF &&\n> object $sha\n> type commit\n> tag wrong\n> tagger T A Gger <tagger@example.com> 1234567890 -0000\n> \n> This is an invalid tag.\n> EOF\n> \n> tag=$(git hash-object -t tag -w --stdin <wrong-tag) &&\n> echo $tag >.git/refs/tags/wrong &&\n> ! $HOME/dev/git/git fsck --tags 2>out &&\n> cat out &&\n> grep \"error in tag.*broken links\" out\n> '\nbroken link from     tag 66f6581d549f70e05ca586bc2df5c15a95662c36\nbroken link from unknown unknown\ndangling blob 63499e4ea8e096b831515ceb1d5a7593e4d87ae5\nerror: Object 63499e4ea8e096b831515ceb1d5a7593e4d87ae5 is a blob, not a commit\nerror in tag 66f6581d549f70e05ca586bc2df5c15a95662c36: broken links\nerror in tag 66f6581d549f70e05ca586bc2df5c15a95662c36: could not load tagged object\nerror in tag 66f6581d549f70e05ca586bc2df5c15a95662c36: broken links\nsh-3.2$ \n"},{"id":"167658","messageId":"20110511114347.GA24161@sigill.intra.peff.net","threadId":"27089","inReplyTo":"A3947D3B-B434-4C13-A069-6B3C731DABF0@silverinsanity.com","subject":"Re: Intermittent Failures in t1450-fsck (Bisected)","fromName":"Jeff King","fromEmail":"peff@peff.net","sentAt":"2011-05-11T11:43:47Z","receivedAt":"2011-05-11T11:43:47Z","isPatch":false,"sender":{"key":"peff@peff.net","avatar":"https://avatars.githubusercontent.com/u/45925?v=4"},"body":"On Sat, May 07, 2011 at 04:25:28PM -0400, Brian Gernhardt wrote:\n\n> I've tried to narrow it down even further.  I cut the test down to\n> just the setup and failing test. Then I removed all\n> \"test_when_finished\" and replaced the \"test_must_fail\" with \"!\" so I\n> can directly copy/paste the test into a window.  When the test runs,\n> it fails.  When I run it manually, even with using /bin/sh and eval,\n> it succeeds.  Can anybody else think of what difference there might be\n> between a shell and the test script that I should test?  (I did\n> remember to set GIT_EXEC_PATH and my PATH to run the same version as\n> the script is.)\n\nCould be something in the environment. You might want to try pulling the\nenvironment variable setup from test-lib.sh into your interactive shell.\n\nI would suspect earlier tests might have created some weird state, but\nit looks in your output like you removed most of them and still see the\nproblem.\n\n> expecting success: \n> \tsha=$(echo blob | git hash-object -w --stdin) &&\n> \tcat >wrong-tag <<-EOF &&\n> \tobject $sha\n> \ttype commit\n> \ttag wrong\n> \ttagger T A Gger <tagger@example.com> 1234567890 -0000\n> \n> \tThis is an invalid tag.\n> \tEOF\n> \n> \ttag=$(git hash-object -t tag -w --stdin <wrong-tag) &&\n> \techo $tag >.git/refs/tags/wrong &&\n> \t! git fsck --tags 2>out &&\n> \tcat out &&\n> \tgrep \"error in tag.*broken links\" out\n> \n> tagged commit 63499e4ea8e096b831515ceb1d5a7593e4d87ae5 (wrong) in 66f6581d549f70e05ca586bc2df5c15a95662c36\n> missing commit 63499e4ea8e096b831515ceb1d5a7593e4d87ae5\n> error: Object 63499e4ea8e096b831515ceb1d5a7593e4d87ae5 is a commit, not a blob\n> error: 63499e4ea8e096b831515ceb1d5a7593e4d87ae5: object corrupt or missing\n> not ok - 3 tag pointing to something else than its type\n\nThanks for narrowing it down more. One thing I'd try is to see what \"git\ncat-file -t $sha\" and \"git cat-file -p $sha\" say right before the fsck\nis run (they should both print \"blob\").\n\nBeyond that I think I'd try gdb, with breakpoints near the places those\nmessages are generated (you can find them by grepping for \"tagged %s %s\"\nand \"is a %s, not a\").\n\nOther than that, I'm a bit stumped. The whole \"it breaks on a ramdisk\"\nthing is just odd.\n\n-Peff\n"}]}