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
Open

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

ianlancetaylor opened this issue Jul 2, 2018 · 0 comments
Labels
NeedsInvestigation Someone must examine and confirm this is a valid issue and not a duplicate of an existing one.
Milestone

Comments

@ianlancetaylor
Copy link
Contributor

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 the NeedsInvestigation Someone must examine and confirm this is a valid issue and not a duplicate of an existing one. label Jul 2, 2018
@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
Labels
NeedsInvestigation Someone must examine and confirm this is a valid issue and not a duplicate of an existing one.
Projects
None yet
Development

No branches or pull requests

1 participant