Julia is pointing to a wrong line when an error occur

Hi guys,

After updating to Julia v0.7, I am seeing some strange behavior when an error occurs. Julia is saying that the error is occurring in a wrong line. See for example this message:

julia> include("teste.jl")
[ Info: Recompiling stale cache file /Users/ronan.arraes/.julia/compiled/v0.7/MGEO/LkOqr.ji for MGEO [16b43e94-9cbd-11e8-382f-951ad8972bfe]
ERROR: LoadError: setindex!(::StaticArrays.SArray{Tuple{2},Float64,1,2}, value, ::Int) is not defined.
Stacktrace:
 [1] error(::String) at ./error.jl:33
 [2] setindex!(::StaticArrays.SArray{Tuple{2},Float64,1,2}, ::Float64, ::Int64) at /Users/ronan.arraes/.julia/packages/StaticArrays/Ze5H/src/indexing.jl:3
 [3] mgeo_run(::MGEO_Structure{2,2,MGEO.Design_Variable_MGEO_Real}, ::typeof(f_obj4), ::Bool) at /Users/ronan.arraes/tmp/MGEO/src/mgeo_real.jl:90
 [4] top-level scope at util.jl:156
 [5] include at ./boot.jl:317 [inlined]
 [6] include_relative(::Module, ::String) at ./loading.jl:1038
 [7] include(::Module, ::String) at ./sysimg.jl:29
 [8] include(::String) at ./client.jl:398
 [9] top-level scope at none:0
in expression starting at /Users/ronan.arraes/tmp/MGEO/teste.jl:45

When I look to line 90 in mgeo_real.jl, I see:

86    @inbounds for run = 1:mgeod.run_max
87        if show_debug
88            println("--------------------------------------------------------------------------------")
89            println("RUN = $run")
90            println("")
91            println("Generations ($ngen_max_per_run):")
92            print("    0%")
93        end

Is it a known bug?

I failed to find something related to it. Hence, I filed a bug: Corrupt linenumber in stacktraces for functions with macros · Issue #28618 · JuliaLang/julia · GitHub

1 Like