jc/lookup-object-hash from pu crashes on ARM

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Junio C Hamano wrote:

> * jc/lookup-object-hash (2011-08-11) 6 commits
>  - object hash: replace linear probing with 4-way cuckoo hashing
>  - object hash: we know the table size is a power of two
>  - object hash: next_size() helper for readability
>  - pack-objects --count-only
>  - object.c: remove duplicated code for object hashing
>  - object.c: code movement for readability

The code from the tip commit crashes on ARM for me (and presumably
would also misbehave on other platforms that care about alignment):

 $ git branch -av
 Bus error

The following might avoid that:

	static inline unsigned int H(const unsigned char *sha1, int ix)
	{
		unsigned int hash;
		memcpy(&hash, sha1 + ix * sizeof(unsigned int),
				sizeof(unsigned int));
		return hash % (obj_hash_size - 1);
	}

Even better could be to start aligning the hashes we pass around,
using something like this:

	union object_hash {
		unsigned char sha1[20];
		uint32_t chunk[5];
	};

which could speed up functions like hashcpy(), hashcmp(), and
hasheq().  But it's probably not worth the fuss.

Call chain:

	cmd_branch -> print_ref_list -> for_each_rawref ->
	  do_for_each_ref -> do_one_ref(entry=0x175508) ->
	  append_ref(sha1=0x175509) ->
	  lookup_commit_reference_gently -> parse_object ->
	  parse_object_buffer -> lookup_commit -> lookup_object

This is from testing pu (ed7c265e), in case that's relevant.  Aside
from that, the topic looks neat. :)
--
To unsubscribe from this list: send the line "unsubscribe git" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[Index of Archives]     [Linux Kernel Development]     [Gcc Help]     [IETF Annouce]     [DCCP]     [Netdev]     [Networking]     [Security]     [V4L]     [Bugtraq]     [Yosemite]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Linux SCSI]     [Fedora Users]