git.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* problem in unpack-trees.c
@ 2006-12-03  1:21 Roman Zippel
  2006-12-04  9:53 ` Junio C Hamano
  0 siblings, 1 reply; 4+ messages in thread
From: Roman Zippel @ 2006-12-03  1:21 UTC (permalink / raw)
  To: git

Hi,

Git currently fails to succeed the tests as you can see here:
http://buildd.debian.org/fetch.cgi?&pkg=git-core&ver=1%3A1.4.4-2&arch=m68k&stamp=1164303729&file=log

I looked into it and the problem is during the "git-read-tree --reset" 
step and it seems that the local df_conflict_entry variable of 
unpack_trees() survives past that function. If you check in 
add_cache_entry() it's called with this variable and only because 
verify_path() fails it's not added to the tree on the other archs, but on 
m68k the data on the stack is a bit different and thus verify_path() 
succeeds and the stack variable is added to the tree and later saved.

Using the patch below, you can simulate what's happing on m68k and now I 
need some help fixing this properly, as I'm not that familiar with the 
internals.
Thanks.

bye, Roman

diff -ur git-core-1.4.4.1/unpack-trees.c git-core-1.4.4.1/unpack-trees.c
--- git-core-1.4.4.1/unpack-trees.c	2006-11-23 03:38:07.000000000 +0100
+++ git-core-1.4.4.1/unpack-trees.c	2006-12-03 01:54:04.000000000 +0100
@@ -370,7 +370,10 @@
 	int i;
 	struct object_list *posn = trees;
 	struct tree_entry_list df_conflict_list;
-	struct cache_entry df_conflict_entry;
+	static struct {
+		struct cache_entry entry;
+		char name[4];
+	} df_conflict_entry;
 
 	memset(&df_conflict_list, 0, sizeof(df_conflict_list));
 	df_conflict_list.next = &df_conflict_list;
@@ -382,7 +385,8 @@
 
 	o->merge_size = len;
 	memset(&df_conflict_entry, 0, sizeof(df_conflict_entry));
-	o->df_conflict_entry = &df_conflict_entry;
+	o->df_conflict_entry = &df_conflict_entry.entry;
+	df_conflict_entry.entry.name[0] = 'x';
 
 	if (len) {
 		posns = xmalloc(len * sizeof(struct tree_entry_list *));
@@ -399,6 +403,7 @@
 		die("Merge requires file-level merging");
 
 	check_updates(active_cache, active_nr, o);
+	memset(&df_conflict_entry, 0x11, sizeof(df_conflict_entry));
 	return 0;
 }

^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2006-12-04 11:36 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2006-12-03  1:21 problem in unpack-trees.c Roman Zippel
2006-12-04  9:53 ` Junio C Hamano
2006-12-04 10:00   ` Junio C Hamano
2006-12-04 11:36   ` Roman Zippel

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).