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
Mmap bus error #28245
Comments
Works for me. |
I also got a |
I get bus error if specified shape larger than the file size. Julia would crash. Is it possible to make it not crash the session and only report an error? I think it could check filesize first. |
using Mmap
A = rand(1:0.5:20, 5, 30)
s = open("mmap.bin", "w+")
write(s, A)
close(s)
B = Mmap.mmap(open("mmap.bin"), Matrix{Float64}, (4096,30)) This would crash with Bus Error on Ubuntu 16.04 with julia 1.3.1 . While on Win 10 it only prints an error. |
Does this still crash for some people? |
The original poster code doesn' t crash. My code in the comment above still crashes in Ubuntu 20.04, julia 1.6 and 1.7. |
As mentioned above #28245 (comment), there is a missing call to |
On 1.8 I still get weird errors. For example, depending on which position I access from the memmapped file the code crashes
|
Just a note that the Linux mmap documentation says SIGBUS occurs when an attempt is made to access pages of the mapping beyond the size of the file. |
Fixes: #28245 Co-authored-by: Jameson Nash <vtjnash@gmail.com> Co-authored-by: Stefan Karpinski <stefan@karpinski.org>
Still a bug on macOS |
Also happens for simple structs like
struct Wrapper; x::Int; end
. I plan on taking a look at this to see what's going on, but if anyone else has any ideas, please share in the mean time.The text was updated successfully, but these errors were encountered: