#37447 exposes this bug as problematic. If the function preceeding lostProfileEvent contains inlined functions, then runtime_expandInlineFrames will panic when it tries to lookup the PC in the wrong function. Something like:
runtime: invalid pc-encoded table f=runtime/pprof.addMaxRSS pc=0x59145d targetpc=0x59145f tab=[0/0]0x0
value=-1 until pc=0x59143c
value=0 until pc=0x591443
value=-1 until pc=0x59145d
fatal error: invalid runtime symbol table
At HEAD, this isn't a problem because runtime/pprof.addMaxRSS precedes lostProfileEvent and contains no inlined calls, thus runtime_expandInlineFrames short-circuits. N.B., I modified addMaxRSS to add an inlined call for the panic above.
I'll need to double check if this is a problem for 1.14.1, but even if not, we probably want to patch 1.14.2, as subtle build order changes could break things.