Skip to content

Race in isTTY? #176

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

Closed
ammario opened this issue May 30, 2023 · 5 comments · Fixed by #187
Closed

Race in isTTY? #176

ammario opened this issue May 30, 2023 · 5 comments · Fixed by #187

Comments

@ammario
Copy link
Member

ammario commented May 30, 2023

We just saw this data race in coder/coder.

I'm assuming it was introduced here #167, but haven't thoroughly investigated.

ammario added a commit that referenced this issue May 30, 2023
@mafredri
Copy link
Member

mafredri commented Jun 12, 2023

@ammario It's the opposite, the issue was fixed in #167 and due to the revert, this issue became much more prevalent.

The problem must be that an os.File was wrapped without implementing SyscallConn and passed to entryhuman, which used the old behavior of .Fd() which is unsafe.

@mafredri
Copy link
Member

mafredri commented Jun 12, 2023

Actually, perhaps the fix in #167 was incomplete, it seems syncwriter always(?) wraps the writer, but does not implement SyscallConn, so the fix was never effective and reverted to the old unsafe behavior. Scratch that, it seems w2 (unwrapped) is what's passed to entryhuman.Fmt, so that does not seem to be the problem.

@mafredri
Copy link
Member

The actual issue is that #167 wasn't used. The linked error shows slog v1.5.3 being used. #167 wasn't merged until v1.5.4.

@ammario
Copy link
Member Author

ammario commented Jun 12, 2023

Ok.. So revert the revert?

@coadler
Copy link
Contributor

coadler commented Aug 17, 2023

Unreverted by #187

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

Successfully merging a pull request may close this issue.

3 participants