-
-
Notifications
You must be signed in to change notification settings - Fork 5.5k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
integer truncation in truncate on Windows #24466
Comments
Looks like it used to be If |
MinGW is long dead |
Consequence of this bug: on Windows 64-bit files larger than 2 GB cannot be truncated. For example, JLD2-files are now limited to 2 GB size. Looks like cygwin64/mingw64-x86_64 is used to compile the version downloadable at https://julialang.org/downloads/ . And looks like mingw64 has If we are targeting systems newer than Windows XP, |
Should allow files >2 GB to be truncated on Windows. Fix #24466 Checking Windows 32bit build https://julialang-s3.julialang.org/bin/winnt/x86/0.6/julia-0.6.1-win32.exe, libgit2.dll already uses `_chsize_s`, so both 32bit and 64bit should be able to use `_chsize_s`.
Should allow files >2 GB to be truncated on Windows. Fix JuliaLang#24466 Checking Windows 32bit build https://julialang-s3.julialang.org/bin/winnt/x86/0.6/julia-0.6.1-win32.exe, libgit2.dll already uses `_chsize_s`, so both 32bit and 64bit should be able to use `_chsize_s`.
Should allow files >2 GB to be truncated on Windows. Fix #24466 Checking Windows 32bit build https://julialang-s3.julialang.org/bin/winnt/x86/0.6/julia-0.6.1-win32.exe, libgit2.dll already uses `_chsize_s`, so both 32bit and 64bit should be able to use `_chsize_s`. Ref #24616 (cherry picked from commit ff045af)
While ios_trunc accepts a size argument of type
size_t
, it calls _chsize, which takes along
(32-bit int on Windows), and it doesn't check for overflow. As a result, this fails:ios_trunc
should probably be modified to use _chsize_s.(Originally reported as JuliaIO/JLD2.jl#50.)
The text was updated successfully, but these errors were encountered: