]> Cypherpunks repositories - gostls13.git/commitdiff
runtime: add msan calls before calling traceback functions
authorIan Lance Taylor <iant@golang.org>
Mon, 11 Jul 2016 01:44:09 +0000 (18:44 -0700)
committerIan Lance Taylor <iant@golang.org>
Tue, 23 Aug 2016 16:31:16 +0000 (16:31 +0000)
Tell msan that the arguments to the traceback functions are initialized,
in case the traceback functions are compiled with -fsanitize=memory.

Change-Id: I3ab0816604906c6cd7086245e6ae2e7fa62fe354
Reviewed-on: https://go-review.googlesource.com/24856
Run-TryBot: Ian Lance Taylor <iant@golang.org>
Reviewed-by: Dmitry Vyukov <dvyukov@google.com>
TryBot-Result: Gobot Gobot <gobot@golang.org>

src/runtime/traceback.go

index 80a54407b386e33f3db8daf75960887abd590555..884c9476fc68951b907d43cfcffefd2d13a364ad 100644 (file)
@@ -1077,6 +1077,9 @@ func callCgoSymbolizer(arg *cgoSymbolizerArg) {
                // or when on the system stack.
                call = asmcgocall
        }
+       if msanenabled {
+               msanwrite(unsafe.Pointer(arg), unsafe.Sizeof(cgoSymbolizerArg{}))
+       }
        call(cgoSymbolizer, noescape(unsafe.Pointer(arg)))
 }
 
@@ -1096,5 +1099,8 @@ func cgoContextPCs(ctxt uintptr, buf []uintptr) {
                buf:     (*uintptr)(noescape(unsafe.Pointer(&buf[0]))),
                max:     uintptr(len(buf)),
        }
+       if msanenabled {
+               msanwrite(unsafe.Pointer(&arg), unsafe.Sizeof(arg))
+       }
        call(cgoTraceback, noescape(unsafe.Pointer(&arg)))
 }