Julia code crash in VSCode extension

Greetings,

I am quite new to Julia and VSCode (I come from a mostly C/C++ background), so apologies if the issue isn’t perfectly described.

Using Julia 1.10.5 and the latest version of the VSCode extension, I encountered a consistent crash in the VSCode extension while debugging (with @enter, the debugger is way too slow). The crash also kills the REPL and (rather frustratingly) wipes the output. I tried connecting to an external REPL to capture the output, after looking up this issue (https://stackoverflow.com/questions/73091315/my-julia-script-crashes-in-vs-code-when-i-do-some-computations-how-can-i-learn), and reading the instructions to connect to an external REPL (https://www.julia-vscode.org/docs/stable/faq/#The-integrated-REPL-closes-when-the-Julia-process-crashes.-How-do-I-get-more-information-on-what%27s-going-on?). I haven’t tried using tmux.

In any case, I was not able to capture the output from an external REPL, I don’t think the connection worked (and get no feedback from VSCode when I open an external Julia REPL), and VSCode’s @enter is not recognized when I run the code in an external terminal so I assume I did something wrong.

I was, however, able to capture a partial stacktrace through some lucky copying in the split second before the terminal goes kaputt.


Error: Some Julia code in the VS Code extension crashed

└ @ VSCodeServer ~/.vscode/extensions/julialang.language-julia-1.123.2/scripts/error_handler.jl:15

ERROR: UndefVarError: `uuid4` not defined

Stacktrace:

[1] stack_trace_request(debug_session::VSCodeServer.DebugAdapter.DebugSession, params::VSCodeServer.DebugAdapter.StackTraceArguments)

@ VSCodeServer.DebugAdapter ~/.vscode/extensions/julialang.language-julia-1.123.2/scripts/packages/DebugAdapter/src/debugger_requests.jl:400

[2] (::VSCodeServer.DebugAdapter.var"#110#139"{VSCodeServer.DebugAdapter.DebugSession})(params::VSCodeServer.DebugAdapter.StackTraceArguments)

@ VSCodeServer.DebugAdapter ~/.vscode/extensions/julialang.language-julia-1.123.2/scripts/packages/DebugAdapter/src/packagedef.jl:73

[3] dispatch_msg(x::VSCodeServer.DebugAdapter.DAPRPC.DAPEndpoint{Base.PipeEndpoint, Base.PipeEndpoint}, dispatcher::VSCodeServer.DebugAdapter.DAPRPC.MsgDispatcher, msg::Dict{String, Any})

@ VSCodeServer.DebugAdapter.DAPRPC ~/.vscode/extensions/julialang.language-julia-1.123.2/scripts/packages/DebugAdapter/src/DAPRPC/typed.jl:89

[4] (::VSCodeServer.DebugAdapter.var"#132#161"{Dict{String, Any}, var"#3#6"{String}, VSCodeServer.DebugAdapter.DAPRPC.MsgDispatcher, VSCodeServer.Debu

I also get these messages in the Window output (no other output appears to have any relevancy, apart from a top-level Main message indicating an extension exiting) :


2024-09-25 14:15:35.541 [info] Started local extension host with pid 2649.

2024-09-25 14:15:37.460 [info] Started local extension host with pid 2658.

2024-09-25 14:15:38.105 **[error]** [Extension Host] (node:2658) DeprecationWarning: uuidv4() is deprecated. Use v4() from the uuid module instead.

(Use `Code Helper (Plugin) --trace-deprecation ...` to show where the warning was created)

2024-09-25 14:15:40.065 [info] [perf] Render performance baseline is 14ms

2024-09-25 14:18:03.797 **[error]** InstantiationService has been disposed: **Error**: InstantiationService has been disposed

*at g.m (vscode-file://vscode-app/Applications/Visual%20Studio%20Code.app/Contents/Resources/app/out/vs/workbench/workbench.desktop.main.js:655:386)*

*at g.createInstance (vscode-file://vscode-app/Applications/Visual%20Studio%20Code.app/Contents/Resources/app/out/vs/workbench/workbench.desktop.main.js:655:944)*

*at Ue.Wc (vscode-file://vscode-app/Applications/Visual%20Studio%20Code.app/Contents/Resources/app/out/vs/workbench/workbench.desktop.main.js:2633:57059)*

2024-09-25 14:21:12.025 **[error]** InstantiationService has been disposed: **Error**: InstantiationService has been disposed

*at g.m (vscode-file://vscode-app/Applications/Visual%20Studio%20Code.app/Contents/Resources/app/out/vs/workbench/workbench.desktop.main.js:655:386)*

*at g.createInstance (vscode-file://vscode-app/Applications/Visual%20Studio%20Code.app/Contents/Resources/app/out/vs/workbench/workbench.desktop.main.js:655:944)*

*at Ue.Wc (vscode-file://vscode-app/Applications/Visual%20Studio%20Code.app/Contents/Resources/app/out/vs/workbench/workbench.desktop.main.js:2633:57059)*

Is there anything more I could do that would help pinpoint the issue ? It occurs during the creation of a dictionary, but it is very far from quick and trivial to extract a potential minimal bit of code to showcase the error, as the underlying structures are quite complex, and simple toy examples don’t generate the crash (and the VSCode debugger needs to be active, as well).

1 Like