MATLAB: Matlab does not start on Fedora 28

fedorajavalinuxMATLAB

I used Matlab 2018a with Fedora 27 Atomic Workstation and it worked fine. After the update to Fedora 28 Atomic Workstation, only the splash screen appears, when Matlab starts. Even a fresh installation of Matlab does not solve the problem. I tried to run Matlab 2018a on a normal Fedora 28 installation in a virtual machine. Matlab is not starting on Fedora 28, either.
Starting Matlab with logging enabled:
./matlab -desktop -logfile test3.log
leads to the following error in the log:
Exception in thread "AWT-EventQueue-0" java.lang.UnsatisfiedLinkError: com.mathworks.storage.matlabdrivedesktop.NativeMatlabDriveAccess.getMATLABDriveLocationNative(Ljava/lang/String;)Ljava/lang/String;
at com.mathworks.storage.matlabdrivedesktop.NativeMatlabDriveAccess.getMATLABDriveLocationNative(Native Method)
at com.mathworks.storage.matlabdrivedesktop.NativeMatlabDriveAccess.getMATLABDrivePath(NativeMatlabDriveAccess.java:46)
at com.mathworks.storage.matlabdrivedesktop.MatlabDriveAddressBarPlugin.isEnabled(MatlabDriveAddressBarPlugin.java:112)
at com.mathworks.addressbar_api.AddressBarPluginManager.mapFriendlyPathToRealPath(AddressBarPluginManager.java:77)
at com.mathworks.mlwidgets.explorer.util.MacEncodingBugWorkaround.i18nFix_mapFriendlyPathToRealPath(MacEncodingBugWorkaround.java:57)
at com.mathworks.mlwidgets.explorer.model.navigation.NavigationHistory$HistoryItem.<init>(NavigationHistory.java:226)
at com.mathworks.mlwidgets.explorer.model.navigation.NavigationHistory$HistoryItem.<init>(NavigationHistory.java:220)
at com.mathworks.mlwidgets.explorer.model.navigation.NavigationHistory.convertToHistoryItemArray(NavigationHistory.java:216)
at com.mathworks.mlwidgets.explorer.model.navigation.NavigationHistory.refreshFromPreferences(NavigationHistory.java:137)
at com.mathworks.mlwidgets.explorer.model.navigation.NavigationHistory.<init>(NavigationHistory.java:65)
at com.mathworks.mlwidgets.explorer.model.navigation.NavigationHistory.<init>(NavigationHistory.java:52)
at com.mathworks.mde.explorer.Explorer.buildAddressBar(Explorer.java:623)
at com.mathworks.mde.explorer.Explorer.<init>(Explorer.java:178)
at com.mathworks.mde.explorer.Explorer.createInstance(Explorer.java:285)
at com.mathworks.mde.explorer.Explorer.getInstance(Explorer.java:272)
at com.mathworks.mde.desk.MLDesktop.setCurrentFolderBarBelowToolstrip(MLDesktop.java:1548)
at com.mathworks.mde.desk.MLDesktop.restoreLayout(MLDesktop.java:1619)
at com.mathworks.widgets.desk.Desktop.restoreLayout(Desktop.java:5609)
at com.mathworks.widgets.desk.Desktop.restorePreviousLayout(Desktop.java:4474)
at com.mathworks.mde.desk.MLDesktop.restorePreviousLayout(MLDesktop.java:1575)
at com.mathworks.widgets.desk.Desktop.initMainFrame(Desktop.java:294)
at com.mathworks.mde.desk.MLDesktop.initMainFrameFromThread(MLDesktop.java:876)
at com.mathworks.mde.desk.MLDesktop.access$2100(MLDesktop.java:212)
at com.mathworks.mde.desk.MLDesktop$Initializer.run(MLDesktop.java:1217)
at java.awt.event.InvocationEvent.dispatch(InvocationEvent.java:311)
at java.awt.EventQueue.dispatchEventImpl(EventQueue.java:756)
at java.awt.EventQueue.access$500(EventQueue.java:97)
at java.awt.EventQueue$3.run(EventQueue.java:709)
at java.awt.EventQueue$3.run(EventQueue.java:703)
at java.security.AccessController.doPrivileged(Native Method)
at java.security.ProtectionDomain$JavaSecurityAccessImpl.doIntersectionPrivilege(ProtectionDomain.java:80)
at java.awt.EventQueue.dispatchEvent(EventQueue.java:726)
at java.awt.EventDispatchThread.pumpOneEventForFilters(EventDispatchThread.java:201)
at java.awt.EventDispatchThread.pumpEventsForFilter(EventDispatchThread.java:116)
at java.awt.EventDispatchThread.pumpEventsForHierarchy(EventDispatchThread.java:105)
at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:101)
at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:93)
at java.awt.EventDispatchThread.run(EventDispatchThread.java:82)
Starting matlab with
./matlab -nodesktop
works fine.

Best Answer

Summary:
1) dnf install libnsl
2) Use system libfreetype. Move bin/glnxa64/libfreetype* to another folder. See https://www.mathworks.com/matlabcentral/answers/364727-why-does-matlab-crash-on-linux-fedora-26-with-a-segmentation-violation-r2017b-or-later
Details:
I first get these errors with 'matlab -logfile log.txt':
Exception in thread "AWT-EventQueue-0" java.lang.UnsatisfiedLinkError: com.mathworks.storage.matlabdrivedesktop.NativeMatlabDriveAccess.getMATLABDriveLocationNative(Ljava/lang/String;)Ljava
/lang/String;
at com.mathworks.storage.matlabdrivedesktop.NativeMatlabDriveAccess.getMATLABDriveLocationNative(Native Method)
at com.mathworks.storage.matlabdrivedesktop.NativeMatlabDriveAccess.getMATLABDrivePath(NativeMatlabDriveAccess.java:46)
...
This corresponds to the missing library libnsl required by libnativemldrivedesktop.so
At Matlab installed folder:
$ ldd bin/glnxa64/libnativemldrivedesktop.so
...
libnsl.so.1 => not found
After installing libnsl, I then get Matlab output dump: Segmentation violation detected. Work around on the libfreetype gets the matlab2018a running.
You might be missing different libraries that I've installed. Check out the libraries required by the .so files in Matlab.
Hope this helps. This issue was resolved quickly due to sending error report to Matlab, and they responded on the libfreetype workaround.
Related Question