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

Data race on ioctl #156

Closed
spikecurtis opened this issue Jul 26, 2022 · 1 comment
Closed

Data race on ioctl #156

spikecurtis opened this issue Jul 26, 2022 · 1 comment

Comments

@spikecurtis
Copy link

I'm seeing data races when calling pty.Setsize , c.f. coder/coder#3236

I think what's going on here is that calling Fd() on an os.File is inherently racy if multiple goroutines have reference to the file. While Read() and Write() go through the fdmutex, Fd() does not.

I believe the correct fix is to wrap calls like ioctl in SyscallConn.

In testing this out locally, I noticed that it breaks riscv builds, which are apparently still on Go 1.6. I saw #149 mention that it should be possible to get riscv builds natively, so hopefully this isn't a blocker.

Does that sound right to you and would you be interested in a PR?

sio added a commit to sio/creack-pty that referenced this issue Apr 28, 2023
When compiled with go older than 1.12 creack/pty will not include a fix
for blocking Read() and will be prone to data races - but at least it will work

For more information see issues: creack#88 creack#114 creack#156 creack#162
sio added a commit to sio/creack-pty that referenced this issue Apr 28, 2023
When compiled with go older than 1.12 creack/pty will not include a fix
for blocking Read() and will be prone to data races - but at least it will work

For more information see issues: creack#88 creack#114 creack#156 creack#162
aymanbagabas pushed a commit to aymanbagabas/pty that referenced this issue Sep 22, 2023
When compiled with go older than 1.12 creack/pty will not include a fix
for blocking Read() and will be prone to data races - but at least it will work

For more information see issues: creack#88 creack#114 creack#156 creack#162
@creack
Copy link
Owner

creack commented Oct 28, 2023

Closed with #167

@creack creack closed this as completed Oct 28, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants