MATLAB: Simulink Design Verifier has an unexpected internal error when running model compatibility check in R2017b, how to avoid it

Simulink Design Verifier

I am trying to use Simulink DV for test generation, but I have an error when checking the model compatibility with the following stack trace
b:\matlab\toolbox\sldv\src\sldv\translator\transform\misctransforms.cpp:685: Assert : canBeSafelyRemoved, Lhs of Init should not be used in the local scope
[ 0] 0x00000004cba5c44d bin\win64\sldv.dll+02409549 QueryMLFcnTable_sldv+01140925
[ 1] 0x00000004cba5b979 bin\win64\sldv.dll+02406777 QueryMLFcnTable_sldv+01138153
[ 2] 0x00000004cb8980ce bin\win64\sldv.dll+00557262 sldv_mexFunction+00000286
[ 3] 0x00000000fc5fd8c9 bin\win64\libmex.dll+00121033 mexRunMexFile+00000313
[ 4] 0x00000000fc5fc4f2 bin\win64\libmex.dll+00115954 mexFeature_mexver+00002130
[ 5] 0x00000000fc5fb306 bin\win64\libmex.dll+00111366 mexUnlock+00023430
[ 6] 0x0000000015ad44d4 bin\win64\pgo\m_dispatcher.dll+00017620 Mfh_file::dispatch_fh_impl+00000820
[ 7] 0x0000000015ad4126 bin\win64\pgo\m_dispatcher.dll+00016678 Mfh_file::dispatch_fh_with_reuse+00000062
[ 8] 0x00000000167aa61c bin\win64\pgo\m_lxe.dll+00108060
[ 9] 0x0000000016905f83 bin\win64\pgo\m_lxe.dll+01531779 boost::archive::detail::iserializer > >::load_object_data+00029587
[ 10] 0x00000000169033d5 bin\win64\pgo\m_lxe.dll+01520597 boost::archive::detail::iserializer > >::load_object_data+0001840
How do I avoid this error?

Best Answer

Please refer to the following bug report for workarounds and fixes: