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

Problem using Threads.@threads on Julia 1.11.0-beta1 #2907

Open
adannenberg opened this issue May 2, 2024 · 8 comments
Open

Problem using Threads.@threads on Julia 1.11.0-beta1 #2907

adannenberg opened this issue May 2, 2024 · 8 comments
Labels
bug Something isn't working macro Julia macros: @oops

Comments

@adannenberg
Copy link

I understand that 1.11 is in beta and not everything is expected to work, including packages like Pluto that may need to be changed to work properly with 1.11 once it's production ready. I file this issue only to, perhaps, be helpful - not to complain about things not working when there's no expectation that they should. With that caveat and apology, the error message below is what's reported for a notebook that works fine when launched under 1.10.3. I didn't see a reported issue that looked similar, so I thought I should file one. I wasn't able to come up with a MWE but it may be worth mentioning that the code uses a for loop parallelized with a Threads.@threads prefix and also creates a gif using @animate. Hope this is useful.

julia> using Pluto; Pluto.run()
[ Info: Loading...
┌ Info:
└ Opening http://localhost:1234/?secret=YNxbRFls in your default browser... ~ have fun!
┌ Info:
│ Press Ctrl+C in this terminal to stop Pluto
└
┌ Error: Macro call expansion failed with a non-macroexpand error
│   exception =
│    Error deserializing data from Malt.Worker on port 9179 with PID 39179:
│
│    UndefVarError: `workspace#2` not defined in `Main`
│    Suggestion: check for spelling errors or missing imports.
│    Stacktrace:
│      [1] unwrap_worker_result(worker::Malt.Worker, result::Malt.WorkerResult)
│        @ Malt ~/.julia/packages/Malt/Z3YQq/src/Malt.jl:46
│      [2] _wait_for_response(worker::Malt.Worker, msg_id::UInt64)
│        @ Malt ~/.julia/packages/Malt/Z3YQq/src/Malt.jl:325
│      [3] _send_receive
│        @ ~/.julia/packages/Malt/Z3YQq/src/Malt.jl:336 [inlined]
│      [4] #remote_call_fetch#41
│        @ ~/.julia/packages/Malt/Z3YQq/src/Malt.jl:406 [inlined]
│      [5] remote_call_fetch
│        @ ~/.julia/packages/Malt/Z3YQq/src/Malt.jl:405 [inlined]
│      [6] remote_eval_fetch
│        @ ~/.julia/packages/Malt/Z3YQq/src/Malt.jl:484 [inlined]
│      [7] remote_eval_fetch(w::Malt.Worker, expr::Expr)
│        @ Malt ~/.julia/packages/Malt/Z3YQq/src/Malt.jl:485
│      [8] macroexpand_in_workspace(session_notebook::Tuple{Pluto.ServerSession, Pluto.Notebook}, macrocall::Expr, cell_id::Base.UUID, module_name::Symbol; capture_stdout::Bool)
│        @ Pluto.WorkspaceManager ~/.julia/packages/Pluto/0K5S5/src/evaluation/WorkspaceManager.jl:519
│      [9] macroexpand_in_workspace
│        @ ~/.julia/packages/Pluto/0K5S5/src/evaluation/WorkspaceManager.jl:515 [inlined]
│     [10] try_macroexpand (repeats 2 times)
│        @ ~/.julia/packages/Pluto/0K5S5/src/evaluation/MacroAnalysis.jl:88 [inlined]
│     [11] (::Pluto.var"#macroexpand_cell#113"{PlutoDependencyExplorer.NotebookTopology{Pluto.Cell}, Symbol, Tuple{Pluto.ServerSession, Pluto.Notebook}})(cell::Pluto.Cell)
│        @ Pluto ~/.julia/packages/Pluto/0K5S5/src/evaluation/MacroAnalysis.jl:96
│     [12] (::Pluto.var"#analyze_macrocell#115"{PlutoDependencyExplorer.NotebookTopology{Pluto.Cell}, Pluto.var"#macroexpand_cell#113"{PlutoDependencyExplorer.NotebookTopology{Pluto.Cell}, Symbol, Tuple{Pluto.ServerSession, Pluto.Notebook}}})(cell::Pluto.Cell)
│        @ Pluto ~/.julia/packages/Pluto/0K5S5/src/evaluation/MacroAnalysis.jl:113
│     [13] resolve_topology(session::Pluto.ServerSession, notebook::Pluto.Notebook, unresolved_topology::PlutoDependencyExplorer.NotebookTopology{Pluto.Cell}, old_workspace_name::Symbol; current_roots::Vector{Pluto.Cell})
│        @ Pluto ~/.julia/packages/Pluto/0K5S5/src/evaluation/MacroAnalysis.jl:141
│     [14] run_reactive_core!(session::Pluto.ServerSession, notebook::Pluto.Notebook, old_topology::PlutoDependencyExplorer.NotebookTopology{Pluto.Cell}, new_topology::PlutoDependencyExplorer.NotebookTopology{Pluto.Cell}, roots::Vector{Pluto.Cell}; save::Bool, deletion_hook::typeof(Pluto.WorkspaceManager.move_vars), user_requested_run::Bool, already_run::Vector{Pluto.Cell}, bond_value_pairs::Base.Iterators.Zip{Tuple{Vector{Symbol}, Vector{Any}}})
│        @ Pluto ~/.julia/packages/Pluto/0K5S5/src/evaluation/Run.jl:65
│     [15] (::Pluto.var"#236#242"{Bool, @Kwargs{}, Pluto.ServerSession, Pluto.Notebook})()
│        @ Pluto ~/.julia/packages/Pluto/0K5S5/src/evaluation/Run.jl:474
│     [16] withtoken(f::Pluto.var"#236#242"{Bool, @Kwargs{}, Pluto.ServerSession, Pluto.Notebook}, token::Pluto.Token)
│        @ Pluto ~/.julia/packages/Pluto/0K5S5/src/evaluation/Tokens.jl:19
│     [17] #235
│        @ ~/.julia/packages/Pluto/0K5S5/src/evaluation/Run.jl:450 [inlined]
│     [18] (::Pluto.var"#227#228"{Pluto.var"#235#241"{Bool, @Kwargs{}, Pluto.ServerSession, Pluto.Notebook}})()
│        @ Pluto ~/.julia/packages/Pluto/0K5S5/src/evaluation/Tokens.jl:58
│   cell.code = "begin\n\tdates = sort(unique(d .+ Day.(0:-1:-182)))\n\tmyDict = Dict(key => DataFrame(date=Date[],xout=Float64[],df=Float64[]) for key in dates)\n\tThreads.@threads for i in eachindex(dates)\n\t\tdt = dates[i]\n\t\ty = myFunc1(dt,dEnd)\n" ⋯ 919 bytes ⋯ "df[findall(y.date .== dt2)[1]]\n\t\t\t\ty.m3[r] = myFunc2(y, dt1, dt2)\n\t\t\tend\n\t\tend\n\t\tplot!(p1, y.date,100 .* yc.m3, color = :red, lw =2, label=\"\")\n\t\tplot(p1)\n\tend\n\tmyDict = nothing\n\tgif(anim,  \"myGif.gif\", fps = 4)\nend"
└ @ Pluto ~/.julia/packages/Pluto/0K5S5/src/evaluation/MacroAnalysis.jl:146
@Pangoraw Pangoraw added bug Something isn't working macro Julia macros: @oops labels May 3, 2024
@oxinabox
Copy link

I am seeing the same on linux

│   PLUTO_VERSION = v"0.19.42"
│   VERSION = v"1.11.0-beta1"

julia> versioninfo()
Julia Version 1.11.0-beta1
Commit 08e1fc0abb9 (2024-04-10 08:40 UTC)
Build Info:
  Official https://julialang.org/ release
Platform Info:
  OS: Linux (x86_64-linux-gnu)
  CPU: 20 × 12th Gen Intel(R) Core(TM) i7-12700H
  WORD_SIZE: 64
  LLVM: libLLVM-16.0.6 (ORCJIT, alderlake)
Threads: 1 default, 0 interactive, 1 GC (on 20 virtual cores)
Environment:
  JULIA_PKG_SERVER = 
  JULIA_PKG_USE_CLI_GIT = true

@fonsp
Copy link
Owner

fonsp commented May 23, 2024

@oxinabox What code caused the problem for you? Do you have an example that you can share?

@adannenberg
Copy link
Author

I was going to create a MWE for you, but I now find that Pluto cannot run at all with 1.11.0-beta1 (in Linux now). Here is the output from a fresh session in which I chose to "Create a New Notebook", upon which the Pluto session crashed (bar on top turned red and "Restart notebook (required)" message appears:

alex@pop-os:~$ j11
               _
   _       _ _(_)_     |  Documentation: https://docs.julialang.org
  (_)     | (_) (_)    |
   _ _   _| |_  __ _   |  Type "?" for help, "]?" for Pkg help.
  | | | | | | |/ _` |  |
  | | |_| | | | (_| |  |  Version 1.11.0-beta1 (2024-04-10)
 _/ |\__'_|_|_|\__'_|  |  Official https://julialang.org/ release
|__/                   |

julia> using Pluto; Pluto.run()
[ Info: Loading...
┌ Info: 
└ Opening http://localhost:1234/?secret=dnDWAy8D in your default browser... ~ have fun!
┌ Info: 
│ Press Ctrl+C in this terminal to stop Pluto
└ 
┌ Info: Operation failed. Updating registries and trying again...
└   exception = BoundsError: attempt to access MemoryRef{UInt8} at index [1]
┌ Warning: PlutoPkg: Failed to add/remove packages! Resetting package environment...
│   PLUTO_VERSION = v"0.19.42"
│   VERSION = v"1.11.0-beta1"
│   old_packages = String[]
│   new_packages = String[]
│   exception =
│    BoundsError: attempt to access MemoryRef{UInt8} at index [1]
│    Stacktrace:
│      [1] GenericMemoryRef
│        @ ./boot.jl:522 [inlined]
│      [2] unsafe_copyto!
│        @ ./genericmemory.jl:108 [inlined]
│      [3] copyto!
│        @ ./genericmemory.jl:143 [inlined]
│      [4] _resize!(io::IOBuffer, sz::Int64)
│        @ Base ./iobuffer.jl:309
│      [5] ensureroom
│        @ ./iobuffer.jl:391 [inlined]
│      [6] unsafe_write(to::IOBuffer, p::Ptr{UInt8}, nb::UInt64)
│        @ Base ./iobuffer.jl:508
│      [7] unsafe_write
│        @ ./io.jl:452 [inlined]
│      [8] unsafe_write
│        @ ./io.jl:803 [inlined]
│      [9] write(s::IOContext{IOBuffer}, A::Vector{UInt8})
│        @ Base ./io.jl:837
│     [10] handle_message(logger::Logging.ConsoleLogger, level::Base.CoreLogging.LogLevel, message::Any, _module::Any, group::Any, id::Any, filepath::Any, line::Any; kwargs...)
│        @ Logging ~/julia-1.11/share/julia/stdlib/v1.11/Logging/src/ConsoleLogger.jl:193
│     [11] handle_message(::LoggingExtras.TeeLogger{Tuple{Logging.ConsoleLogger, Logging.ConsoleLogger}}, ::Base.CoreLogging.LogLevel, ::Vararg{Any}; kwargs::@Kwargs{exception::BoundsError})
│        @ LoggingExtras ~/.julia/packages/LoggingExtras/VLO3o/src/CompositionalLoggers/tee.jl:24
│     [12] invokelatest(::Any, ::Any, ::Vararg{Any}; kwargs::@Kwargs{exception::BoundsError})
│        @ Base ./essentials.jl:1032
│     [13] macro expansion
│        @ ./logging.jl:376 [inlined]
│     [14] with_auto_fixes(f::Pluto.var"#133#150"{Pluto.Notebook, Pluto.IOListener}, notebook::Pluto.Notebook)
│        @ Pluto ~/.julia/packages/Pluto/GVuR6/src/packages/Packages.jl:485
│     [15] #132
│        @ ~/.julia/packages/Pluto/GVuR6/src/packages/Packages.jl:180 [inlined]
│     [16] report_business!(f::Pluto.var"#132#149"{Pluto.Notebook, Pluto.IOListener}, parent::Pluto.Status.Business, args::Symbol)
│        @ Pluto.Status ~/.julia/packages/Pluto/GVuR6/src/webserver/Status.jl:82
│     [17] (::Pluto.var"#131#148"{Pluto.Configuration.CompilerOptions, Pluto.Notebook, Nothing, Pluto.IOListener, Vector{String}, Vector{String}, Bool, Bool, Pluto.Status.Business})()
│        @ Pluto ~/.julia/packages/Pluto/GVuR6/src/packages/Packages.jl:179
│     [18] with_logstate(f::Pluto.var"#131#148"{Pluto.Configuration.CompilerOptions, Pluto.Notebook, Nothing, Pluto.IOListener, Vector{String}, Vector{String}, Bool, Bool, Pluto.Status.Business}, logstate::Base.CoreLogging.LogState)
│        @ Base.CoreLogging ./logging.jl:522
│     [19] with_logger(f::Function, logger::LoggingExtras.TeeLogger{Tuple{Logging.ConsoleLogger, Logging.ConsoleLogger}})
│        @ Base.CoreLogging ./logging.jl:632
│     [20] withlogcapture
│        @ ~/.julia/packages/Pluto/GVuR6/src/packages/Packages.jl:718
│     [21] #130
│        @ ~/.julia/packages/Pluto/GVuR6/src/packages/Packages.jl:143 [inlined]
│     [22] withtoken(f::Pluto.var"#130#147"{Pluto.Configuration.CompilerOptions, Pluto.Notebook, Nothing, Pluto.IOListener, Vector{String}, Vector{String}, Bool, Bool, Pluto.Status.Business}, token::Pluto.Token)
│        @ Pluto ~/.julia/packages/Pluto/GVuR6/src/evaluation/Tokens.jl:19
│     [23] sync_nbpkg_core(notebook::Pluto.Notebook, old_topology::PlutoDependencyExplorer.NotebookTopology{Pluto.Cell}, new_topology::PlutoDependencyExplorer.NotebookTopology{Pluto.Cell}; on_terminal_output::Pluto.var"#iocallback#168"{Pluto.ServerSession, Pluto.Notebook}, cleanup::Base.RefValue{Function}, lag::Float64, compiler_options::Pluto.Configuration.CompilerOptions)
│        @ Pluto ~/.julia/packages/Pluto/GVuR6/src/packages/Packages.jl:142
│     [24] (::Pluto.var"#165#167"{Pluto.ServerSession, Pluto.Notebook, PlutoDependencyExplorer.NotebookTopology{Pluto.Cell}, PlutoDependencyExplorer.NotebookTopology{Pluto.Cell}, Base.RefValue{Function}})()
│        @ Pluto ~/.julia/packages/Pluto/GVuR6/src/packages/Packages.jl:342
│     [25] sync_nbpkg(session::Pluto.ServerSession, notebook::Pluto.Notebook, old_topology::PlutoDependencyExplorer.NotebookTopology{Pluto.Cell}, new_topology::PlutoDependencyExplorer.NotebookTopology{Pluto.Cell}; save::Bool, take_token::Bool)
│        @ Pluto ~/.julia/packages/Pluto/GVuR6/src/packages/Packages.jl:328
│     [26] (::Pluto.var"#236#242"{Bool, @Kwargs{}, Pluto.ServerSession, Pluto.Notebook})()
│        @ Pluto ~/.julia/packages/Pluto/GVuR6/src/evaluation/Run.jl:466
│     [27] withtoken(f::Pluto.var"#236#242"{Bool, @Kwargs{}, Pluto.ServerSession, Pluto.Notebook}, token::Pluto.Token)
│        @ Pluto ~/.julia/packages/Pluto/GVuR6/src/evaluation/Tokens.jl:19
│     [28] #235
│        @ ~/.julia/packages/Pluto/GVuR6/src/evaluation/Run.jl:450 [inlined]
│     [29] (::Pluto.var"#227#228"{Pluto.var"#235#241"{Bool, @Kwargs{}, Pluto.ServerSession, Pluto.Notebook}})()
│        @ Pluto ~/.julia/packages/Pluto/GVuR6/src/evaluation/Tokens.jl:58
└ @ Pluto ~/.julia/packages/Pluto/GVuR6/src/packages/Packages.jl:377
BoundsError: attempt to access MemoryRef{UInt8} at index [1]
Stacktrace:
  [1] GenericMemoryRef
    @ ./boot.jl:522 [inlined]
  [2] unsafe_copyto!
    @ ./genericmemory.jl:108 [inlined]
  [3] copyto!
    @ ./genericmemory.jl:143 [inlined]
  [4] _resize!(io::IOBuffer, sz::Int64)
    @ Base ./iobuffer.jl:309
  [5] ensureroom
    @ ./iobuffer.jl:391 [inlined]
  [6] unsafe_write(to::IOBuffer, p::Ptr{UInt8}, nb::UInt64)
    @ Base ./iobuffer.jl:508
  [7] unsafe_write
    @ ./io.jl:452 [inlined]
  [8] unsafe_write
    @ ./io.jl:803 [inlined]
  [9] write(s::IOContext{IOBuffer}, A::Vector{UInt8})
    @ Base ./io.jl:837
 [10] handle_message(logger::Logging.ConsoleLogger, level::Base.CoreLogging.LogLevel, message::Any, _module::Any, group::Any, id::Any, filepath::Any, line::Any; kwargs...)
    @ Logging ~/julia-1.11/share/julia/stdlib/v1.11/Logging/src/ConsoleLogger.jl:193
 [11] handle_message(::LoggingExtras.TeeLogger{Tuple{Logging.ConsoleLogger, Logging.ConsoleLogger}}, ::Base.CoreLogging.LogLevel, ::Vararg{Any}; kwargs::@Kwargs{exception::BoundsError})
    @ LoggingExtras ~/.julia/packages/LoggingExtras/VLO3o/src/CompositionalLoggers/tee.jl:24
 [12] invokelatest(::Any, ::Any, ::Vararg{Any}; kwargs::@Kwargs{exception::BoundsError})
    @ Base ./essentials.jl:1032
 [13] macro expansion
    @ ./logging.jl:376 [inlined]
 [14] with_auto_fixes(f::Pluto.var"#133#150"{Pluto.Notebook, Pluto.IOListener}, notebook::Pluto.Notebook)
    @ Pluto ~/.julia/packages/Pluto/GVuR6/src/packages/Packages.jl:485
 [15] #132
    @ ~/.julia/packages/Pluto/GVuR6/src/packages/Packages.jl:180 [inlined]
 [16] report_business!(f::Pluto.var"#132#149"{Pluto.Notebook, Pluto.IOListener}, parent::Pluto.Status.Business, args::Symbol)
    @ Pluto.Status ~/.julia/packages/Pluto/GVuR6/src/webserver/Status.jl:82
 [17] (::Pluto.var"#131#148"{Pluto.Configuration.CompilerOptions, Pluto.Notebook, Nothing, Pluto.IOListener, Vector{String}, Vector{String}, Bool, Bool, Pluto.Status.Business})()
    @ Pluto ~/.julia/packages/Pluto/GVuR6/src/packages/Packages.jl:179
 [18] with_logstate(f::Pluto.var"#131#148"{Pluto.Configuration.CompilerOptions, Pluto.Notebook, Nothing, Pluto.IOListener, Vector{String}, Vector{String}, Bool, Bool, Pluto.Status.Business}, logstate::Base.CoreLogging.LogState)
    @ Base.CoreLogging ./logging.jl:522
 [19] with_logger(f::Function, logger::LoggingExtras.TeeLogger{Tuple{Logging.ConsoleLogger, Logging.ConsoleLogger}})
    @ Base.CoreLogging ./logging.jl:632
 [20] withlogcapture
    @ ~/.julia/packages/Pluto/GVuR6/src/packages/Packages.jl:718
 [21] #130
    @ ~/.julia/packages/Pluto/GVuR6/src/packages/Packages.jl:143 [inlined]
 [22] withtoken(f::Pluto.var"#130#147"{Pluto.Configuration.CompilerOptions, Pluto.Notebook, Nothing, Pluto.IOListener, Vector{String}, Vector{String}, Bool, Bool, Pluto.Status.Business}, token::Pluto.Token)
    @ Pluto ~/.julia/packages/Pluto/GVuR6/src/evaluation/Tokens.jl:19
 [23] sync_nbpkg_core(notebook::Pluto.Notebook, old_topology::PlutoDependencyExplorer.NotebookTopology{Pluto.Cell}, new_topology::PlutoDependencyExplorer.NotebookTopology{Pluto.Cell}; on_terminal_output::Pluto.var"#iocallback#168"{Pluto.ServerSession, Pluto.Notebook}, cleanup::Base.RefValue{Function}, lag::Float64, compiler_options::Pluto.Configuration.CompilerOptions)
    @ Pluto ~/.julia/packages/Pluto/GVuR6/src/packages/Packages.jl:142
 [24] (::Pluto.var"#165#167"{Pluto.ServerSession, Pluto.Notebook, PlutoDependencyExplorer.NotebookTopology{Pluto.Cell}, PlutoDependencyExplorer.NotebookTopology{Pluto.Cell}, Base.RefValue{Function}})()
    @ Pluto ~/.julia/packages/Pluto/GVuR6/src/packages/Packages.jl:342
 [25] sync_nbpkg(session::Pluto.ServerSession, notebook::Pluto.Notebook, old_topology::PlutoDependencyExplorer.NotebookTopology{Pluto.Cell}, new_topology::PlutoDependencyExplorer.NotebookTopology{Pluto.Cell}; save::Bool, take_token::Bool)
    @ Pluto ~/.julia/packages/Pluto/GVuR6/src/packages/Packages.jl:328
 [26] (::Pluto.var"#236#242"{Bool, @Kwargs{}, Pluto.ServerSession, Pluto.Notebook})()
    @ Pluto ~/.julia/packages/Pluto/GVuR6/src/evaluation/Run.jl:466
 [27] withtoken(f::Pluto.var"#236#242"{Bool, @Kwargs{}, Pluto.ServerSession, Pluto.Notebook}, token::Pluto.Token)
    @ Pluto ~/.julia/packages/Pluto/GVuR6/src/evaluation/Tokens.jl:19
 [28] #235
    @ ~/.julia/packages/Pluto/GVuR6/src/evaluation/Run.jl:450 [inlined]
 [29] (::Pluto.var"#227#228"{Pluto.var"#235#241"{Bool, @Kwargs{}, Pluto.ServerSession, Pluto.Notebook}})()
    @ Pluto ~/.julia/packages/Pluto/GVuR6/src/evaluation/Tokens.jl:58┌ Info: Backup saved to
└   backup_path = "/home/alex/.julia/pluto_notebooks/Small notes backup 1.jl"

@fonsp
Copy link
Owner

fonsp commented May 24, 2024

@adannenberg Could you upgrade to Pluto#main and try again? This was fixed in #2910

@fonsp fonsp changed the title problem running Pluto with Julia 1.11.0-beta1 on macbook Problem using Threads.@threads on Julia 1.11.0-beta1 May 24, 2024
@adannenberg
Copy link
Author

adannenberg commented May 24, 2024 via email

@adannenberg
Copy link
Author

mwe.zip

Here's a zipped version of a simple notebook called mwe.jl that generates the REPL output below in Julia 1.11.0-beta1. The notebook runs without problem under Julia 1.10.3

I'm using a temp environment to which I've added only Pluto#main

(jl_JKHINI) pkg> st
Status `/tmp/jl_JKHINI/Project.toml`
  [c3e4b0f8] Pluto v0.19.42 `https://github.com/fonsp/Pluto.jl.git#main`

(jl_JKHINI) pkg> 

My environment is

julia> versioninfo()
Julia Version 1.11.0-beta1
Commit 08e1fc0abb9 (2024-04-10 08:40 UTC)
Build Info:
  Official https://julialang.org/ release
Platform Info:
  OS: Linux (x86_64-linux-gnu)
  CPU: 16 × Intel(R) Core(TM) i9-9900 CPU @ 3.10GHz
  WORD_SIZE: 64
  LLVM: libLLVM-16.0.6 (ORCJIT, skylake)
Threads: 16 default, 0 interactive, 8 GC (on 16 virtual cores)
Environment:
  JULIA_NUM_THREADS = auto

The output to the REPL from running mwe.jl is:

julia> using Pluto; Pluto.run()
[ Info: Loading...
┌ Info: 
└ Opening http://localhost:1234/?secret=MjBPWWeh in your default browser... ~ have fun!
┌ Info: 
│ Press Ctrl+C in this terminal to stop Pluto
└ 
[ Info: It looks like you are developing the Pluto package, using the unbundled frontend...
┌ Error: Macro call expansion failed with a non-macroexpand error
│   exception =
│    Error deserializing data from Malt.Worker on port 9688 with PID 40688:
│    
│    UndefVarError: `workspace#2` not defined in `Main`
│    Suggestion: check for spelling errors or missing imports.
│    Stacktrace:
│      [1] unwrap_worker_result
│        @ ~/.julia/packages/Malt/Z3YQq/src/Malt.jl:46
│      [2] _wait_for_response
│        @ ~/.julia/packages/Malt/Z3YQq/src/Malt.jl:325
│      [3] _send_receive
│        @ ~/.julia/packages/Malt/Z3YQq/src/Malt.jl:336 [inlined]
│      [4] #remote_call_fetch#41
│        @ ~/.julia/packages/Malt/Z3YQq/src/Malt.jl:406 [inlined]
│      [5] remote_call_fetch
│        @ ~/.julia/packages/Malt/Z3YQq/src/Malt.jl:405 [inlined]
│      [6] remote_eval_fetch
│        @ ~/.julia/packages/Malt/Z3YQq/src/Malt.jl:484 [inlined]
│      [7] remote_eval_fetch(w::Malt.Worker, expr::Expr)
│        @ Malt ~/.julia/packages/Malt/Z3YQq/src/Malt.jl:485
│      [8] macroexpand_in_workspace(session_notebook::Tuple{Pluto.ServerSession, Pluto.Notebook}, macrocall::Expr, cell_id::Base.UUID, module_name::Symbol; capture_stdout::Bool)
│        @ Pluto.WorkspaceManager ~/.julia/packages/Pluto/WG3EQ/src/evaluation/WorkspaceManager.jl:519
│      [9] macroexpand_in_workspace
│        @ ~/.julia/packages/Pluto/WG3EQ/src/evaluation/WorkspaceManager.jl:515 [inlined]
│     [10] try_macroexpand (repeats 2 times)
│        @ ~/.julia/packages/Pluto/WG3EQ/src/evaluation/MacroAnalysis.jl:88 [inlined]
│     [11] (::Pluto.var"#macroexpand_cell#113"{PlutoDependencyExplorer.NotebookTopology{Pluto.Cell}, Symbol, Tuple{Pluto.ServerSession, Pluto.Notebook}})(cell::Pluto.Cell)
│        @ Pluto ~/.julia/packages/Pluto/WG3EQ/src/evaluation/MacroAnalysis.jl:96
│     [12] (::Pluto.var"#analyze_macrocell#115"{PlutoDependencyExplorer.NotebookTopology{Pluto.Cell}, Pluto.var"#macroexpand_cell#113"{PlutoDependencyExplorer.NotebookTopology{Pluto.Cell}, Symbol, Tuple{Pluto.ServerSession, Pluto.Notebook}}})(cell::Pluto.Cell)
│        @ Pluto ~/.julia/packages/Pluto/WG3EQ/src/evaluation/MacroAnalysis.jl:113
│     [13] resolve_topology(session::Pluto.ServerSession, notebook::Pluto.Notebook, unresolved_topology::PlutoDependencyExplorer.NotebookTopology{Pluto.Cell}, old_workspace_name::Symbol; current_roots::Vector{Pluto.Cell})
│        @ Pluto ~/.julia/packages/Pluto/WG3EQ/src/evaluation/MacroAnalysis.jl:141
│     [14] run_reactive_core!(session::Pluto.ServerSession, notebook::Pluto.Notebook, old_topology::PlutoDependencyExplorer.NotebookTopology{Pluto.Cell}, new_topology::PlutoDependencyExplorer.NotebookTopology{Pluto.Cell}, roots::Vector{Pluto.Cell}; save::Bool, deletion_hook::typeof(Pluto.WorkspaceManager.move_vars), user_requested_run::Bool, already_run::Vector{Pluto.Cell}, bond_value_pairs::Base.Iterators.Zip{Tuple{Vector{Symbol}, Vector{Any}}})
│        @ Pluto ~/.julia/packages/Pluto/WG3EQ/src/evaluation/Run.jl:65
│     [15] (::Pluto.var"#241#247"{Bool, @Kwargs{}, Pluto.ServerSession, Pluto.Notebook})()
│        @ Pluto ~/.julia/packages/Pluto/WG3EQ/src/evaluation/Run.jl:474
│     [16] withtoken(f::Pluto.var"#241#247"{Bool, @Kwargs{}, Pluto.ServerSession, Pluto.Notebook}, token::Pluto.Token)
│        @ Pluto ~/.julia/packages/Pluto/WG3EQ/src/evaluation/Tokens.jl:19
│     [17] #240
│        @ ~/.julia/packages/Pluto/WG3EQ/src/evaluation/Run.jl:450 [inlined]
│     [18] (::Pluto.var"#232#233"{Pluto.var"#240#246"{Bool, @Kwargs{}, Pluto.ServerSession, Pluto.Notebook}})()
│        @ Pluto ~/.julia/packages/Pluto/WG3EQ/src/evaluation/Tokens.jl:58
│   cell.code = "@gif for i in 1:50\n\tplot(sin, 0, i * 2pi / 10, label=\"\")\nend\n"
└ @ Pluto ~/.julia/packages/Pluto/WG3EQ/src/evaluation/MacroAnalysis.jl:146

@adannenberg
Copy link
Author

i closed the issue by mistake. reopening...

@adannenberg
Copy link
Author

By the way, the name of this issue now seems to be wrong: The examples in https://docs.julialang.org/en/v1/manual/multi-threading/ all work using Julia 1.11.0-beta and Pluto#main.

The issue seems to be with the plotting macros like @gif and @Animate

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working macro Julia macros: @oops
Projects
None yet
Development

No branches or pull requests

4 participants