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

Re: trouble on windows network share

From
Jeff King <peff@peff.net>
Date
Apr 4, 2013, 15:51 UTC
Message-ID
<20130404155112.GA11622@sigill.intra.peff.net>
In-Reply-To
<871B6C10EBEFE342A772D1159D1320853F63D205@umechphj.easf.csd.disa.mil>
On Thu, Apr 04, 2013 at 03:01:36PM +0000, Pyeron, Jason J CTR (US) wrote:
Show 9 quoted lines
> I am having trouble when the .git folder is on a network share, given the below where should I start on my debugging?
> [...]
> jason.pyeron@localhost //server/share/dir/subdir/test
> $ git add test.txt
> 
> jason.pyeron@localhost //server/share/dir/subdir/test
> $ git commit -m test
> error: unable to find 8b7323820a21ebd1360e27262b3c61283c266c23
> fatal: 8b7323820a21ebd1360e27262b3c61283c266c23 is not a valid object
Hmm. That message probably comes from:
  static int sha1_loose_object_info(const unsigned char *sha1, unsigned long *sizep)
  {
  [...]
          map = map_sha1_file(sha1, &mapsize);
          if (!map)
                  return error("unable to find %s", sha1_to_hex(sha1));

So we have found the object and know that it is loose, but then mmap-ing it fails. My guess is that your system does not support mmap across network shares (whether this is an OS issue or a cygwin limitation, I don't know). You could confirm it by running your "git commit" under strace, which I expect would show mmap returning -ENODEV or similar.

You can work around it by compiling git with NO_MMAP=1.

You might also try msysgit rather than cygwin, which seems to have its own win32 mmap compatibility layer.

Finally, I suspect we could include our emulate-mmap-with-pread compatibility wrapper all the time, and drop back to it automatically at run-time when we see ENODEV or a similar error return from mmap.

-Peff
Previous: Pyeron, Jason J CTR (US)Next: Pyeron, Jason J CTR (US)
Message 2 of 17 in “trouble on windows network share”
  1. Pyeron, Jason J CTR (US)Apr 4, 2013
  2. Jeff KingApr 4, 2013
  3. Pyeron, Jason J CTR (US)Apr 5, 2013
  4. Jeff KingApr 11, 2013
  5. degMay 2, 2013
  6. Thomas RastMay 3, 2013
  7. David GoldfarbMay 4, 2013
  8. Thomas RastMay 6, 2013
  9. David GoldfarbMay 6, 2013
  10. Thomas RastMay 6, 2013
  11. David GoldfarbMay 6, 2013
  12. David GoldfarbMay 6, 2013
  13. Pyeron, Jason J CTR (US)May 6, 2013
  14. David GoldfarbMay 8, 2013
  15. Pyeron, Jason J CTR (US)May 9, 2013
  16. Phil WiffenDec 3, 2013
  17. Pyeron, Jason J CTR (US)Dec 3, 2013

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.