Subject: pack bitmap woes on Windows

From: Johannes Sixt <[email-masked]>
Date: Wed, 12 Feb 2014 08:27:36 +0100

Running test suite of 'next' on Windows fails in t5310-pack-bitmaps with
the following symptoms. I haven't followed the topic. Have there been
patches floating that addressed the problem in one way or another?

(gdb) run
Starting program: D:\Src\mingw-git\t\trash directory.t5310-pack-bitmaps/..\..\git.exe rev-list --test-bitmap HEAD
[New thread 3528.0x8d4]
Bitmap v1 test (20 entries loaded)
Found bitmap for 537ea4d3eb79c95f602873b1167c480006d2ac2d. 64 bits / 15873b36 checksum

Breakpoint 1, die (err=0x5939e9 "Out of memory, realloc failed") at usage.c:97
97              if (die_is_recursing()) {
(gdb) bt
#0  die (err=0x5939e9 "Out of memory, realloc failed") at usage.c:97
#1  0x00487c4c in xrealloc (ptr=0x12b10008, size=837107040) at wrapper.c:109
#2  0x0055572b in ewah_to_bitmap (ewah=0xe58c18) at ewah/bitmap.c:105
#3  0x005426fc in test_bitmap_walk (revs=0x22f93c) at pack-bitmap.c:954
#4  0x0046b6ae in cmd_rev_list (argc=2, argv=0x3e263c, prefix=0x0)
    at builtin/rev-list.c:329
#5  0x00402048 in run_builtin (p=0x56d41c, argc=3, argv=0x3e263c) at git.c:314
#6  0x0040224f in handle_builtin (argc=3, argv=0x3e263c) at git.c:487
#7  0x00402351 in run_argv (argcp=0x22ff50, argv=0x22ff38) at git.c:533
#8  0x0040257f in mingw_main (argc=3, av=0x3e2638) at git.c:616
#9  0x0040242e in main (argc=4, argv=0x3e2638) at git.c:551
(gdb) up
#1  0x00487c4c in xrealloc (ptr=0x12b10008, size=837107040) at wrapper.c:109
109                             die("Out of memory, realloc failed");
(gdb) up
#2  0x0055572b in ewah_to_bitmap (ewah=0xe58c18) at ewah/bitmap.c:105
105                             bitmap->words = ewah_realloc(
(gdb) l
100             ewah_iterator_init(&it, ewah);
101
102             while (ewah_iterator_next(&blowup, &it)) {
103                     if (i >= bitmap->word_alloc) {
104                             bitmap->word_alloc *= 1.5;
105                             bitmap->words = ewah_realloc(
106                                     bitmap->words, bitmap->word_alloc * sizeof(eword_t));
107                     }
108
109                     bitmap->words[i++] = blowup;
(gdb) info locals
bitmap = (struct bitmap *) 0xe58aa0
it = {buffer = 0xe58cd0, buffer_size = 2, pointer = 1, compressed = 52981705,
  literals = 0, rl = 2141159439, lw = 8259520, b = 1}
blowup = 18446744073709551615
i = 69758920
(gdb) info args
ewah = (struct ewah_bitmap *) 0xe58c18
(gdb)

This is after "not ok 3 - rev-list --test-bitmap verifies bitmaps".
Numerous further test cases fail, but I didn't look at them.

-- Hannes