Skip to content

Commit c0a7ecf

Browse files
prattmiccagedmantis
authored andcommitted
[release-branch.go1.15] runtime: non-strict InlTreeIndex lookup in expandFinalInlineFrame
This is a follow-up to golang.org/cl/301369, which made the same change in Frames.Next. The same logic applies here: a profile stack may have been truncated at an invalid PC provided by cgoTraceback. expandFinalInlineFrame will then try to lookup the inline tree and crash. The same fix applies as well: upon encountering a bad PC, simply leave it as-is and move on. For #44971 For #45480 Fixes #45481 Change-Id: I2823c67a1f3425466b05384cc6d30f5fc8ee6ddc Reviewed-on: https://go-review.googlesource.com/c/go/+/309109 Reviewed-by: Michael Knyszek <[email protected]> Trust: Michael Pratt <[email protected]> (cherry picked from commit aad13cb) Reviewed-on: https://go-review.googlesource.com/c/go/+/309550 Run-TryBot: Michael Pratt <[email protected]> Reviewed-by: Cherry Zhang <[email protected]> TryBot-Result: Go Bot <[email protected]>
1 parent 72ccabc commit c0a7ecf

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

src/runtime/symtab.go

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -185,7 +185,9 @@ func runtime_expandFinalInlineFrame(stk []uintptr) []uintptr {
185185
var cache pcvalueCache
186186
inltree := (*[1 << 20]inlinedCall)(inldata)
187187
for {
188-
ix := pcdatavalue(f, _PCDATA_InlTreeIndex, tracepc, &cache)
188+
// Non-strict as cgoTraceback may have added bogus PCs
189+
// with a valid funcInfo but invalid PCDATA.
190+
ix := pcdatavalue1(f, _PCDATA_InlTreeIndex, tracepc, &cache, false)
189191
if ix < 0 {
190192
break
191193
}

0 commit comments

Comments
 (0)