The arm gentraceback mishandled frame linkage values pointing
to the assembly return function. This function is special as
its frame size is zero and it contains only one instruction.
These conditions would preserve the frame pointer and result
in an off by one error when unwinding the caller.
Fixes #5124
R=golang-dev, bradfitz
CC=golang-dev
https://golang.org/cl/
8023043
nestedCall(func() {
n = runtime.Callers(2, pc)
})
- // The ARM cannot unwind all the way down to runtime.goexit.
- // See issue 5124.
- if n != len(name) && runtime.GOARCH != "arm" {
+ if n != len(name) {
t.Errorf("expected %d frames, got %d", len(name), n)
}
for i := 0; i < n; i++ {
if fname != name[i] {
t.Errorf("expected function name %s, got %s", name[i], fname)
}
- // The ARM cannot unwind frames past runtime.cgocall.
- // See issue 5124.
- if runtime.GOARCH == "arm" && i == 4 {
- break
- }
}
}
lr = *(uintptr*)sp;
if(fp == nil) {
fp = sp;
- if(pc > f->entry && f->frame >= 0)
- fp += f->frame;
+ if(pc > f->entry && f->frame >= sizeof(uintptr))
+ fp += f->frame - sizeof(uintptr);
+ fp += sizeof(uintptr);
}
if(skip > 0)