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

Base.active_module() design is very badly broken on master #54888

Open
vtjnash opened this issue Jun 22, 2024 · 0 comments
Open

Base.active_module() design is very badly broken on master #54888

vtjnash opened this issue Jun 22, 2024 · 0 comments
Milestone

Comments

@vtjnash
Copy link
Sponsor Member

vtjnash commented Jun 22, 2024

In addition to existing milestone-blocking issues with Base.active_module function being broken and thread-unsafe, it can also outright crash the session if it gets into a slightly bad state:

[ Info: Precompiling REPLExt [e5eb5ef1-03cf-53a7-ae1d-5a66b08e832b] 
ERROR: TypeError: 
Stacktrace:
  [1] active_module()
    @ REPL ~/julia/usr/share/julia/stdlib/v1.12/REPL/src/REPL.jl:630
  [2] #invokelatest#2
    @ ./essentials.jl:1045 [inlined]
  [3] invokelatest
    @ ./essentials.jl:1042 [inlined]
  [4] active_module
    @ ./show.jl:519 [inlined]
  [5] 
SYSTEM (REPL): showing an error caused an error
ERROR: TypeError: 
Stacktrace:
  [1] active_module()
    @ REPL ~/julia/usr/share/julia/stdlib/v1.12/REPL/src/REPL.jl:630
  [2] #invokelatest#2
    @ ./essentials.jl:1045 [inlined]
  [3] invokelatest
    @ ./essentials.jl:1042 [inlined]
  [4] active_module
    @ ./show.jl:519 [inlined]
  [5] 
SYSTEM (REPL): caught exception of type TypeError while trying to handle a nested exception; giving up

julia> Base.active_module()

SYSTEM: caught exception of type :TypeError while trying to print a failed Task notice; giving up
ERROR: TaskFailedException
Stacktrace:
  [1] fatal: error thrown and no exception handler available.
TypeError(func=:typeassert, context="", expected=REPL.AbstractREPL, got=REPL.LineEditREPL(t=REPL.Terminals.TTYTerminal(term_type="xterm-256color", in_stream=Base.TTY(handle=0x000000012ef05da0, status=3, buffer=Base.GenericIOBuffer{Memory{UInt8}}(data=Memory{UInt8}(65536, 0x120600048)[0x28, 0x5b, 0x41, 0x00, 0x00, 0x00, 0x00, 0x00, 0x88, 0x55, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xc8, 0x55, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x23, 0x56, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x28, 0x56, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x83, 0x56, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xd0, 0x56, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x48, 0x57, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xd8, 0x57, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x48, 0x58, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xb8, 0x58, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x13, 0x59, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x60, 0x59, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xd8, 0x59, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x78, 0x5a, 0x00, 0x00, 0x00, 0x00, 0x00
# this keeps printing until the terminal crashes
@vtjnash vtjnash added this to the 1.12 milestone Jun 22, 2024
vtjnash added a commit that referenced this issue Jun 24, 2024
This fixes a couple unconventional issues people encountered and were
able to report as bugs against #54739

Note that due to several bugs in REPLExt itself
(#54889,
#54888), loading the extension
may still crash julia in some circumstances, but that is now a Pkg bug,
and no longer the fault of the loading code.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant