os: O_RDWR|O_NONBLOCK leads to blocking pipe read behavior on linux/armv7l #47715
Labels
FrozenDueToAge
NeedsInvestigation
Someone must examine and confirm this is a valid issue and not a duplicate of an existing one.
Milestone
What version of Go are you using (
go version
)?Does this issue reproduce with the latest release?
I reproduce this behavior with go1.16.7.
What operating system and processor architecture are you using (
go env
)?go env
OutputWhat did you do?
To I check effectiveness of unix.O_NONBLOCK, I write a program that opens a named pipe with unix.O_RDWR and unix.O_NONBLOCK. Yes, opening a named pipe with unix.O_RDWR is nonsense. This is only for checking the behavior.
When I run the program on Arm Linux, f.Read() blocks. If I replace unix.O_RDWR with unix.O_RDONLY, f.Read() reports an error. I write an equivalent on C and C's read() reports an error.
with unix.O_RDWR ... rdwr.go.txt
with unix.O_RDONLY ... rdonly.go.txt
an equivalent on C ... rdwr.c.txt
Environment of Arm linux:
Is this a spec or a bug?
What did you expect to see?
Like C, f.Read() should return immediately.
What did you see instead?
f.Read() blocks.
The text was updated successfully, but these errors were encountered: