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

gccgo: syscall.Syscall error result is not reliable #26183

Open
ianlancetaylor opened this issue Jul 2, 2018 · 0 comments

Comments

@ianlancetaylor
Copy link
Contributor

commented Jul 2, 2018

The implementation of syscall.Syscall in the Go frontend version of the library sets errno to 0, calls the C library function syscall, and then checks errno. If the final value of errno is not 0, then syscall.Syscall returns a non-nil error value. This is the only documented way to check whether the C syscall function failed. Unfortunately, it is not reliable if a signal handler runs on the thread while syscall is executing. The signal handler may happen to set errno to a non-zero value while it executes. We should figure out a more reliable way to determine whether syscall failed. This may require writing assembly code.

@ianlancetaylor ianlancetaylor added this to the Gccgo milestone Jul 2, 2018

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
1 participant
You can’t perform that action at this time.