Merge lp:~jameinel/bzr/2.0-490228-gc-segfault into lp:bzr
Proposed by
John A Meinel
Status: | Merged | ||||
---|---|---|---|---|---|
Approved by: | Vincent Ladeuil | ||||
Approved revision: | not available | ||||
Merged at revision: | not available | ||||
Proposed branch: | lp:~jameinel/bzr/2.0-490228-gc-segfault | ||||
Merge into: | lp:bzr | ||||
Diff against target: |
73 lines (+20/-10) 2 files modified
NEWS (+5/-0) bzrlib/diff-delta.c (+15/-10) |
||||
To merge this branch: | bzr merge lp:~jameinel/bzr/2.0-490228-gc-segfault | ||||
Related bugs: |
|
Reviewer | Review Type | Date Requested | Status |
---|---|---|---|
Vincent Ladeuil | Approve | ||
Review via email: mp+16139@code.launchpad.net |
To post a comment you must log in.
Bug fix for the groupcompress code. The actual diff here also cleans up the specific code to be a bit more readable. But the minimal change is just: diff-delta. c'
old_ entry-- ;
old_entry+ +; >hash[hash_ offset + 1]) { >hash[hash_ offset + 1]
=== modified file 'bzrlib/
--- bzrlib/diff-delta.c 2009-08-03 16:54:36 +0000
+++ bzrlib/diff-delta.c 2009-12-14 15:52:24 +0000
@@ -804,8 +804,8 @@
}
- if (old_entry->ptr != NULL
- || old_entry >= old_index-
+ if (old_entry >= old_index-
+ || old_entry->ptr != NULL) {
/* There is no room for this entry, we have to resize */
// char buff[128];
// get_text(buff, entry->ptr);
I don't have a good way to test this. We adapted this code from a 3rd-party source and getting at the specific structures is pretty difficult. And replicating it with real data would be very difficult. You would need:
1) Custom text data that gives a RABIN_HASH that RABIN_HASH & (hash_map_mask) falls into the last bucket. table[len( entry_table) ]->ptr" gives a segfault. (len() versus len()-1)
2) Enough of them to fill the final hash bucket.
3) A memory allocator that doesn't provide any extra bytes after the end of the entry table, such that reading "entry_
I would like to revisit the groupcompress data structures, but I don't think that is a profitable use of my time right now.