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

add pretty_stackcall(::Base.StackFrame, ::Module and ::Method) for Julia 1.10 #2560

Merged
merged 4 commits into from
May 15, 2023

Conversation

pankgeorg
Copy link
Collaborator

Patch #2554

tested on

Version 1.10.0-DEV.1293 (2023-05-14)
Commit 344f1f5a9cd (0 days old master)

Would be nice to understand what changed in julia before merging

@github-actions
Copy link
Contributor

Try this Pull Request!

Open Julia and type:

julia> import Pkg
julia> Pkg.activate(temp=true)
julia> Pkg.add(url="https://github.com/fonsp/Pluto.jl", rev="pg/patch-1.10")
julia> using Pluto

@pankgeorg pankgeorg changed the title add pretty_stackcall(::Base.StackFrame, ::Module) add pretty_stackcall(::Base.StackFrame, ::Module) for Julia 1.10 May 15, 2023
@Pangoraw
Copy link
Collaborator

The corresponding Julia change is JuliaLang/julia#41099.

JuliaLang/julia@2cd0149#diff-cf1a3652a2d8ed35925fb266a1c1d0018d5c393819bb67784e7a5f005e54ce65R55-R57

It seems, we also need to add pretty_stackcall(::Base.StackFrame, ::Method).

src/runner/PlutoRunner.jl Outdated Show resolved Hide resolved
@pankgeorg pankgeorg changed the title add pretty_stackcall(::Base.StackFrame, ::Module) for Julia 1.10 add pretty_stackcall(::Base.StackFrame, ::Module and ::Method) for Julia 1.10 May 15, 2023
src/runner/PlutoRunner.jl Outdated Show resolved Hide resolved
@Pangoraw Pangoraw linked an issue May 15, 2023 that may be closed by this pull request
@fonsp
Copy link
Owner

fonsp commented May 15, 2023

I'm surprised that this wasn't caught by our tests and nanosoldier, because we test stack traces... Is there something specific about the Main.foo example?

@fonsp
Copy link
Owner

fonsp commented May 15, 2023

And thanks Panagiotis!!

@pankgeorg pankgeorg merged commit 8edd75b into main May 15, 2023
@pankgeorg pankgeorg deleted the pg/patch-1.10 branch May 15, 2023 19:07
@fonsp
Copy link
Owner

fonsp commented May 15, 2023

@pankgeorg can you run the tests before this PR on Julia 1.10? (and play some guitar because it takes 30 minutes)

@pankgeorg
Copy link
Collaborator Author

can you run the tests before this PR on Julia 1.10? (and play some guitar because it takes 30 minutes)

yes, doing

I'm surprised that this wasn't caught by our tests and nanosoldier, because we test stack traces... Is there something specific about the Main.foo example?

Well, does anything run Julia 1.10? It's only on nightly build, not yet available in our CI or juliaup.

@pankgeorg
Copy link
Collaborator Author

Tests break on 1.10:

image

I think the perpetrator is indeed this, but to make sure, I'll rerun on main
image
image

@pankgeorg
Copy link
Collaborator Author

It seems that tests still fail on Julia 1.10:

image

The ForwardCompat test needs some extra patching in Pluto 0.14

