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

Re: Intermittent Failures in t1450-fsck (Bisected)

From
Brian Gernhardt <benji@silverinsanity.com>
Date
May 5, 2011, 21:58 UTC
Message-ID
<E577B7D7-423E-4E9E-AE47-30E4DB4D21BC@silverinsanity.com>
In-Reply-To
<20110505210317.GE1770@sigill.intra.peff.net>
On May 5, 2011, at 5:03 PM, Jeff King wrote:
Show 28 quoted lines
> On Thu, May 05, 2011 at 04:04:33PM -0400, Brian Gernhardt wrote:
> 
>> The original e-mail was from next at that point.  The output from the
>> rebased version and current next (76e37e2) is identical.
> 
> Thanks. The weird thing is that running t1450 on 76e37e2 gives me this
> output:
> 
> broken link from     tag 66f6581d549f70e05ca586bc2df5c15a95662c36
> broken link from unknown unknown
> dangling blob 63499e4ea8e096b831515ceb1d5a7593e4d87ae5
> error: Object 63499e4ea8e096b831515ceb1d5a7593e4d87ae5 is a blob, not a commit
> error in tag 66f6581d549f70e05ca586bc2df5c15a95662c36: broken links
> error in tag 66f6581d549f70e05ca586bc2df5c15a95662c36: could not load tagged object
> error in tag 66f6581d549f70e05ca586bc2df5c15a95662c36: broken links
> 
> whereas from your original email, you had:
> 
>>>>> tagged commit 63499e4ea8e096b831515ceb1d5a7593e4d87ae5 (wrong) in 66f6581d549f70e05ca586bc2df5c15a95662c36
>>>>> missing commit 63499e4ea8e096b831515ceb1d5a7593e4d87ae5
>>>>> error: Object 63499e4ea8e096b831515ceb1d5a7593e4d87ae5 is a commit, not a blob
>>>>> error: 63499e4ea8e096b831515ceb1d5a7593e4d87ae5: object corrupt or missing
> 
> which is weird. We do call "remove_object $sha", but only inside
> test_when_finished. I wonder if there is some bug with
> test_when_finished on your platform. Have you tried instrumenting the
> remove_object function to print a message when it is run? That might
> give us a clue if it is accidentally being run early.
I'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.
Show 6 quoted lines
>> 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.
> 
> I've tried but been unable to reproduce on Linux, so it seems like
> something OS X specific.
Quite possibly.  My /bin/sh is GNU bash 3.2.48(1), so I don't know if that makes a difference.
I've actually nailed it down to something even more specific than "OS X".  It's failing when I run it on a ramdisk.

git/t$ dev=`hdiutil attach -nomount ram://512000` git/t$ diskutil erasevolume HFS+ Git_Test $dev Started erase on disk1 Unmounting disk Erasing Initialized /dev/rdisk1 as a 250 MB HFS Plus volume Mounting disk Finished erase on disk1 Git_Test git/t$ ./t1450-fsck.sh -v --root=/Volumes/Git_Test # Fails

~~ Brian
expecting success: 
	sha=$(echo blob | git hash-object -w --stdin) &&
	test_when_finished "remove_object $sha" &&
	cat >wrong-tag <<-EOF &&
	object $sha
	type commit
	tag wrong
	tagger T A Gger <tagger@example.com> 1234567890 -0000
	This is an invalid tag.
	EOF
	tag=$(git hash-object -t tag -w --stdin <wrong-tag) &&
	test_when_finished "remove_object $tag" &&
	echo $tag >.git/refs/tags/wrong &&
	git show $blob &&
	git show $tag &&
	test_when_finished "git update-ref -d refs/tags/wrong" &&
	test_must_fail git fsck --tags 2>out &&
	cat out &&
	grep "error in tag.*broken links" out
commit c9145d6720f85544cc4bb6009a2e541660aa156b
Author: A U Thor <author@example.com>
Date:   Thu Apr 7 15:14:13 2005 -0700
    B
diff --git a/fileB b/fileB
new file mode 100644
index 0000000..f719efd
--- /dev/null
+++ b/fileB
@@ -0,0 +1 @@
+two
tag wrong
Tagger: T A Gger <tagger@example.com>
Date:   Fri Feb 13 23:31:30 2009 +0000

This is an invalid tag.
error: Object 63499e4ea8e096b831515ceb1d5a7593e4d87ae5 is a commit, not a blob
error: Could not read object 63499e4ea8e096b831515ceb1d5a7593e4d87ae5
removing 66f6581d549f70e05ca586bc2df5c15a95662c36
removing 63499e4ea8e096b831515ceb1d5a7593e4d87ae5
not ok - 10 tag pointing to something else than its type
#	
#		sha=$(echo blob | git hash-object -w --stdin) &&
#		test_when_finished "remove_object $sha" &&
#		cat >wrong-tag <<-EOF &&
#		object $sha
#		type commit
#		tag wrong
#		tagger T A Gger <tagger@example.com> 1234567890 -0000
#	
#		This is an invalid tag.
#		EOF
#	
#		tag=$(git hash-object -t tag -w --stdin <wrong-tag) &&
#		test_when_finished "remove_object $tag" &&
#		echo $tag >.git/refs/tags/wrong &&
#		git show $blob &&
#		git show $tag &&
#		test_when_finished "git update-ref -d refs/tags/wrong" &&
#		test_must_fail git fsck --tags 2>out &&
#		cat out &&
#		grep "error in tag.*broken links" out
#	

expecting success: 
	git fsck >actual 2>&1 &&
	test_cmp empty actual

--- empty	2011-05-05 21:56:11.000000000 +0000
+++ actual	2011-05-05 21:56:12.000000000 +0000
@@ -0,0 +1 @@
+error: refs/tags/wrong does not point to a valid object!
not ok - 11 cleaned up
#	
#		git fsck >actual 2>&1 &&
#		test_cmp empty actual
#	

# failed 2 among 11 test(s)
1..11
Previous: Jeff KingNext: Brian Gernhardt
Message 6 of 10 in “Intermittent Failures in t1450-fsck”
  1. Brian GernhardtApr 13, 2011
  2. Brian GernhardtMay 5, 2011
  3. Jeff KingMay 5, 2011
  4. Brian GernhardtMay 5, 2011
  5. Jeff KingMay 5, 2011
  6. Brian GernhardtMay 5, 2011
  7. Brian GernhardtMay 7, 2011
  8. Jeff KingMay 11, 2011
  9. Brian GernhardtMay 5, 2011
  10. Jeff KingMay 5, 2011

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.