Open yasushi-saito opened 3 years ago
The problem is that the three control FDs (3, 4, 5) used by the testee to communicate with the tester aren't marked close-on-exec. So if the testee forks and dies, the child will keep the tester from completing the reads of the descriptors. Adding
for _, fd := range []uintptr{3, 4, 5} { r1, r2, err := syscall.Syscall(syscall.SYS_FCNTL, fd, syscall.F_GETFD, 0) _, _, err = syscall.Syscall(syscall.SYS_FCNTL, fd, syscall.F_SETFD, r1|syscall.FD_CLOEXEC) }
at the beginning of Fuzz function fixes this problem. This logic should really be added somewhere go-fuzz-dep/main.go.
Fuzz
go-fuzz-dep/main.go
The problem is that the three control FDs (3, 4, 5) used by the testee to communicate with the tester aren't marked close-on-exec. So if the testee forks and dies, the child will keep the tester from completing the reads of the descriptors. Adding
at the beginning of
Fuzz
function fixes this problem. This logic should really be added somewherego-fuzz-dep/main.go
.