proc: fix rangeFuncStackTrace with inlined functions (#3849)
If an inlined function is encountered we should keep searching for its rangeParent even if we don't have a closurePtr because it could be that the function has been inlined into its rangeParent. This does not need a new test, the existing tests already fail on go1.24.
This commit is contained in:
parent
822014b8e8
commit
e9616a7f98
@ -964,7 +964,7 @@ func rangeFuncStackTrace(tgt *Target, g *G) ([]Stackframe, error) {
|
|||||||
if fr.SystemStack {
|
if fr.SystemStack {
|
||||||
return false
|
return false
|
||||||
}
|
}
|
||||||
if closurePtr == 0 && optimized(fr.Call.Fn) {
|
if closurePtr == 0 && optimized(fr.Call.Fn) || frames[len(frames)-1].Inlined {
|
||||||
return true
|
return true
|
||||||
}
|
}
|
||||||
if closurePtr < 0 {
|
if closurePtr < 0 {
|
||||||
@ -1021,7 +1021,7 @@ func rangeFuncStackTrace(tgt *Target, g *G) ([]Stackframe, error) {
|
|||||||
if rangeParent == nil {
|
if rangeParent == nil {
|
||||||
stop = true
|
stop = true
|
||||||
}
|
}
|
||||||
if !optimized(fr.Call.Fn) && closurePtr == 0 {
|
if !optimized(fr.Call.Fn) && !fr.Inlined && closurePtr == 0 {
|
||||||
stop = true
|
stop = true
|
||||||
}
|
}
|
||||||
if stop {
|
if stop {
|
||||||
@ -1042,6 +1042,11 @@ func rangeFuncStackTrace(tgt *Target, g *G) ([]Stackframe, error) {
|
|||||||
stage = doneStage
|
stage = doneStage
|
||||||
return false
|
return false
|
||||||
}
|
}
|
||||||
|
} else if frames[len(frames)-1].Inlined && !fr.Inlined && closurePtr == 0 {
|
||||||
|
frames = nil
|
||||||
|
addRetFrame = false
|
||||||
|
stage = doneStage
|
||||||
|
return false
|
||||||
}
|
}
|
||||||
case lastFrameStage:
|
case lastFrameStage:
|
||||||
frames = append(frames, fr)
|
frames = append(frames, fr)
|
||||||
|
Loading…
Reference in New Issue
Block a user