TVersionCheck crashing MATLAB


Including a ROOT header into a mex cpp-file causes a segmentation fault in MATLAB. I’ve been able to narrow this down to TVersionCheck.h and more specifically this line: static TVersionCheck gVersionCheck(ROOT_VERSION_CODE);

This crash doesn’t occur (usually) immediately, but rather after enough GUI activity (viewing variables, text in command window, etc.) has occurred or after MATLAB is closed.

Could this be caused by the bug mentioned in the header?

This can be reproduced (at least on my end) by simply including the TVersionCheck.h in any mex-file.

I’ve compiled the file with the following command:
mex('-largeArrayDims', 'CXXFLAGS="$CXXFLAGS $(root-config --cflags)"', '-lCore', 'LDFLAGS="$LDFLAGS $(root-config --libs)"','root_test.cpp')

Any suggestions or work-around? Or is this a problem for Mathworks (and if so, what should they do)?

_ROOT Version:6.18.00
_Platform:Ubuntu 16.04
_Compiler:GCC 5.5

Maybe @moneta could help…

This looks to me a problem with Matlab. You should try to get this support from Mathworks.
Also, we have not experience of using ROOT with MATLAB.
But If you need to apply some patches in ROOT, please let us know. We could eventually apply them

Best regards



Can you give any suggestions as to what Mathworks should look into or what to tell them? Since this requires the installation of third-party software, it is not something that Mathworks can test easily (and most likely they are not willing to test it).



I have no idea why Matlab crashes. You should try to understand the reason and eventually make a reproducible with a simple external C++ code.
If it is just due to TVersionCheck, try to the static creation of TVersionCheck you can try to remove that line


This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.