From: Dmitriy Panteleyev <dpantel@gmail.com>
To: Jeff King <peff@peff.net>
Cc: git@vger.kernel.org
Subject: Re: [BUG] commit fails with 'bus error' when working directory is on an NFS share
Date: Wed, 4 Dec 2024 20:59:03 -0700 [thread overview]
Message-ID: <CAJ-DG_BdAiFk_2eV=JDF7Lth9+Ay=86w-VT26Rt+T5fdN1vd_w@mail.gmail.com> (raw)
In-Reply-To: <20241205032246.GA2573761@coredump.intra.peff.net>
On Wed, Dec 4, 2024 at 8:22 PM Jeff King <peff@peff.net> wrote:
>
> On Wed, Dec 04, 2024 at 07:21:16PM -0700, Dmitriy Panteleyev wrote:
>
> > After trying NO_MMAP=1 with and without SANITIZE, I get:
> > "fatal: mmap failed: Permission denied"
>
> Hmm, that's odd. If you run it under strace, which syscall fails? That
> message should be reporting errno from mmap(), which in NO_MMAP mode
> should be a pread() call. I'm not sure why that would get EACCES if the
> open() call succeeded, but that might explain why the mmap'd version
> gets SIGBUS (I don't know much about NFS, but I imagine that under the
> hood the client is probably issuing reads for individual pages to
> fault in the map).
Strace with NO_MMAP=1, I gives:
openat(AT_FDCWD,
".git/objects/34/5819b235838e219d66420b536a54ce4cf0624c",
O_RDONLY|O_CLOEXEC) = 4
fstat(4, {st_mode=S_IFREG|0444, st_size=154, ...}) = 0
pread64(4, 0x61a0292e15d0, 154, 0) = -1 ESTALE (Stale file handle)
write(2, "fatal: mmap failed: Permission d"..., 38) = 38
Weirdly, it's throwing ESTALE not EACCESS...
Without NO_MMAP, I get:
openat(AT_FDCWD,
".git/objects/51/da8e85661b60d7378b8ac0d896cfc955405fdf",
O_RDONLY|O_CLOEXEC) = 4
fstat(4, {st_mode=S_IFREG|0444, st_size=154, ...}) = 0
mmap(NULL, 154, PROT_READ, MAP_PRIVATE, 4, 0) = 0x73ceb860e000
close(4) = 0
--- SIGBUS {si_signo=SIGBUS, si_code=BUS_ADRERR, si_addr=0x73ceb860e000} ---
+++ killed by SIGBUS (core dumped) +++
Also, it's odd that the same set of commands -- openat(), fstat(), and
pread64() / mmap() -- succeed multiple times before an error is
encountered.
>
> Does your system have AppArmor enabled?
Yes, but I don't see any profiles related to git. And I can't image
AppArmor would be version-dependent.
>
> This issue sounds similar to yours:
>
> https://unix.stackexchange.com/questions/633389/man-cannot-read-manpage-from-nfs-although-the-file-is-readable
>
> especially the bit where reading the metadata once makes it magically
> work for a brief period (which is the only thing I'd expect the commit
> you found via bisection to have an effect on).
>
> -Peff
next prev parent reply other threads:[~2024-12-05 3:59 UTC|newest]
Thread overview: 14+ messages / expand[flat|nested] mbox.gz Atom feed top
2024-11-30 4:58 [BUG] commit fails with 'bus error' when working directory is on an NFS share Dmitriy Panteleyev
2024-11-30 16:38 ` Jeff King
2024-12-01 17:17 ` Dmitriy Panteleyev
2024-12-01 21:36 ` Jeff King
2024-12-01 22:24 ` Dmitriy Panteleyev
2024-12-02 20:34 ` Jeff King
2024-12-03 2:48 ` Dmitriy Panteleyev
2024-12-03 21:18 ` Jeff King
2024-12-05 2:21 ` Dmitriy Panteleyev
2024-12-05 3:22 ` Jeff King
2024-12-05 3:59 ` Dmitriy Panteleyev [this message]
2024-12-05 4:58 ` Dmitriy Panteleyev
2024-12-05 19:13 ` Jeff King
-- strict thread matches above, loose matches on Subject: below --
2025-05-18 22:56 Evaldas Svidras
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to='CAJ-DG_BdAiFk_2eV=JDF7Lth9+Ay=86w-VT26Rt+T5fdN1vd_w@mail.gmail.com' \
--to=dpantel@gmail.com \
--cc=git@vger.kernel.org \
--cc=peff@peff.net \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
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).