Cthulhu.jl icon indicating copy to clipboard operation
Cthulhu.jl copied to clipboard

BoundsError when using @descend on a function using @profile

Open tjgreen42 opened this issue 7 years ago • 1 comments

               _
   _       _ _(_)_     |  Documentation: https://docs.julialang.org
  (_)     | (_) (_)    |
   _ _   _| |_  __ _   |  Type "?" for help, "]?" for Pkg help.
  | | | | | | |/ _` |  |
  | | |_| | | | (_| |  |  Version 1.1.1 (2019-05-16)
 _/ |\__'_|_|_|\__'_|  |  Official https://julialang.org/ release
|__/                   |

julia> using Cthulhu

julia> using Profile

julia> function run()
           @profile println()
       end
run (generic function with 1 method)

julia> @descend run()
ERROR: BoundsError: attempt to access 10-element Array{Int64,1} at index [0]
Stacktrace:
 [1] getindex(::Array{Int64,1}, ::Int64) at ./array.jl:729
 [2] Core.Compiler.IncrementalCompact(::Core.Compiler.IRCode, ::Bool) at ./compiler/ssair/ir.jl:510
 [3] dce!(::Core.CodeInfo, ::Core.MethodInstance) at /Users/green/.julia/packages/Cthulhu/F3tIT/src/reflection.jl:161
 [4] preprocess_ci!(::Core.CodeInfo, ::Core.MethodInstance, ::Bool) at /Users/green/.julia/packages/Cthulhu/F3tIT/src/reflection.jl:191
 [5] #_descend#37(::Bool, ::Core.Compiler.Params, ::Bool, ::Base.Iterators.Pairs{Union{},Union{},Tuple{},NamedTuple{(),Tuple{}}}, ::Function, ::Core.MethodInstance) at /Users/green/.julia/packages/Cthulhu/F3tIT/src/Cthulhu.jl:122
 [6] #_descend at ./none:0 [inlined]
 [7] #_descend#42(::Core.Compiler.Params, ::Base.Iterators.Pairs{Symbol,Bool,Tuple{Symbol},NamedTuple{(:iswarn,),Tuple{Bool}}}, ::Function, ::Any, ::Any) at /Users/green/.julia/packages/Cthulhu/F3tIT/src/Cthulhu.jl:211
 [8] #_descend at ./none:0 [inlined]
 [9] #_descend_with_error_handling#36(::Base.Iterators.Pairs{Symbol,Bool,Tuple{Symbol},NamedTuple{(:iswarn,),Tuple{Bool}}}, ::Function, ::Function, ::Any) at /Users/green/.julia/packages/Cthulhu/F3tIT/src/Cthulhu.jl:88
 [10] #_descend_with_error_handling at ./none:0 [inlined]
 [11] #descend_code_typed#35 at /Users/green/.julia/packages/Cthulhu/F3tIT/src/Cthulhu.jl:62 [inlined]
 [12] descend_code_typed(::Function, ::Any) at /Users/green/.julia/packages/Cthulhu/F3tIT/src/Cthulhu.jl:62
 [13] top-level scope at none:0

julia> versioninfo()
Julia Version 1.1.1
Commit 55e36cc (2019-05-16 04:10 UTC)
Platform Info:
  OS: macOS (x86_64-apple-darwin15.6.0)
  CPU: Intel(R) Core(TM) i7-7820HQ CPU @ 2.90GHz
  WORD_SIZE: 64
  LIBM: libopenlibm
  LLVM: libLLVM-6.0.1 (ORCJIT, skylake)
Environment:
  JULIA_EDITOR = vim

(v1.1) pkg> status
    Status `~/.julia/environments/v1.1/Project.toml`
  [c52e3926] Atom v0.8.8
  [6e4b80f9] BenchmarkTools v0.4.2
  [f68482b8] Cthulhu v0.1.0 #master (https://github.com/JuliaDebug/Cthulhu.jl)
  [864edb3b] DataStructures v0.17.0
  [e5e0dc1b] Juno v0.7.0
  [c46f51b8] ProfileView v0.4.1
  [295af30f] Revise v2.1.6
  [a8a75453] StatProfilerHTML v0.4.0
  [0796e94c] Tokenize v0.5.4

tjgreen42 avatar Jul 24 '19 18:07 tjgreen42

dup of #28 and fixed by https://github.com/JuliaLang/julia/pull/32145

vchuravy avatar Jul 24 '19 20:07 vchuravy