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

[on MS Windows] ERROR: Package MATLAB errored during testing (exit code: 3765269347) #230

Open
hatmatrix opened this issue Jan 7, 2025 · 4 comments

Comments

@hatmatrix
Copy link

hatmatrix commented Jan 7, 2025

I've added MATLAB in Julia v1.11 through the package manager. I am running Windows 11 and MATLAB 2024b is installed. When I run

using MATLAB  # this is fine
mat"ver"

or any other MATLAB code in VSCode, I get:

The terminal process "C:\Users\testacct\.julia\juliaup\julia-1.11.2+0.x64.w64.mingw32\bin\julia.exe '-i', '--banner=no', '--project=C:\Users\testacct\.julia\environments\v1.11', 'c:\Users\testacct\.vscode\extensions\julialang.language-julia-1.127.2\scripts\terminalserver\terminalserver.jl', '\\.\pipe\vsc-jl-repl-159c2360-275d-4eda-9708-5697120d6478', '\\.\pipe\vsc-jl-repldbg-34439aaa-b352-4163-8607-b71adecda219', '\\.\pipe\vsc-jl-cr-929cae24-af6b-48c7-a83a-58fad01bbf68', 'USE_REVISE=true', 'USE_PLOTPANE=true', 'USE_PROGRESS=true', 'ENABLE_SHELL_INTEGRATION=true', 'DEBUG_MODE=false'" terminated with exit code: -529697949.

When running just the Julia terminal without VSCode, the terminal just closes. However, I have noticed that the MATLAB Command Window will pop up before exiting.

When I test the build:

(@v1.11) pkg> test MATLAB
     Testing MATLAB
      Status `C:\Users\testacct\AppData\Local\Temp\jl_tkJSKc\Project.toml`
  [10e44e05] MATLAB v0.8.4
  [8f399da3] Libdl v1.11.0
  [2f01184e] SparseArrays v1.11.0
  [8dfed614] Test v1.11.0
      Status `C:\Users\testacct\AppData\Local\Temp\jl_tkJSKc\Manifest.toml`
  [10e44e05] MATLAB v0.8.4
  [56f22d72] Artifacts v1.11.0
  [2a0f44e3] Base64 v1.11.0
  [b77e0a4c] InteractiveUtils v1.11.0
  [8f399da3] Libdl v1.11.0
  [37e2e46d] LinearAlgebra v1.11.0
  [56ddb016] Logging v1.11.0
  [d6f4376e] Markdown v1.11.0
  [9a3f8284] Random v1.11.0
  [ea8e919c] SHA v0.7.0
  [9e88b42a] Serialization v1.11.0
  [2f01184e] SparseArrays v1.11.0
  [8dfed614] Test v1.11.0
  [e66e0078] CompilerSupportLibraries_jll v1.1.1+0
  [4536629a] OpenBLAS_jll v0.3.27+1
  [bea87d4a] SuiteSparse_jll v7.7.0+0
  [8e850b90] libblastrampoline_jll v5.11.0+0
     Testing Running tests...
┌ Error: mktempdir cleanup
│   exception =
│    IOError: rm("C:\\Users\\TESTACCT\\AppData\\Local\\Temp\\jl_tkJSKc"): directory not empty (ENOTEMPTY)
│    Stacktrace:
│      [1] uv_error
│        @ .\libuv.jl:106 [inlined]
│      [2] rm(path::String; force::Bool, recursive::Bool)
│        @ Base.Filesystem .\file.jl:307
│      [3] rm
│        @ .\file.jl:273 [inlined]
│      [4] mktempdir(fn::Pkg.Operations.var"#116#121"{Dict{String, Any}, Bool, Bool, Bool, Pkg.Operations.var"#131#136"{Bool, Cmd, Cmd, Nothing, Pkg.Types.Context, Vector{Tuple{String, Base.Process}}, String, Pkg.Types.PackageSpec}, Pkg.Types.Context, Pkg.Types.PackageSpec, String, String}, parent::String; prefix::String)
│        @ Base.Filesystem .\file.jl:825
│      [5] mktempdir(fn::Function, parent::String)
│        @ Base.Filesystem .\file.jl:815
│      [6] mktempdir
│        @ .\file.jl:815 [inlined]
│      [7] #sandbox#115
│        @ C:\Users\testacct\.julia\juliaup\julia-1.11.2+0.x64.w64.mingw32\share\julia\stdlib\v1.11\Pkg\src\Operations.jl:1834 [inlined]   
│      [8] test(ctx::Pkg.Types.Context, pkgs::Vector{Pkg.Types.PackageSpec}; coverage::Bool, julia_args::Cmd, test_args::Cmd, test_fn::Nothing, force_latest_compatible_version::Bool, allow_earlier_backwards_compatible_versions::Bool, allow_reresolve::Bool)
│        @ Pkg.Operations C:\Users\testacct\.julia\juliaup\julia-1.11.2+0.x64.w64.mingw32\share\julia\stdlib\v1.11\Pkg\src\Operations.jl:2052
│      [9] test
│        @ C:\Users\testacct\.julia\juliaup\julia-1.11.2+0.x64.w64.mingw32\share\julia\stdlib\v1.11\Pkg\src\Operations.jl:1996 [inlined]   
│     [10] test(ctx::Pkg.Types.Context, pkgs::Vector{Pkg.Types.PackageSpec}; coverage::Bool, test_fn::Nothing, julia_args::Cmd, test_args::Cmd, force_latest_compatible_version::Bool, allow_earlier_backwards_compatible_versions::Bool, allow_reresolve::Bool, kwargs::@Kwargs{io::IOContext{IO}})
│        @ Pkg.API C:\Users\testacct\.julia\juliaup\julia-1.11.2+0.x64.w64.mingw32\share\julia\stdlib\v1.11\Pkg\src\API.jl:475
│     [11] test(pkgs::Vector{Pkg.Types.PackageSpec}; io::IOContext{IO}, kwargs::@Kwargs{})
│        @ Pkg.API C:\Users\testacct\.julia\juliaup\julia-1.11.2+0.x64.w64.mingw32\share\julia\stdlib\v1.11\Pkg\src\API.jl:159
│     [12] test(pkgs::Vector{Pkg.Types.PackageSpec})
│        @ Pkg.API C:\Users\testacct\.julia\juliaup\julia-1.11.2+0.x64.w64.mingw32\share\julia\stdlib\v1.11\Pkg\src\API.jl:148
│     [13] do_cmd(command::Pkg.REPLMode.Command, io::Base.TTY)
│        @ Pkg.REPLMode C:\Users\testacct\.julia\juliaup\julia-1.11.2+0.x64.w64.mingw32\share\julia\stdlib\v1.11\Pkg\src\REPLMode\REPLMode.jl:407
│     [14] do_cmds(commands::Vector{Pkg.REPLMode.Command}, io::Base.TTY)
│        @ Pkg.REPLMode C:\Users\testacct\.julia\juliaup\julia-1.11.2+0.x64.w64.mingw32\share\julia\stdlib\v1.11\Pkg\src\REPLMode\REPLMode.jl:393
│     [15] do_cmds(repl::REPL.LineEditREPL, commands::String)
│        @ REPLExt C:\Users\testacct\.julia\juliaup\julia-1.11.2+0.x64.w64.mingw32\share\julia\stdlib\v1.11\Pkg\ext\REPLExt\REPLExt.jl:92  
│     [16] on_done(s::REPL.LineEdit.MIState, buf::IOBuffer, ok::Bool, repl::REPL.LineEditREPL)
│        @ REPLExt C:\Users\testacct\.julia\juliaup\julia-1.11.2+0.x64.w64.mingw32\share\julia\stdlib\v1.11\Pkg\ext\REPLExt\REPLExt.jl:106 
│     [17] #invokelatest#2
│        @ .\essentials.jl:1055 [inlined]
│     [18] invokelatest
│        @ .\essentials.jl:1052 [inlined]
│     [19] (::REPLExt.var"#47#50"{REPL.LineEditREPL})(s::REPL.LineEdit.MIState, buf::IOBuffer, ok::Bool)
│        @ REPLExt C:\Users\testacct\.julia\juliaup\julia-1.11.2+0.x64.w64.mingw32\share\julia\stdlib\v1.11\Pkg\ext\REPLExt\REPLExt.jl:128 
│     [20] #invokelatest#2
│        @ .\essentials.jl:1055 [inlined]
│     [21] invokelatest
│        @ .\essentials.jl:1052 [inlined]
│     [22] run_interface(terminal::REPL.Terminals.TextTerminal, m::REPL.LineEdit.ModalInterface, s::REPL.LineEdit.MIState)
│        @ REPL.LineEdit C:\Users\testacct\.julia\juliaup\julia-1.11.2+0.x64.w64.mingw32\share\julia\stdlib\v1.11\REPL\src\LineEdit.jl:2755
│     [23] run_frontend(repl::REPL.LineEditREPL, backend::REPL.REPLBackendRef)
│        @ REPL C:\Users\testacct\.julia\juliaup\julia-1.11.2+0.x64.w64.mingw32\share\julia\stdlib\v1.11\REPL\src\REPL.jl:1474
│     [24] (::REPL.var"#75#81"{REPL.LineEditREPL, REPL.REPLBackendRef})()
│        @ REPL C:\Users\testacct\.julia\juliaup\julia-1.11.2+0.x64.w64.mingw32\share\julia\stdlib\v1.11\REPL\src\REPL.jl:480
└ @ Base.Filesystem file.jl:828
ERROR: Package MATLAB errored during testing (exit code: 3765269347)

After testing I have checked "C:\Users\TESTACCT\AppData\Local\Temp\jl_tkJSKc" and it appears to be empty.

I believe this gentleman had the same error and suggested running the Julia terminal in Administrator mode for installation and testing.

However, having tried this I got the exact same error so it did not fix the problem in my case. Any ideas on what I can try next to get this running? Many thanks.

@RoyiAvital
Copy link

RoyiAvital commented Jan 12, 2025

This kind of issues happen often on Julia with Windows.
My hunch (I may be wrong) is the process tries to delete a folder before the process of deleting all its contents is done.
Or accessing a folder / file before the process of creating it is done.

Probably has something to do with Windows being slower on small file operations due to its more advanced File System design.
I wonder if some pause somewhere would assist with that.

@hatmatrix
Copy link
Author

This kind of issues happen often on Julia with Windows. My hunch (I may be wrong) is the process tries to delete a folder before the process of deleting all its contents is done. Or accessing a folder / file before the process of creating it is done.

Indeed it seems to be a Windows error rather than a Julia error.

Probably has something to do with Windows being slower on small file operations due to its more advanced File System design. I wonder if some pause somewhere would assist with that.

Is there a way to implement a pause? I assume it's not specific to MATLAB.jl but in the Pkg build function, though looking through Pkg.jl it's not so clear to me where that could be.

@RoyiAvital
Copy link

Indeed it seems to be a Windows error rather than a Julia error.

I don't think so.
It seems to be that a code is optimized for other OS's.
Windows' File System is very generic and built for having 3rd party Plug In's and other features which creates latency.
If some async operation does not take that into consideration issues might happen.

Again, just a hunch.

Is there a way to implement a pause?

I have a script in PowerShell which deals with files.
I had some issues with it and once I added a pause it worked well.
There should be a Pause in Julia. But it might be issue with a lower level library.

@bolognam
Copy link
Contributor

Note: #226 is not in the current release, so you may want the master branch instead. Not sure if this will help or not.

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

3 participants