Skip to content

Commit

Permalink
Remove fallback that assigns a module to inlined frames. (#51405)
Browse files Browse the repository at this point in the history
The work I did in #41099 introduced code which, if method information
could not be found for an inlined frame, would fall back to use the
module of the next-higher stack frame. This often worked there because
the only frames that would not be assigned a module at this point would
be e.g., `macro expansion` frames.

However, due to the performance impact of the way method roots are
currently encoded, the extra method roots were removed in #50546.

The result is that inlined frames were being assigned a potentially
incorrect module, rather than being left blank.

Example:
```
julia> @Btime plot([1 2 3], seriestype = :blah)
...
 [13] #invokelatest#2
    @ BenchmarkTools ./essentials.jl:901 [inlined]
 [14] invokelatest
    @ BenchmarkTools ./essentials.jl:896 [inlined]
...
```

(cherry picked from commit ed891d6)
  • Loading branch information
BioTurboNick authored and KristofferC committed Oct 3, 2023
1 parent 0c39aef commit 77b74c3
Showing 1 changed file with 0 additions and 1 deletion.
1 change: 0 additions & 1 deletion base/stacktraces.jl
Original file line number Diff line number Diff line change
Expand Up @@ -206,7 +206,6 @@ Base.@constprop :none function lookup(pointer::Ptr{Cvoid})
elseif miroots !== nothing
linfo = lookup_inline_frame_info(func, file, miroots)
end
linfo = linfo === nothing ? parentmodule(res[i + 1]) : linfo # e.g. `macro expansion`
end
res[i] = StackFrame(func, file, linenum, linfo, info[5]::Bool, info[6]::Bool, pointer)
end
Expand Down

0 comments on commit 77b74c3

Please sign in to comment.