MATLAB: Does MATLAB R2017a crash when I save and reload a Simulink.MDLInfo object

MATLABsl_loadsave_mcos.dllsl_services.dllslsvstring

I am trying to save and reload a Simulink.MDLInfo object using a MAT file:
mdl_info = Simulink.MDLInfo('vdp.slx');
save('test.mat');
load('test.mat');
mdl_info
After reloading the MAT file into workspace and trying to access a method of the Simulink.MDLInfo object, MATLAB R2017a crashes with stack trace below:
Stack Trace (from fault):
[ 0] 0x00000000f9100cf9 bin\win64\sl_services.dll+00068857 slsvString::slsvString+00000009
[ 1] 0x00000000fa63272d bin\win64\sl_loadsave_mcos.dll+00075565 MLTerminate_sl_loadsave_mcos+00017821
[ 2] 0x00000000260bc2b7 bin\win64\mcos_factory.dll+00115383 mcos::factory::impl::PropertyImpl::getValue+00000055
[ 3] 0x000000002092ca5c bin\win64\pgo\mcos_impl.dll+00313948
[ 4] 0x000000002092bb45 bin\win64\pgo\mcos_impl.dll+00310085
[ 5] 0x0000000020ae889e bin\win64\pgo\mcos_impl.dll+02132126 QueryMLFcnTable_mcos_impl+01498050
[ 6] 0x00000000209105a2 bin\win64\pgo\mcos_impl.dll+00198050
[ 7] 0x00000000209117fb bin\win64\pgo\mcos_impl.dll+00202747
[ 8] 0x0000000020a7a95e bin\win64\pgo\mcos_impl.dll+01681758 QueryMLFcnTable_mcos_impl+01047682
[ 9] 0x0000000020a7a8aa bin\win64\pgo\mcos_impl.dll+01681578 QueryMLFcnTable_mcos_impl+01047502
[ 10] 0x0000000020a7a53d bin\win64\pgo\mcos_impl.dll+01680701 QueryMLFcnTable_mcos_impl+01046625
[ 11] 0x0000000020a79b6c bin\win64\pgo\mcos_impl.dll+01678188 QueryMLFcnTable_mcos_impl+01044112
[ 12] 0x0000000020934e82 bin\win64\pgo\mcos_impl.dll+00347778
[ 13] 0x0000000020934727 bin\win64\pgo\mcos_impl.dll+00345895
[ 14] 0x0000000020934151 bin\win64\pgo\mcos_impl.dll+00344401
[ 15] 0x0000000020934008 bin\win64\pgo\mcos_impl.dll+00344072
[ 16] 0x0000000017b79be1 bin\win64\pgo\m_dispatcher.dll+00039905 Mfh_MATLAB_fn::dispatch_fh+00000641
[ 17] 0x00000000209181e4 bin\win64\pgo\mcos_impl.dll+00229860
[ 18] 0x000000001b136cc4 bin\win64\pgo\libmwlxeindexing.dll+00421060 MathWorks::lxe::display+00000428
[ 19] 0x0000000019ec19ef bin\win64\pgo\m_lxe.dll+23402991 boost::archive::detail::pointer_oserializer<boost::archive::binaryTerm_oarchive,MathWorks::lxe::MatlabIrTree>::save_object_ptr+00491891

Best Answer

This is a bug in MATLAB R2017a (and earlier) that was fixed in R2017b.
To work around the issue, convert the object to a struct before saving it:
mdl_info = struct(Simulink.MDLInfo('vdp.slx'));
save('test.mat');
load('test.mat');
mdl_info