Skip to content
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

🐛 fix bus error on smaller readonly file in unix #44354

Merged
merged 10 commits into from
Aug 21, 2023
Prev Previous commit
Next Next commit
🐛 try fix ci fail
  • Loading branch information
xgdgsc authored and vtjnash committed Jul 18, 2023
commit 015812fd72de7f13f51e784b704bcd4405b20af1
6 changes: 5 additions & 1 deletion stdlib/Mmap/src/Mmap.jl
Original file line number Diff line number Diff line change
Expand Up @@ -209,7 +209,11 @@ function mmap(io::IO,

file_desc = gethandle(io)
szfile = convert(Csize_t, len + offset)
requestedSizeLarger = szfile > filesize(io)
requestedSizeLarger = false
if io isa Mmap.Anonymous
else
xgdgsc marked this conversation as resolved.
Show resolved Hide resolved
requestedSizeLarger = szfile > filesize(io)
end
# platform-specific mmapping
@static if Sys.isunix()
prot, flags, iswrite = settings(file_desc, shared)
Expand Down