ForwardCompat
      From worker 14:           Info Packages marked with ⌃ and ⌅ have new versions available, but those with ⌅ are restricted by compatibility constraints from upgrading. To see why use `status --outdated -m`
      From worker 14:   ┌ Error: Unkown error during eval_format_fetch_in_workspace
      From worker 14:   │   ex =
      From worker 14:   │    MethodError: no method matching pretty_stackcall(::Base.StackTraces.StackFrame, ::Module)
      From worker 14:   │
      From worker 14:   │    Closest candidates are:
      From worker 14:   │      pretty_stackcall(::Base.StackTraces.StackFrame, ::Nothing)
      From worker 14:   │       @ Pluto ~/.julia/packages/Pluto/D9HrI/src/runner/PlutoRunner.jl:563
      From worker 14:   │      pretty_stackcall(::Base.StackTraces.StackFrame, ::Core.CodeInfo)
      From worker 14:   │       @ Pluto ~/.julia/packages/Pluto/D9HrI/src/runner/PlutoRunner.jl:575
      From worker 14:   │      pretty_stackcall(::Base.StackTraces.StackFrame, ::Core.MethodInstance)
      From worker 14:   │       @ Pluto ~/.julia/packages/Pluto/D9HrI/src/runner/PlutoRunner.jl:579
      From worker 14:   │
      From worker 14:   │    Stacktrace:
      From worker 14:   │      [1] (::Pluto.PlutoRunner.var"#23#27")(s::Base.StackTraces.StackFrame)
      From worker 14:   │        @ Pluto.PlutoRunner ~/.julia/packages/Pluto/D9HrI/src/runner/PlutoRunner.jl:551
      From worker 14:   │      [2] iterate(g::Base.Generator, s::Vararg{Any})
      From worker 14:   │        @ Base ./generator.jl:47 [inlined]
      From worker 14:   │      [3] _collect(c::Vector{Base.StackTraces.StackFrame}, itr::Base.Generator{Vector{Base.StackTraces.StackFrame}, Pluto.PlutoRunner.var"#23#27"}, ::Base.EltypeUnknown, isz::Base.HasShape{1})
      From worker 14:   │        @ Base ./array.jl:847
      From worker 14:   │      [4] collect_similar(cont::Vector{Base.StackTraces.StackFrame}, itr::Base.Generator{Vector{Base.StackTraces.StackFrame}, Pluto.PlutoRunner.var"#23#27"})
      From worker 14:   │        @ Base ./array.jl:756
      From worker 14:   │      [5] map(f::Function, A::Vector{Base.StackTraces.StackFrame})
      From worker 14:   │        @ Base ./abstractarray.jl:3267
      From worker 14:   │      [6] format_output(val::CapturedException; context::IOContext{Base.DevNull})
      From worker 14:   │        @ Pluto.PlutoRunner ~/.julia/packages/Pluto/D9HrI/src/runner/PlutoRunner.jl:550
      From worker 14:   │      [7] format_output
      From worker 14:   │        @ Pluto.PlutoRunner ~/.julia/packages/Pluto/D9HrI/src/runner/PlutoRunner.jl:535 [inlined]
      From worker 14:   │      [8] formatted_result_of(cell_id::Base.UUID, ends_with_semicolon::Bool, showmore::Nothing, workspace::Module)
      From worker 14:   │        @ Pluto.PlutoRunner ~/.julia/packages/Pluto/D9HrI/src/runner/PlutoRunner.jl:447
      From worker 14:   │      [9] top-level scope
      From worker 14:   │        @ none:1
      From worker 14:   │     [10] eval(m::Module, e::Any)
      From worker 14:   │        @ Core ./boot.jl:383
      From worker 14:   │     [11] invokelatest(f::Any, args::Vararg{Any}; kwargs::Base.Pairs{Symbol, V, Tuple{Vararg{Symbol, N}}, NamedTuple{names, T}} where {V, N, names, T<:Tuple{Vararg{Any, N}}})
      From worker 14:   │        @ Base ./essentials.jl:863 [inlined]
      From worker 14:   │     [12] invokelatest(f::Any, args::Vararg{Any})
      From worker 14:   │        @ Base ./essentials.jl:860 [inlined]
      From worker 14:   │     [13] (::Distributed.var"#153#154")()
      From worker 14:   │        @ Distributed ~/julia-344f1f5a9c/share/julia/stdlib/v1.10/Distributed/src/remotecall.jl:425 [inlined]
      From worker 14:   │     [14] run_work_thunk(thunk::Distributed.var"#153#154"{typeof(Core.eval), Tuple{Module, Expr}, Base.Pairs{Symbol, Union{}, Tuple{}, @NamedTuple{}}}, print_error::Bool)
      From worker 14:   │        @ Distributed ~/julia-344f1f5a9c/share/julia/stdlib/v1.10/Distributed/src/process_messages.jl:70
      From worker 14:   │     [15] remotecall_fetch(::typeof(Core.eval), ::Distributed.LocalProcess, ::Module, ::Expr; kwargs::Base.Pairs{Symbol, Union{}, Tuple{}, @NamedTuple{}})
      From worker 14:   │        @ Distributed ~/julia-344f1f5a9c/share/julia/stdlib/v1.10/Distributed/src/remotecall.jl:450 [inlined]
      From worker 14:   │     [16] remotecall_fetch
      From worker 14:   │        @ Distributed ~/julia-344f1f5a9c/share/julia/stdlib/v1.10/Distributed/src/remotecall.jl:449 [inlined]
      From worker 14:   │     [17] remotecall_fetch(::typeof(Core.eval), ::Int64, ::Module, ::Expr; kwargs::Base.Pairs{Symbol, Union{}, Tuple{}, @NamedTuple{}})
      From worker 14:   │        @ Distributed ~/julia-344f1f5a9c/share/julia/stdlib/v1.10/Distributed/src/remotecall.jl:492 [inlined]
      From worker 14:   │     [18] remotecall_fetch
      From worker 14:   │        @ Distributed ~/julia-344f1f5a9c/share/julia/stdlib/v1.10/Distributed/src/remotecall.jl:492 [inlined]
      From worker 14:   │     [19] remotecall_eval(m::Module, pid::Int64, ex::Expr)
      From worker 14:   │        @ Distributed ~/julia-344f1f5a9c/share/julia/stdlib/v1.10/Distributed/src/macros.jl:242 [inlined]
      From worker 14:   │     [20] (::Pluto.WorkspaceManager.var"#16#17"{Base.UUID, Bool, Nothing, Pluto.WorkspaceManager.Workspace})()
      From worker 14:   │        @ Pluto.WorkspaceManager ~/.julia/packages/Pluto/D9HrI/src/evaluation/WorkspaceManager.jl:237
      From worker 14:   │     [21] withtoken(f::Pluto.WorkspaceManager.var"#16#17"{Base.UUID, Bool, Nothing, Pluto.WorkspaceManager.Workspace}, token::Pluto.Token)
      From worker 14:   │        @ Pluto ~/.julia/packages/Pluto/D9HrI/src/evaluation/Tokens.jl:19
      From worker 14:   │     [22] format_fetch_in_workspace(session_notebook::Pluto.WorkspaceManager.Workspace, cell_id::Base.UUID, ends_with_semicolon::Bool, showmore_id::Nothing)
      From worker 14:   │        @ Pluto.WorkspaceManager ~/.julia/packages/Pluto/D9HrI/src/evaluation/WorkspaceManager.jl:235
      From worker 14:   │     [23] format_fetch_in_workspace(session_notebook::Union{Tuple{Pluto.ServerSession, Pluto.Notebook}, Pluto.WorkspaceManager.Workspace}, cell_id::Any, ends_with_semicolon::Any, showmore_id::Union{Nothing, Tuple{UInt64, Int64}})
      From worker 14:   │        @ Pluto.WorkspaceManager ~/.julia/packages/Pluto/D9HrI/src/evaluation/WorkspaceManager.jl:232 [inlined]
      From worker 14:   │     [24] eval_format_fetch_in_workspace(session_notebook::Tuple{Pluto.ServerSession, Pluto.Notebook}, expr::Expr, cell_id::Base.UUID, ends_with_semicolon::Bool, function_wrapped_info::Nothing)
      From worker 14:   │        @ Pluto.WorkspaceManager ~/.julia/packages/Pluto/D9HrI/src/evaluation/WorkspaceManager.jl:218
      From worker 14:   │     [25] run_single!(session_notebook::Tuple{Pluto.ServerSession, Pluto.Notebook}, cell::Pluto.Cell, reactive_node::Pluto.ReactiveNode, expr_cache::Pluto.ExprAnalysisCache; persist_js_state::Bool)
      From worker 14:   │        @ Pluto ~/.julia/packages/Pluto/D9HrI/src/evaluation/Run.jl:140
      From worker 14:   │     [26] run_reactive!(session::Pluto.ServerSession, notebook::Pluto.Notebook, old_topology::Pluto.NotebookTopology, new_topology::Pluto.NotebookTopology, roots::Vector{Pluto.Cell}; deletion_hook::typeof(Pluto.WorkspaceManager.delete_vars), persist_js_state::Bool)
      From worker 14:   │        @ Pluto ~/.julia/packages/Pluto/D9HrI/src/evaluation/Run.jl:93
      From worker 14:   │     [27] run_reactive!(session::Pluto.ServerSession, notebook::Pluto.Notebook, old_topology::Pluto.NotebookTopology, new_topology::Pluto.NotebookTopology, roots::Vector{Pluto.Cell})
      From worker 14:   │        @ Pluto ~/.julia/packages/Pluto/D9HrI/src/evaluation/Run.jl:8 [inlined]
      From worker 14:   │     [28] (::Pluto.var"#97#98"{Base.Pairs{Symbol, Union{}, Tuple{}, @NamedTuple{}}, Pluto.ServerSession, Pluto.Notebook, Pluto.NotebookTopology, Pluto.NotebookTopology, Vector{Pluto.Cell}})()
      From worker 14:   │        @ Pluto ~/.julia/packages/Pluto/D9HrI/src/evaluation/Run.jl:115
      From worker 14:   └ @ Pluto.WorkspaceManager ~/.julia/packages/Pluto/D9HrI/src/evaluation/WorkspaceManager.jl:174
File format -- Forwards compat: Test Failed at /home/pgeorgakopoulos/pluto/Pluto.jl/test/packages/Basic.jl:482
  Expression: Distributed.remotecall_eval(Main, p, quote
        (nb.cells[2]).errored == false
    end)

@goedman
Copy link

goedman commented May 17, 2023

It's working fine now on the latest update of Pluto(v0.16.26)!

Main.foo was just a good, short example. I ran into it in many other programming errors.

Thanks a lot!!!!!

@Pangoraw Pangoraw mentioned this pull request Aug 9, 2023
@fonsp fonsp added the error display How errors and stack traces are presented label Oct 3, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
error display How errors and stack traces are presented
Projects
None yet
Development

Successfully merging this pull request may close these issues.

MethodError: no method matching pretty_stackcall
4 participants