Skip to content

cmd/internal/obj: frame pointer missing for small functions #18103

Closed
@randall77

Description

@randall77
func f() {
    g()
}

Generates

000000000044cc60 <main.f>:
  44cc60:       64 48 8b 0c 25 f8 ff    mov    %fs:0xfffffffffffffff8,%rcx
  44cc67:       ff ff 
  44cc69:       48 3b 61 10             cmp    0x10(%rcx),%rsp
  44cc6d:       76 06                   jbe    44cc75 <main.f+0x15>
  44cc6f:       e8 0c 00 00 00          callq  44cc80 <main.g>
  44cc74:       c3                      retq   
  44cc75:       e8 f6 85 ff ff          callq  445270 <runtime.morestack_noctxt>
  44cc7a:       eb e4                   jmp    44cc60 <main.f>

There's no frame pointer manipulation here. There probably should be, backtraces done by the kernel profiler will miss (or even be messed up?) by this omission.

Hit this issue while working on #16638. We require frame pointers on every frame to make callers work using frame pointers.
@dvyukov
@rsc
@aclements

Metadata

Metadata

Assignees

No one assigned

    Labels

    FrozenDueToAgeNeedsFixThe path to resolution is known, but the work has not been done.

    Type

    No type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions