git.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* MSan failures in pack-bitmap
@ 2024-06-08  2:43 Kyle Lippincott
  2024-06-08  8:18 ` Jeff King
  0 siblings, 1 reply; 10+ messages in thread
From: Kyle Lippincott @ 2024-06-08  2:43 UTC (permalink / raw)
  To: Git Mailing List; +Cc: Taylor Blau

While running t/t5326-multi-pack-bitmaps:

test 24:
expecting success of 5326.24 'clone from bitmapped repository':
rm -fr clone.git &&
git clone --no-local --bare . clone.git &&
git rev-parse HEAD >expect &&
git --git-dir=clone.git rev-parse HEAD >actual &&
test_cmp expect actual

Cloning into bare repository 'clone.git'...
remote: ==7474==WARNING: MemorySanitizer: use-of-uninitialized-value
remote: #0 0x55c5cd191dde in try_partial_reuse pack-bitmap.c:1887:8
remote: #1 0x55c5cd191dde in reuse_partial_packfile_from_bitmap_1
pack-bitmap.c:2001:8
remote: #2 0x55c5cd191dde in reuse_partial_packfile_from_bitmap
pack-bitmap.c:2105:3
remote: #3 0x55c5cce0bd0e in get_object_list_from_bitmap
builtin/pack-objects.c:4043:3
remote: #4 0x55c5cce0bd0e in get_object_list builtin/pack-objects.c:4156:27
remote: #5 0x55c5cce0bd0e in cmd_pack_objects builtin/pack-objects.c:4596:3
remote: #6 0x55c5ccc8fac8 in run_builtin git.c:474:11
remote: #7 0x55c5ccc8d660 in handle_builtin git.c:729:3
remote: #8 0x55c5ccc8b634 in run_argv git.c:793:4
remote: #9 0x55c5ccc8b634 in cmd_main git.c:928:19
remote: #10 0x55c5ccf10a5b in main common-main.c:62:11
remote: #11 0x7f9ef142e3d3 in __libc_start_main
remote: #12 0x55c5ccbf28e9 in _start
remote:
remote: Uninitialized value was stored to memory at
remote: #0 0x55c5cd191dd7 in try_partial_reuse pack-bitmap.c:1888:15
remote: #1 0x55c5cd191dd7 in reuse_partial_packfile_from_bitmap_1
pack-bitmap.c:2001:8
remote: #2 0x55c5cd191dd7 in reuse_partial_packfile_from_bitmap
pack-bitmap.c:2105:3
remote: #3 0x55c5cce0bd0e in get_object_list_from_bitmap
builtin/pack-objects.c:4043:3
remote: #4 0x55c5cce0bd0e in get_object_list builtin/pack-objects.c:4156:27
remote: #5 0x55c5cce0bd0e in cmd_pack_objects builtin/pack-objects.c:4596:3
remote: #6 0x55c5ccc8fac8 in run_builtin git.c:474:11
remote: #7 0x55c5ccc8d660 in handle_builtin git.c:729:3
remote: #8 0x55c5ccc8b634 in run_argv git.c:793:4
remote: #9 0x55c5ccc8b634 in cmd_main git.c:928:19
remote: #10 0x55c5ccf10a5b in main common-main.c:62:11
remote: #11 0x7f9ef142e3d3 in __libc_start_main
remote: #12 0x55c5ccbf28e9 in _start
remote:
remote: Uninitialized value was created by a heap allocation
remote: #0 0x55c5ccc052ca in realloc msan/msan_interceptors.cpp:1009:3
remote: #1 0x55c5cd3d04d6 in xrealloc wrapper.c:137:8
remote: #2 0x55c5cd190d95 in reuse_partial_packfile_from_bitmap
pack-bitmap.c:2091:3
remote: #3 0x55c5cce0bd0e in get_object_list_from_bitmap
builtin/pack-objects.c:4043:3
remote: #4 0x55c5cce0bd0e in get_object_list builtin/pack-objects.c:4156:27
remote: #5 0x55c5cce0bd0e in cmd_pack_objects builtin/pack-objects.c:4596:3
remote: #6 0x55c5ccc8fac8 in run_builtin git.c:474:11
remote: #7 0x55c5ccc8d660 in handle_builtin git.c:729:3
remote: #8 0x55c5ccc8b634 in run_argv git.c:793:4
remote: #9 0x55c5ccc8b634 in cmd_main git.c:928:19
remote: #10 0x55c5ccf10a5b in main common-main.c:62:11
remote: #11 0x7f9ef142e3d3 in __libc_start_main
remote: #12 0x55c5ccbf28e9 in _start
remote:
remote: SUMMARY: MemorySanitizer: use-of-uninitialized-value
pack-bitmap.c:1887:8 in try_partial_reuse
remote: Exiting
error: git upload-pack: git-pack-objects died with error.
fatal: git upload-pack: aborting due to possible repository corruption
on the remote side.
remote: aborting due to possible repository corruption on the remote side.
fatal: early EOF
fatal: fetch-pack: invalid index-pack output
not ok 24 - clone from bitmapped repository
#
# rm -fr clone.git &&
# git clone --no-local --bare . clone.git &&
# git rev-parse HEAD >expect &&
# git --git-dir=clone.git rev-parse HEAD >actual &&
# test_cmp expect actual
#

There are similar failures in test 25, 198, 199, 319, and 320.
---

I believe what's happening is that pack-bitmap.c:2091 grows the packs
list and sets up some of the fields, but doesn't set pack_int_id. We
then use it at pack-bitmap.c:1888.

I investigated, but couldn't prove to myself what value should be
placed there while growing it, or if it's incorrect to read from it in
this case (so we shouldn't be in pack-bitmap.c:1888 with this pack).

Reproducing is potentially non-trivial. This may work:

make -j CFLAGS="-fsanitize=memory -fsanitize-memory-track-origins
-fno-omit-frame-pointer -g -O2" CC=clang && \
make -C t t5326-multi-pack-bitmaps.sh GIT_TEST_OPTS="--verbose --debug"

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

end of thread, other threads:[~2024-06-11  9:12 UTC | newest]

Thread overview: 10+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2024-06-08  2:43 MSan failures in pack-bitmap Kyle Lippincott
2024-06-08  8:18 ` Jeff King
2024-06-09 15:31   ` Taylor Blau
2024-06-09 18:55     ` Junio C Hamano
2024-06-09 20:00       ` Taylor Blau
2024-06-09 20:23         ` Junio C Hamano
2024-06-09 20:30           ` Taylor Blau
2024-06-09 20:24         ` Taylor Blau
2024-06-11  8:02           ` Jeff King
2024-06-11  9:12             ` Jeff King

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).