Skip to content

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

Open
@ianlancetaylor

Description

@ianlancetaylor

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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    NeedsInvestigationSomeone must examine and confirm this is a valid issue and not a duplicate of an existing one.

    Type

    No type

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions