Skip to content
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

[Power] First execution of backtrace() includes itself in trace #38858

Closed
vchuravy opened this issue Dec 12, 2020 · 2 comments · Fixed by #38886
Closed

[Power] First execution of backtrace() includes itself in trace #38858

vchuravy opened this issue Dec 12, 2020 · 2 comments · Fixed by #38886
Labels

Comments

@vchuravy
Copy link
Member

julia> bt1 = backtrace()
37-element Vector{Union{Ptr{Nothing}, Base.InterpreterIP}}:
 Ptr{Nothing} @0x00007fff9eb4f0cf
 Ptr{Nothing} @0x00007fff9eb4f257
 Ptr{Nothing} @0x00007fffb24aa4f7
 Ptr{Nothing} @0x00007fffb24ca8eb
 Ptr{Nothing} @0x00007fffb24ca403
 Ptr{Nothing} @0x00007fffb24caf5b
 Ptr{Nothing} @0x00007fffb24cbe5f
 Base.InterpreterIP in top-level CodeInfo for Main at statement 0
...
julia> bt2=backtrace()
36-element Vector{Union{Ptr{Nothing}, Base.InterpreterIP}}:
 Ptr{Nothing} @0x00007fff9eb4f257
 Ptr{Nothing} @0x00007fffb24aa4f7
 Ptr{Nothing} @0x00007fffb24ca8eb
 Ptr{Nothing} @0x00007fffb24ca403
 Ptr{Nothing} @0x00007fffb24caf5b
 Ptr{Nothing} @0x00007fffb24cbe5f
 Base.InterpreterIP in top-level CodeInfo for Main at statement 0
...
julia> Base.show_backtrace(stderr, bt1)

Stacktrace:
  [1] backtrace()
    @ Base ./error.jl:112
  [2] top-level scope

julia> Base.show_backtrace(stderr, bt2)

Stacktrace:
  [1] top-level scope
    @ REPL[2]:1

breaks one of the errorshow tests

@vchuravy vchuravy added the system:powerpc PowerPC label Dec 12, 2020
@vchuravy
Copy link
Member Author

Also responsible for a test-failure in logging:

Error in testset Logging:
Test Failed at /nobackup/users/vchuravy/builds/julia-nodbg/usr/share/julia/stdlib/v1.7/Logging/test/runtests.jl:198
  Expression: startswith(genmsg("msg", exception = (DivideError(), bt)), "┌ PREFIX msg\n│   exception =\n│    DivideError: integer division error\n│    Stacktrace:\n│      [1] func1()")
   Evaluated: startswith("┌ PREFIX msg\n│   exception =\n│    DivideError: integer division error\n│    Stacktrace:\n│      [1] backtrace()\n│        @ Base ./error.jl:112\n│      [2] func1()\n│        @ Main.Test12Main_Logging /nobackup/
users/vchuravy/builds/julia-nodbg/usr/share/julia/stdlib/v1.7/Logging/test/runtests.jl:7\n│      [3] macro expansion\n│        @ /nobackup/users/vchuravy/builds/julia-nodbg/usr/share/julia/stdlib/v1.7/Logging/test/runtests.jl:197 [inlined
]\n│      [4] macro expansion\n│        @ /nobackup/users/vchuravy/builds/julia-nodbg/usr/share/julia/stdlib/v1.7/Test/src/Test.jl:1147 [inlined]\n│      [5] macro expansion\n│        @ /nobackup/users/vchuravy/builds/julia-nodbg/usr/shar
e/julia/stdlib/v1.7/Logging/test/runtests.jl:20 [inlined]\n│      [6] macro expansion\n│        @ /nobackup/users/vchuravy/builds/julia-nodbg/usr/share/julia/stdlib/v1.7/Test/src/Test.jl:1147 [inlined]\n│      [7] top-level scope\n│      
  @ /nobackup/users/vchuravy/builds/julia-nodbg/usr/share/julia/stdlib/v1.7/Logging/test/runtests.jl:11\n│      [8] include\n│        @ ./Base.jl:386 [inlined]\n│      [9] macro expansion\n│        @ /nobackup/users/vchuravy/dev/julia/tes
t/testdefs.jl:24 [inlined]\n│     [10] macro expansion\n│        @ /nobackup/users/vchuravy/builds/julia-nodbg/usr/share/julia/stdlib/v1.7/Test/src/Test.jl:1147 [inlined]\n│     [11] macro expansion\n│        @ /nobackup/users/vchuravy/de
v/julia/test/testdefs.jl:23 [inlined]\n│     [12] macro expansion\n│        @ ./timing.jl:353 [inlined]\n│     [13] runtests(name::String, path::String, isolate::Bool; seed::UInt128)\n│        @ Main /nobackup/users/vchuravy/dev/julia/tes
t/testdefs.jl:21\n│     [14] #137\n│        @ /nobackup/users/vchuravy/builds/julia-nodbg/usr/share/julia/stdlib/v1.7/Distributed/src/remotecall.jl:354 [inlined]\n│     [15] run_work_thunk(thunk::Distributed.var\"#137#138\"{typeof(runtest
s), Tuple{String, String}, Base.Iterators.Pairs{Symbol, UInt128, Tuple{Symbol}, NamedTuple{(:seed,), Tuple{UInt128}}}}, print_error::Bool)\n│        @ Distributed /nobackup/users/vchuravy/builds/julia-nodbg/usr/share/julia/stdlib/v1.7/Dis
tributed/src/process_messages.jl:63\n│     [16] remotecall_fetch(::Function, ::Distributed.LocalProcess, ::String, ::Vararg{String, N} where N; kwargs::Base.Iterators.Pairs{Symbol, UInt128, Tuple{Symbol}, NamedTuple{(:seed,), Tuple{UInt12
8}}})\n│        @ Distributed /nobackup/users/vchuravy/builds/julia-nodbg/usr/share/julia/stdlib/v1.7/Distributed/src/remotecall.jl:379\n│     [17] remotecall_fetch(::Function, ::Int64, ::String, ::Vararg{String, N} where N; kwargs::Base.
Iterators.Pairs{Symbol, UInt128, Tuple{Symbol}, NamedTuple{(:seed,), Tuple{UInt128}}})\n│        @ Distributed /nobackup/users/vchuravy/builds/julia-nodbg/usr/share/julia/stdlib/v1.7/Distributed/src/remotecall.jl:421\n│     [18] macro exp
ansion\n│        @ /nobackup/users/vchuravy/dev/julia/test/runtests.jl:217 [inlined]\n│     [19] (::var\"#29#39\"{Vector{Task}, var\"#print_testworker_errored#35\"{ReentrantLock, Int64, Int64}, var\"#print_testworker_stats#33\"{ReentrantL
ock, Int64, Int64, Int64, Int64, Int64, Int64}, Vector{Any}, Dict{String, DateTime}})()\n│        @ Main ./task.jl:406\n└ SUFFIX\n", "┌ PREFIX msg\n│   exception =\n│    DivideError: integer division error\n│    Stacktrace:\n│      [1] fu
nc1()")

@vchuravy
Copy link
Member Author

Ah:

#0  jl_backtrace_from_here (returnsp=0, skip=1) at /nobackup/users/vchuravy/dev/julia/src/stackwalk.c:228
#1  0x00007fffe276eef0 in jlplt_jl_backtrace_from_here_12751 () from /nobackup/users/vchuravy/builds/julia/usr/lib/julia/sys-debug.so
#2  0x00007fffe216a8e4 in julia_backtrace_25029 () at error.jl:112
#3  0x00007fffe216ab40 in jfptr_backtrace_25030 () from /nobackup/users/vchuravy/builds/julia/usr/lib/julia/sys-debug.so

vis-a-vis:

(gdb) bt
#0  jl_backtrace_from_here (returnsp=0, skip=1) at /nobackup/users/vchuravy/dev/julia/src/stackwalk.c:228
#1  0x00007fffe216a8e4 in julia_backtrace_25029 () at error.jl:112
#2  0x00007fffe216ab40 in jfptr_backtrace_25030 () from /nobackup/users/vchuravy/builds/julia/usr/lib/julia/sys-debug.so
#3  0x00007ffff74b3d54 in _jl_invoke (F=0x7fffe3228c90 <jl_system_image_data+10058576>, args=0x7fffffff8998, nargs=0, mfunc=0x7fffe3228810 <jl_system_image_data+10057424>, world=29541) at /nobackup/users/vchuravy/dev/julia/src/gf.c:2205
#4  0x00007ffff74b4820 in jl_apply_generic (F=0x7fffe3228c90 <jl_system_image_data+10058576>, args=0x7fffffff8998, nargs=0) at /nobackup/users/vchuravy/dev/julia/src/gf.c:2406

So the first time we call backtrace, we go through the PLT and include that in the trace.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant