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

The segfault issue with MATLAB versions 2022/2023 is gone on Linux platforms #215

Merged
merged 4 commits into from
Oct 26, 2023
Merged

Conversation

egavazzi
Copy link
Contributor

I noticed today that MATLAB.jl works perfectly with the new version of MATLAB R2023b.

By curiosity I also checked the former 'problematic' versions (R2023a, R2022b, R2022a) and they all work on my computer. I suspect some update of internals on the MATLAB side: all three versions have received updates in July/August of this year (as can be seen here).

Here is what I manage to get in the REPL:

julia> mat"version"
"9.12.0.2327980 (R2022a) Update 7"
julia> mat"version"
"9.13.0.2320565 (R2022b) Update 6"
julia> mat"version"
"9.14.0.2337262 (R2023a) Update 5"
julia> mat"version"
"23.2.0.2365128 (R2023b)"

So now I don't know what is preferred: removing completely the warning message in README.md, or updating it to inform everything is working as normal now and keeping it for some time 🙂

p.s: this should close issues #200 and #201 🎉

README.md Outdated

| :exclamation: ** MATLAB versions 2022 and 2023 trigger a segfault and do not work with `MATLAB.jl`. Maintainers are attempting to diagnose the cause and fix the issue. ** |
|-----------------------------------------|
| :white_check_mark: ** MATLAB versions 2022 and 2023 now work with `MATLAB.jl`.** |
Copy link

@MariusDrulea MariusDrulea Oct 10, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

If the Matlab updates solved the issue, we shall tell the user to update the Matlab in case of failure. Perhaps the update has an ID or something the user can check.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I tried to identify the specific update version from which things started to work again. But I am not able to downgrade update version with my university license (only possible with some very expensive professional one apparently, the joy of commercial software). So I guess the best we can do is to tell users to update to the most recent version (I think it is only possible to update to the most recent one anyway).

Add info about updating the MATLAB release in case of segfault
@egavazzi
Copy link
Contributor Author

I added a warning to tell the user to update Matlab in case of segfault, as you suggested.
I also tested with older versions of Julia to see if the issue could have come from that side. But everything works, so I think it really is a matter of Matlab updates.

@musm
Copy link
Collaborator

musm commented Oct 11, 2023

Strange my copy still doesn't work and I'm on 2023b on Windows

julia> versioninfo()
Julia Version 1.9.3
Commit bed2cd540a (2023-08-24 14:43 UTC)
Build Info:
  Official https://julialang.org/ release
Platform Info:
  OS: Windows (x86_64-w64-mingw32)
  CPU: 16 × AMD Ryzen 9 5900HS with Radeon Graphics
  WORD_SIZE: 64
  LIBM: libopenlibm
  LLVM: libLLVM-14.0.6 (ORCJIT, znver3)
  Threads: 16 on 16 virtual cores
Environment:
  JULIA_EDITOR = code.cmd
  JULIA_NUM_THREADS = auto

@MariusDrulea
Copy link

@musm Have you tried to do an update to Matlab, just in case?

@egavazzi
Copy link
Contributor Author

@musm Interesting, I will boot on my Windows partition and try. All my tests were done on Linux.

@egavazzi
Copy link
Contributor Author

egavazzi commented Oct 16, 2023

Ok it just crashes on Windows for me too... Tested with R2023b and R2023a. R2021b works fine.

@musm
Copy link
Collaborator

musm commented Oct 17, 2023

Good to know. Yes, AFAIK this issue has been isolated to Windows and possibly MacOS

@egavazzi
Copy link
Contributor Author

egavazzi commented Oct 17, 2023

I vaguely remember having the issue on Linux also. But I might remember wrong 😅 Actually, I found a comment mentioning the problem on Linux: #200 (comment). Mathworks must have changed something in their build on Linux through an update that fixed the issue. But they didn't change it on Windows.

Then I propose to change the original warning to specify that the problem appears under Windows/MacOS. Maybe I will try to get access to a Mac computer through a colleague to test it there.

@egavazzi egavazzi changed the title The segfault issue with MATLAB versions 2022/2023 is now gone The segfault issue with MATLAB versions 2022/2023 is gone on Linux platforms Oct 17, 2023
@musm musm merged commit fb1bc5a into JuliaInterop:master Oct 26, 2023
3 checks passed
@curtcorum
Copy link

curtcorum commented Mar 16, 2024

I am still seeing the segfault with matlab update R2023b Update 6 and 7. And julia 1.9 and 1.10.

Linux green 5.15.0-97-generic #107~20.04.1-Ubuntu SMP Fri Feb 9 14:20:11 UTC 2024 x86_64 x86_64 x86_64 GNU/Linux

MATLAB_ROOT=/usr/local/MATLAB/R2023b

(base) curt@green:~$ julia 
               _
   _       _ _(_)_     |  Documentation: https://docs.julialang.org
  (_)     | (_) (_)    |
   _ _   _| |_  __ _   |  Type "?" for help, "]?" for Pkg help.
  | | | | | | |/ _` |  |
  | | |_| | | | (_| |  |  Version 1.9.4 (2023-11-14)
 _/ |\__'_|_|_|\__'_|  |  Official https://julialang.org/ release
|__/                   |

julia> using MATLAB
[ Info: Precompiling MATLAB [10e44e05-a98a-55b3-a45b-ba969058deb6]

julia> mat"2+2"

[96360] signal (11.1): Segmentation fault
in expression starting at REPL[2]:1
Allocations: 2999 (Pool: 2987; Big: 12); GC: 0
Segmentation fault (core dumped)

(base) curt@green:~$ matlab -batch version
ans =
    '23.2.0.2515942 (R2023b) Update 7'

@curtcorum
Copy link

curtcorum commented Mar 16, 2024

It works on Julia 1.9 with 2021b...

julia> mat"version"
"9.11.0.2358333 (R2021b) Update 7"

@egavazzi
Copy link
Contributor Author

It works on my R2023b but I haven't applied any update (so it is basically Update 0). Now I know I should not update it 😅

julia> mat"version"
"23.2.0.2365128 (R2023b)"

So the problem is back on Linux but seems to be gone on macOS according to #223. Maybe we could change the warning message in the readme to a more general one.

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

Successfully merging this pull request may close these issues.

4 participants