Skip to content

Commit

Permalink
runtime: get more info for TestCgoSignalDeadlock failures
Browse files Browse the repository at this point in the history
Updates #18598

Change-Id: I13c60124714cf9d1537efa0a7dd1e6a0fed9ae5b
Reviewed-on: https://go-review.googlesource.com/46723
Run-TryBot: Ian Lance Taylor <iant@golang.org>
Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org>
TryBot-Result: Gobot Gobot <gobot@golang.org>
  • Loading branch information
ianlancetaylor committed Jun 27, 2017
1 parent 09899d9 commit 93870ae
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions src/runtime/testdata/testprogcgo/cgo.go
Expand Up @@ -45,10 +45,13 @@ func CgoSignalDeadlock() {
}()
var s *string
*s = ""
fmt.Printf("continued after expected panic\n")
}()
}
}()
time.Sleep(time.Millisecond)
start := time.Now()
var times []time.Duration
for i := 0; i < 64; i++ {
go func() {
runtime.LockOSThread()
Expand All @@ -62,16 +65,17 @@ func CgoSignalDeadlock() {
ping <- false
select {
case <-ping:
times = append(times, time.Since(start))
case <-time.After(time.Second):
fmt.Printf("HANG\n")
fmt.Printf("HANG 1 %v\n", times)
return
}
}
ping <- true
select {
case <-ping:
case <-time.After(time.Second):
fmt.Printf("HANG\n")
fmt.Printf("HANG 2 %v\n", times)
return
}
fmt.Printf("OK\n")
Expand Down

0 comments on commit 93870ae

Please sign in to comment.