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
x/exp/mmap: mapping 0 length file is already closed #56261
Labels
FrozenDueToAge
help wanted
NeedsFix
The path to resolution is known, but the work has not been done.
Milestone
Comments
Simple as this is, a reproducer would still be nice. |
I will add one this evening. |
Attaching test case. Notice that 0 length file returns 'closed', while a non-zero file returns the expected EOF. |
ianlancetaylor
changed the title
mmap: mapping 0 length file is already closed
x/exp/mmap: mapping 0 length file is already closed
Oct 17, 2022
CC @nigeltao who originally wrote x/exp/mmap. |
ianlancetaylor
added
help wanted
NeedsInvestigation
Someone must examine and confirm this is a valid issue and not a duplicate of an existing one.
labels
Oct 17, 2022
Change https://go.dev/cl/443576 mentions this issue: |
dmitshur
added
NeedsFix
The path to resolution is known, but the work has not been done.
and removed
NeedsInvestigation
Someone must examine and confirm this is a valid issue and not a duplicate of an existing one.
labels
Oct 18, 2022
udzura
added a commit
to udzura/bitcaskdb
that referenced
this issue
Apr 17, 2023
Better handling for opening 0 sized file. ref: golang/go#56261
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
Labels
FrozenDueToAge
help wanted
NeedsFix
The path to resolution is known, but the work has not been done.
Does this issue reproduce with the latest release?
Yes
What operating system and processor architecture are you using (
go env
)?go env
OutputIf you use mmap to map a file of 0 length, any future usage of the mapped file results in an error
mmap: closed
The offending code is:
in mmap_unix.go, in
func Open(filename string) (*ReaderAt, error)
- lines 92-95.I don't think this is correct or expected behavior. You should be able to mmap a zero length file and use it.
The text was updated successfully, but these errors were encountered: