git/list[1] front-page[2] threads[3] people[4] search[5] about
 

Re: [BUG] commit fails with 'bus error' when working directory is on an NFS share

From
DPDmitriy Panteleyev <dpantel@gmail.com>
Date
Dec 5, 2024, 03:59 UTC
Message-ID
<CAJ-DG_BdAiFk_2eV=JDF7Lth9+Ay=86w-VT26Rt+T5fdN1vd_w@mail.gmail.com>
In-Reply-To
<20241205032246.GA2573761@coredump.intra.peff.net>
On Wed, Dec 4, 2024 at 8:22 PM Jeff King <peff@peff.net> wrote:
Show 13 quoted lines
>
> 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.

Show 10 quoted lines
>
> 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
Previous: Jeff KingNext: Dmitriy Panteleyev
Message 11 of 13 in “[BUG] commit fails with 'bus error' when working directory is on an NFS share”
  1. Dmitriy PanteleyevNov 30, 2024
  2. Jeff KingNov 30, 2024
  3. Dmitriy PanteleyevDec 1, 2024
  4. Jeff KingDec 1, 2024
  5. Dmitriy PanteleyevDec 1, 2024
  6. Jeff KingDec 2, 2024
  7. Dmitriy PanteleyevDec 3, 2024
  8. Jeff KingDec 3, 2024
  9. Dmitriy PanteleyevDec 5, 2024
  10. Jeff KingDec 5, 2024
  11. Dmitriy PanteleyevDec 5, 2024
  12. Dmitriy PanteleyevDec 5, 2024
  13. Jeff KingDec 5, 2024

Read the whole thread, see it on lore, or plain text.

$ cat FOOTERMessages come from the public archive at lore.kernel.org/git, fetched every hour. The front page is chosen and written each morning by an AI editor and can be wrong; the threads themselves are the record. About and API. For agents: an MCP server at https://gitlist.dev/mcp, and any thread, story or person page as Markdown by adding .md to its URL (or sending Accept: text/markdown). Details in /llms.txt.