JuliaPerf / PProf.jl

Export Julia profiles to the pprof format
MIT License
154 stars 17 forks source link

PkgEval failure due to `KeyError` #57

Open vilterp opened 2 years ago

vilterp commented 2 years ago

https://s3.amazonaws.com/julialang-reports/nanosoldier/pkgeval/by_hash/f51f24c_vs_2ca8b0c/PProf.primary.log

  Got exception outside of a @test
  KeyError: key 0x00007fb686828010 not found
  Stacktrace:
    [1] getindex
      @ ./dict.jl:498 [inlined]
    [2] pprof(data::Nothing, lidict::Nothing; sampling_delay::Nothing, web::Bool, webhost::String, webport::Int64, out::String, from_c::Bool, full_signatures::Bool, drop_frames::Nothing, keep_frames::Nothing, ui_relative_percentages::Bool)
      @ PProf ~/.julia/packages/PProf/SfsWK/src/PProf.jl:199
    [3] macro expansion
      @ ~/.julia/packages/PProf/SfsWK/test/PProf.jl:39 [inlined]

I think I've seen this in CI before; never tracked it down though.

NHDaly commented 2 years ago

Thank you for filing this issue.

Yeah, it's only happening on 1.8, right? I think we should report this on the julia repository. it's a regression (or at least a change) in the Profile package that's causing this failure in a very simple test:

https://github.com/JuliaPerf/PProf.jl/blob/34c87242ec7a34333165d0c143c5bf147b4107df/test/PProf.jl#L29-L39

I actually don't know if this means PProf CPU profiles are entirely broken on julia master? or if this test is somehow hitting some weird corner case?

But we should definitely file this as a regression on the julia repo 👍 👍

cafaxo commented 2 years ago

I am also experiencing this issue on a recent master build of Julia.

               _
   _       _ _(_)_     |  Documentation: https://docs.julialang.org
  (_)     | (_) (_)    |
   _ _   _| |_  __ _   |  Type "?" for help, "]?" for Pkg help.
  | | | | | | |/ _` |  |
  | | |_| | | | (_| |  |  Version 1.9.0-DEV.183 (2022-03-14)
 _/ |\__'_|_|_|\__'_|  |  Commit 2e63293 (9 days old master)
|__/                   |

julia> using Profile

julia> using PProf

julia> @profile peakflops()
9.141912495979059e10

julia> pprof()
ERROR: KeyError: key 0x0000000000000001 not found
Stacktrace:
 [1] getindex
   @ ./dict.jl:499 [inlined]
 [2] pprof(data::Nothing, lidict::Nothing; sampling_delay::Nothing, web::Bool, webhost::String, webport::Int64, out::String, from_c::Bool, full_signatures::Bool, drop_frames::Nothing, keep_frames::Nothing, ui_relative_percentages::Bool)
   @ PProf ~/.julia/packages/PProf/ZEiZQ/src/PProf.jl:199
 [3] pprof (repeats 2 times)
   @ ~/.julia/packages/PProf/ZEiZQ/src/PProf.jl:105 [inlined]
 [4] top-level scope
   @ REPL[4]:1

StatProfilerHTML is also broken:

julia> statprofilehtml()
ERROR: KeyError: key 0x0000000000000001 not found
Stacktrace:
 [1] getindex
   @ ./dict.jl:499 [inlined]
 [2] StatProfilerHTML.Reports.Report(data::Vector{UInt64}, litrace::Dict{UInt64, Vector{Base.StackTraces.StackFrame}}, from_c::Bool)
   @ StatProfilerHTML.Reports ~/.julia/packages/StatProfilerHTML/FRimo/src/Reports.jl:106
 [3] statprofilehtml(data::Vector{UInt64}, litrace::Dict{UInt64, Vector{Base.StackTraces.StackFrame}}; from_c::Bool, path::String)
   @ StatProfilerHTML ~/.julia/packages/StatProfilerHTML/FRimo/src/StatProfilerHTML.jl:23
 [4] statprofilehtml (repeats 3 times)
   @ ~/.julia/packages/StatProfilerHTML/FRimo/src/StatProfilerHTML.jl:17 [inlined]
 [5] top-level scope
   @ REPL[10]:1
NHDaly commented 2 years ago

I've finally filed https://github.com/JuliaLang/julia/issues/44818 about it. Sorry, should've done this weeks ago.