git.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [BUG] git crashes with a SIGBUS on sparc64 during pull
@ 2025-01-17  3:30 Koakuma
  2025-01-17 12:11 ` Jeff King
  0 siblings, 1 reply; 22+ messages in thread
From: Koakuma @ 2025-01-17  3:30 UTC (permalink / raw)
  To: git@vger.kernel.org

Thank you for filling out a Git bug report!
Please answer the following questions to help us understand your issue.

What did you do before the bug happened? (Steps to reproduce your issue)

1. Compile git with clang (this doesn't seem to happen with GCC, oddly)
2. Do a `git pull` on a repository that will trigger the `unpack-objects` code

What did you expect to happen? (Expected behavior)

Pull succeeds

What happened instead? (Actual behavior)

Pull fails with this error:
remote: Enumerating objects: 7, done.
remote: Counting objects: 100% (5/5), done.
error: unpack-objects died of signal 10
fatal: unpack-objects failed

What's different between what you expected and what actually happened?

The pull process crashes with a SIGBUS.

Anything else you want to add:

re: unpack-objects, I don't know how to specifically trigger that code,
but I know that once `unpack-objects` is triggered it will reliably crash
with the error above.

According to gdb, the crash happens on this line:
#0  0x000001000019ca18 in cmd_unpack_objects (argc=<optimized out>, argv=0x1000063a4e0, prefix=<optimized out>, repo=<optimized out>) at builtin/unpack-objects.c:653
653					hdr->hdr_signature = htonl(PACK_SIGNATURE);

Overaligning the `buffer` declaration in the same file to try to get around
possible alignment issues seems to be able to prevent the crash,
but I don't know if it would be a proper fix for it.

Please review the rest of the bug report below.
You can delete any lines you don't wish to share.


[System Info]
git version:
git version 2.48.1.262.g85cc9f2d1e
cpu: sparc64
built from commit: 85cc9f2d1ee4d65cb1edb00d4f56863185a53e0f
sizeof-long: 8
sizeof-size_t: 8
shell-path: /bin/sh
libcurl: 8.10.1
OpenSSL: OpenSSL 3.3.2 3 Sep 2024
zlib: 1.3.1
uname: Linux 6.6.30-sparc64-clang+ #1 SMP Sat Oct 26 21:22:10 WIB 2024 sparc64
compiler info: clang: 19.1.4
libc info: glibc: 2.40
$SHELL (typically, interactive shell): /bin/bash


[Enabled Hooks]


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

end of thread, other threads:[~2025-01-21 16:37 UTC | newest]

Thread overview: 22+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2025-01-17  3:30 [BUG] git crashes with a SIGBUS on sparc64 during pull Koakuma
2025-01-17 12:11 ` Jeff King
2025-01-17 12:52   ` Jeff King
2025-01-17 12:54     ` [PATCH 1/3] packfile: factor out --pack_header argument parsing Jeff King
2025-01-17 22:45       ` Junio C Hamano
2025-01-18  9:23         ` Jeff King
2025-01-18 16:57           ` Koakuma
2025-01-17 12:55     ` [PATCH 2/3] parse_pack_header_option(): avoid unaligned memory writes Jeff King
2025-01-18  1:27       ` Junio C Hamano
2025-01-18  9:36         ` Jeff King
2025-01-17 12:56     ` [PATCH 3/3] index-pack, unpack-objects: use skip_prefix to avoid magic number Jeff King
2025-01-17 15:55     ` [BUG] git crashes with a SIGBUS on sparc64 during pull Koakuma
2025-01-18  9:20       ` Jeff King
2025-01-18 16:50         ` Koakuma
2025-01-19 13:12       ` [PATCH v2 0/5] " Jeff King
2025-01-19 13:23         ` [PATCH v2 1/5] bswap.h: squelch potential sparse -Wcast-truncate warnings Jeff King
2025-01-19 13:23         ` [PATCH v2 2/5] packfile: factor out --pack_header argument parsing Jeff King
2025-01-19 13:23         ` [PATCH v2 3/5] parse_pack_header_option(): avoid unaligned memory writes Jeff King
2025-01-19 13:25         ` [PATCH v2 4/5] index-pack, unpack-objects: use get_be32() for reading pack header Jeff King
2025-01-19 13:25         ` [PATCH v2 5/5] index-pack, unpack-objects: use skip_prefix to avoid magic number Jeff King
2025-01-20 15:20         ` [PATCH v2 0/5] git crashes with a SIGBUS on sparc64 during pull Koakuma
2025-01-21 16:37           ` Junio C Hamano

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