Hello, i am trying to use the package runtime/trace
package main
import (
"fmt"
"os"
"os/signal"
"runtime/trace"
"syscall"
)
func main() {
f, err := os.Create("trace.out")
if err != nil {
panic(err)
}
defer f.Close()
err = trace.Start(f)
if err != nil {
panic(err)
}
defer trace.Stop()
// random stuff
a := 0
for i := 0; i < 10; i++ {
a += i
}
fmt.Println(a)
// end random stuff
sigint := make(chan os.Signal, 1)
signal.Notify(sigint, syscall.SIGINT)
<-sigint // this creates the problem
fmt.Println("THE END")
}
When running the above program i get the following error when using cmd/trace tool. Does anyone know why ? If i remove the line "<-sigint" (ie i don't wait for the Ctrl+C signal), it works.
> go tool trace trace.out
failed to parse trace: no consistent ordering of events possible
As anyone encountered this error ? How can i fix it without removing the signal catching thing (i need it to exit my app)

