gccgo: syscall.Syscall error result is not reliable #26183
Labels
NeedsInvestigation
Someone must examine and confirm this is a valid issue and not a duplicate of an existing one.
Milestone
The implementation of syscall.Syscall in the Go frontend version of the library sets
errno
to0
, calls the C library functionsyscall
, and then checkserrno
. If the final value oferrno
is not0
, thensyscall.Syscall
returns a non-nilerror
value. This is the only documented way to check whether the Csyscall
function failed. Unfortunately, it is not reliable if a signal handler runs on the thread whilesyscall
is executing. The signal handler may happen to seterrno
to a non-zero value while it executes. We should figure out a more reliable way to determine whethersyscall
failed. This may require writing assembly code.The text was updated successfully, but these errors were encountered: