Created
April 15, 2022 04:27
-
-
Save bwester/ce562a29ca126791d64f1aa054cf5429 to your computer and use it in GitHub Desktop.
A minimal Go program that can cause a deadlock in the Exec call. Compile with CGO_ENABLED=0. Tested on macOS 11.6.5, go1.18.1 darwin/amd64.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package main | |
import ( | |
"log" | |
"os" | |
"os/signal" | |
"syscall" | |
) | |
func main() { | |
signal.Notify(make(chan os.Signal, 1), syscall.SIGHUP) | |
log.Fatal(syscall.Exec("/usr/bin/true", []string{"true"}, nil)) | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment