runtime: restore "goroutine in C code" message
authorIan Lance Taylor <ian@gcc.gnu.org>
Wed, 20 Sep 2017 00:33:29 +0000 (00:33 +0000)
committerIan Lance Taylor <ian@gcc.gnu.org>
Wed, 20 Sep 2017 00:33:29 +0000 (00:33 +0000)
    In the 1.9 upgrade I took out the word "goroutine" from a traceback
    showing a goroutine running in C code, to let TestCgoNumGoroutine
    pass.  However, it turns out that some code is actually checking for
    that string; for example,
    https://github.com/grpc/grpc-go/blob/master/test/leakcheck/leakcheck.go#L44
    So keep the message the same, and change the test.

    Reviewed-on: https://go-review.googlesource.com/64850

From-SVN: r252991

gcc/go/gofrontend/MERGE
libgo/go/runtime/testdata/testprogcgo/numgoroutine.go
libgo/go/runtime/traceback_gccgo.go

index 27bcb6e252df6ce836eeca43f1cace60dfd7d964..f6b5361a004dacdda2e49ba2e8f78e7ca64d5d5d 100644 (file)
@@ -1,4 +1,4 @@
-be69546afcac182cc93c569bc96665f0ef72d66a
+5fb74cd7192123a9ea06dcae0d5d8d0b3538db8f
 
 The first line of this file holds the git revision number of the last
 merge done from the gofrontend repository.
index 12fda49a1316c4fae98fcdb9bc64f557e3903233..68f1738dd6b303cc9fca2af3cc1a24ba6b6fd5d9 100644 (file)
@@ -75,6 +75,7 @@ func checkNumGoroutine(label string, want int) (string, bool) {
        sbuf := make([]byte, 32<<10)
        sbuf = sbuf[:runtime.Stack(sbuf, true)]
        n = strings.Count(string(sbuf), "goroutine ")
+       n -= strings.Count(string(sbuf), "goroutine in C code")
        if n != want {
                fmt.Printf("%s Stack: want %d; got %d:\n%s\n", label, want, n, string(sbuf))
                return "", false
index f29ccd7b56475ce7bb336583974481419e30cbc6..37c569887b0c6aba704460c33be670d3de054085 100644 (file)
@@ -216,7 +216,7 @@ func tracebackothers(me *g) {
                        print("\tgoroutine running on other thread; stack unavailable\n")
                        printcreatedby(gp)
                } else if readgstatus(gp)&^_Gscan == _Gsyscall {
-                       print("\tin C code; stack unavailable\n")
+                       print("\tgoroutine in C code; stack unavailable\n")
                        printcreatedby(gp)
                } else {
                        gp.traceback = &tb