microsoft / microsoft/VFSForGit
Cannot access 4 GB or bigger files through the ProjFS driver
Nobody has claimed this yet.
- Dominant language
- C#
- Stars
- 6.1k
- Forks
- 474
- Avg merge
- 2d 4h
- Merged PRs (30d)
- 8
Description
There seem to be an arithmetic overflow somewhere. The IVirtualizationInstance.OnGetFileStream (from ProjectedFSLib.Managed.dll) callback is invoked with:
- for a 4 GB file: a
byteOffsetof 0 andlengthof 0 - for a 4 GB file + 1 byte: a
byteOffsetof 0 andlengthof 1 - for a 4 GB file - 1 byte: a
byteOffsetof 0 andlengthof 4294967295
Steps to reproduce:
- Build the MirrorProvider by running
MirrorProvider\Scripts\Windows\Build.bat. - Create a
C:\PathToMirrorfolder. - Generate a 4 GB file, for exemple by running the following Python code:
with open('C:\\PathToMirror\\huge_file_4GB.bin', 'wb') as f: f.seek(4*1024*1024*1024 - 1) f.write(b"\0") - Clone and mount the MirrorProvider by running
MirrorProvider\Scripts\Windows\MirrorProvider_Clone.batand thenMirrorProvider\Scripts\Windows\MirrorProvider_Mirror.bat. - Open and read data from the mirrored file
C:\TestRoot\src\huge_file_4GB.bin, for exemple by running the following Python code:with open('C:\\TestRoot\\src\\huge_file_4GB.bin', 'rb') as f: something = f.read(1) - Notice the following failure in the MirrorProvider output:
Note that the -2147024362 HResult is E_ARITHMETIC_OVERFLOW.GetPlaceholderInformation: `huge_file_4GB.bin` GetFileStream: `huge_file_4GB.bin` WriteFile faild: -2147024362 GetFileStream: `huge_file_4GB.bin` WriteFile faild: -2147024362 GetFileStream: `huge_file_4GB.bin` WriteFile faild: -2147024362 GetFileStream: `huge_file_4GB.bin` WriteFile faild: -2147024362 GetFileStream: `huge_file_4GB.bin` WriteFile faild: -2147024362 GetFileStream: `huge_file_4GB.bin` WriteFile faild: -2147024362 GetFileStream: `huge_file_4GB.bin` WriteFile faild: -2147024362
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start by reproducing the issue with MirrorProvider\Scripts\Windows\Build.bat, MirrorProvider_Clone.bat, and MirrorProvider_Mirror.bat, then inspect IVirtualizationInstance.OnGetFileStream and the MirrorProvider output. Compare byteOffset and length for files around 4 GB and trace where the arithmetic overflow produces E_ARITHMETIC_OVERFLOW. Done means reads from 4 GB and larger files succeed without overflow.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- csharp
- Domain
- operating-systems
- Issue type
- Bug
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 42/100