Skip to content

Commit 0f48dae

Browse files
committed
pack-objects (mingw): demonstrate a segmentation fault with large deltas
There is a problem in the way 9ac3f0e (pack-objects: fix performance issues on packing large deltas, 2018-07-22) initializes that mutex in the `packing_data` struct. The problem manifests in a segmentation fault on Windows, when a mutex (AKA critical section) is accessed without being initialized. (With pthreads, you apparently do not really have to initialize them?) This was reported in #1839. Signed-off-by: Johannes Schindelin <[email protected]>
1 parent d1d4fc3 commit 0f48dae

File tree

1 file changed

+32
-0
lines changed

1 file changed

+32
-0
lines changed

t/t5319-pack-large-objects.sh

Lines changed: 32 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,32 @@
1+
#!/bin/sh
2+
#
3+
# Copyright (c) 2018 Johannes Schindelin
4+
#
5+
6+
test_description='git pack-object with "large" deltas
7+
8+
'
9+
. ./test-lib.sh
10+
. "$TEST_DIRECTORY"/lib-pack.sh
11+
12+
# Two similar-ish objects that we have computed deltas between.
13+
A=01d7713666f4de822776c7622c10f1b07de280dc
14+
B=e68fe8129b546b101aee9510c5328e7f21ca1d18
15+
16+
test_expect_success 'setup' '
17+
clear_packs &&
18+
{
19+
pack_header 2 &&
20+
pack_obj $A $B &&
21+
pack_obj $B
22+
} >ab.pack &&
23+
pack_trailer ab.pack &&
24+
git index-pack --stdin <ab.pack
25+
'
26+
27+
test_expect_failure 'repack large deltas' '
28+
printf "%s\\n" $A $B |
29+
GIT_TEST_OE_DELTA_SIZE=2 git pack-objects tmp-pack
30+
'
31+
32+
test_done

0 commit comments

Comments
 (0)