
proc.(*Process) methods are not thread safe, multiple clients connecting simultaneously to a delve server (Issue #383) or a even a single over-eager client (Issue #408) can easily crash it. Additionally (Issue #419) calls to client.(*RPCClient).Halt can crash the server because they can result in calling the function debug/dwarf.(*Data).Type simultaneously in multiple threads which will cause it to return incompletely parsed dwarf.Type values. Fixes #408, #419 (partial)
25 lines
280 B
Go
25 lines
280 B
Go
package main
|
|
|
|
import (
|
|
"fmt"
|
|
"os"
|
|
"os/signal"
|
|
)
|
|
|
|
func main() {
|
|
|
|
fmt.Println("Start")
|
|
|
|
sc := make(chan os.Signal, 1)
|
|
|
|
//os.Interrupt, os.Kill
|
|
signal.Notify(sc, os.Interrupt, os.Kill)
|
|
|
|
quit := <-sc
|
|
|
|
fmt.Printf("Receive signal %s \n", quit.String())
|
|
|
|
fmt.Println("End")
|
|
|
|
}
|