Skip to content

Path to stdlib files is incorrect in stacktraces #35191

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
non-Jedi opened this issue Mar 20, 2020 · 1 comment · Fixed by #37427
Closed

Path to stdlib files is incorrect in stacktraces #35191

non-Jedi opened this issue Mar 20, 2020 · 1 comment · Fixed by #37427
Labels
good first issue Indicates a good issue for first-time contributors to Julia

Comments

@non-Jedi
Copy link
Contributor

non-Jedi commented Mar 20, 2020

I'm trying to develop the Emacs inferior-julia to have clickable paths in stacktraces. One issue I'm having is that errors from stdlib don't have their correct path shown, e.g.:

julia> rand(3) * rand(4,5)
ERROR: DimensionMismatch("A has dimensions (3,1) but B has dimensions (4,5)")
Stacktrace:
 [1] gemm_wrapper!(::Array{Float64,2}, ::Char, ::Char, ::Array{Float64,2}, ::Array{Float64,2}, ::Bool, ::Bool) at /buildworker/worker/package_linux64/build/usr/share/julia/stdlib/v1.4/LinearAlgebra/src/matmul.jl:569
 [2] mul! at /buildworker/worker/package_linux64/build/usr/share/julia/stdlib/v1.4/LinearAlgebra/src/matmul.jl:169 [inlined]
 [3] mul! at /buildworker/worker/package_linux64/build/usr/share/julia/stdlib/v1.4/LinearAlgebra/src/matmul.jl:208 [inlined]
 [4] * at /buildworker/worker/package_linux64/build/usr/share/julia/stdlib/v1.4/LinearAlgebra/src/matmul.jl:160 [inlined]
 [5] *(::Array{Float64,1}, ::Array{Float64,2}) at /buildworker/worker/package_linux64/build/usr/share/julia/stdlib/v1.4/LinearAlgebra/src/matmul.jl:63
 [6] top-level scope at REPL[1]:1

I'm assuming that /buildworker/worker/package_linux64/build/usr/share/julia/stdlib/v1.4 is the directory that the stdlib was in while Julia was being built. On the other hand, packages installed with Pkg show the correct absolute path even though it's different on each machine, e.g.:

julia> using Unitful; uconvert(u"ft", 1u"inch^2")
ERROR: DimensionError: ft and inch^2 are not dimensionally compatible.
Stacktrace:
 [1] #s56#151 at /home/adam/.julia/packages/Unitful/dZYmO/src/conversion.jl:12 [inlined]
 [2] #s56#151(::Any, ::Any, ::Any) at ./none:0
 [3] (::Core.GeneratedFunctionStub)(::Any, ::Vararg{Any,N} where N) at ./boot.jl:526
 [4] uconvert(::Unitful.FreeUnits{(ft,),𝐋,nothing}, ::Quantity{Int64,𝐋^2,Unitful.FreeUnits{(inch^2,),𝐋^2,nothing}}) at /home/adam/.julia/packages/Unitful/dZYmO/src/conversion.jl:74
 [5] top-level scope at REPL[2]:1

This is similar to #26314 but was not addressed by #32763.

@non-Jedi non-Jedi reopened this May 14, 2020
@KristofferC
Copy link
Member

The code here:

print(iob, " at ", method.file, ":", method.line)

can be modified to

file, line = updated_methodloc(method)
print(iob, " at ", file, ":", line) 

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
good first issue Indicates a good issue for first-time contributors to Julia
Projects
None yet
2 participants