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

Sockets test fail on FreeBSD 12 #41942

Closed
ararslan opened this issue Aug 20, 2021 · 2 comments · Fixed by #42005
Closed

Sockets test fail on FreeBSD 12 #41942

ararslan opened this issue Aug 20, 2021 · 2 comments · Fixed by #42005
Labels
bug Indicates an unexpected problem or unintended behavior system:freebsd Affects only FreeBSD

Comments

@ararslan
Copy link
Member

It seems #40783 broke one of the Sockets tests on FreeBSD 12:

@test !isopen(P) # eof test should have closed this by now

Following along the steps taken in the tests,

p = Pipe()
Base.link_pipe!(p)
write(p, "hello")
read(p, Char)
read(p, Char)
@async begin
    write(p, "w")
    while p.out.status != Base.StatusOpen
        yield()
    end
    close(p.in)
end
readuntil(p, 'w')
eof(p)

you'll get true from the final EOF check on any platform. However, p.out.status is Base.StatusEOF on FreeBSD with and Base.StatusClosed on macOS. Prior to #40783, p.out.status was Base.StatusClosed on both platforms.

@ararslan ararslan added bug Indicates an unexpected problem or unintended behavior system:freebsd Affects only FreeBSD labels Aug 20, 2021
@vtjnash
Copy link
Member

vtjnash commented Aug 20, 2021

Looking closer at the documentation for FreeBSD pipe, I see they are not fully posix-compatible since FreeBSD 2.2.1 https://www.freebsd.org/cgi/man.cgi?query=pipe&apropos=0&sektion=2&manpath=FreeBSD+2.2.1-RELEASE&arch=default&format=html, so it leads to surprises here.

@ararslan
Copy link
Member Author

So would the issue be with how libuv is interacting with the OS's pipes or is it on the Julia side? (I guess it could be both)

vtjnash added a commit that referenced this issue Aug 25, 2021
vtjnash added a commit that referenced this issue Aug 26, 2021
A stream can continue to be read after closewrite,
but cannot continue to be written to after seeing EOF.

Replaces #42004
Replaces #41983
Fixes #41942
Refs #40783
LilithHafner pushed a commit to LilithHafner/julia that referenced this issue Feb 22, 2022
A stream can continue to be read after closewrite,
but cannot continue to be written to after seeing EOF.

Replaces JuliaLang#42004
Replaces JuliaLang#41983
Fixes JuliaLang#41942
Refs JuliaLang#40783
LilithHafner pushed a commit to LilithHafner/julia that referenced this issue Mar 8, 2022
A stream can continue to be read after closewrite,
but cannot continue to be written to after seeing EOF.

Replaces JuliaLang#42004
Replaces JuliaLang#41983
Fixes JuliaLang#41942
Refs JuliaLang#40783
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Indicates an unexpected problem or unintended behavior system:freebsd Affects only FreeBSD
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants