Matlab crashes when saving fit

Matlab (2018a 9.4.0.813654) crashes when I try to save the structured matrix created by Stan (CmdStan 2.17.1). I successfully run multiple Stan models. I don’t have any problem reading data from the fit, and then using them, either. The problem only occurs if I actually try to save the structured matrix generated by Stan. Computer is a MacBook Pro High Sierra 10.13.6. Also posted the issue on Git Stan Matlab page. Just hoping the find someone who may have had the same issue. Thanks

You may have better luck opening an issue on the MATLAB repo. It’s not one of our more widely used interfaces and I don’t even think Brian Lau, the maintainer, has a Discourse forum ID, because I can’t look it up to ping him.

Hi, thanks for the reply. I left the same message on Lau’s Matlab GitHub. That page does not appear to be very active, that’s why I also left one here.

I’ve been in contact with Matlab and they help me diagnose the problem. I’m not a developer so I cannot say that I understand the problem fully. However, according to Matlab, the problem results from the process manager for the StanFit object calling expired timers in Matlab when trying to save. We could not come up with a good workaround. Tried to delete the processes branch under fit but that triggers a delete of the .sim as well. Matlab sent me a follow up said this problem probably exists in release 2018a. They told me to get a 2018b prerelease or downgrade to 2017b and this would allow me to save fit from the Matlab command window. I did not try this yet, so remains to be seen.

For the record. Finally tested CmdStan on Matlab 2018b prerelease. It is possible to save “fit” without crashing Matlab but still get a bunch of warnings (below). Warnings don’t affect functionality though, as it is possible to recover the saved fit later and do whatever is needed.

save fit fit
Warning: java.lang.UNIXProcess@4ed38226 is not serializable
Warning: java.io.BufferedReader@3d43fe is not serializable
Warning: java.io.BufferedReader@74ad8d05 is not serializable
Warning: java.lang.UNIXProcess@676ff3b0 is not serializable
Warning: java.io.BufferedReader@35ff8fc9 is not serializable
Warning: java.io.BufferedReader@5fb7183b is not serializable
Warning: java.lang.UNIXProcess@476a736d is not serializable
Warning: java.io.BufferedReader@5f80fa43 is not serializable
Warning: java.io.BufferedReader@16c8b7bd is not serializable
Warning: java.lang.UNIXProcess@7159139f is not serializable
Warning: java.io.BufferedReader@65bcf7c2 is not serializable
Warning: java.io.BufferedReader@3db64bd4 is not serializable
Warning: java.lang.UNIXProcess@4ed38226 is not serializable
Warning: java.io.BufferedReader@3d43fe is not serializable
Warning: java.io.BufferedReader@74ad8d05 is not serializable
Warning: java.lang.UNIXProcess@676ff3b0 is not serializable
Warning: java.io.BufferedReader@35ff8fc9 is not serializable
Warning: java.io.BufferedReader@5fb7183b is not serializable
Warning: java.lang.UNIXProcess@476a736d is not serializable
Warning: java.io.BufferedReader@5f80fa43 is not serializable
Warning: java.io.BufferedReader@16c8b7bd is not serializable
Warning: java.lang.UNIXProcess@7159139f is not serializable
Warning: java.io.BufferedReader@65bcf7c2 is not serializable
Warning: java.io.BufferedReader@3db64bd4 is not serializable
Warning: java.lang.UNIXProcess@4ed38226 is not serializable
Warning: java.io.BufferedReader@3d43fe is not serializable
Warning: java.io.BufferedReader@74ad8d05 is not serializable
Warning: java.lang.UNIXProcess@676ff3b0 is not serializable
Warning: java.io.BufferedReader@35ff8fc9 is not serializable
Warning: java.io.BufferedReader@5fb7183b is not serializable
Warning: java.lang.UNIXProcess@476a736d is not serializable
Warning: java.io.BufferedReader@5f80fa43 is not serializable
Warning: java.io.BufferedReader@16c8b7bd is not serializable
Warning: java.lang.UNIXProcess@7159139f is not serializable
Warning: java.io.BufferedReader@65bcf7c2 is not serializable
Warning: java.io.BufferedReader@3db64bd4 is not serializable
Warning: java.lang.UNIXProcess@4ed38226 is not serializable
Warning: java.io.BufferedReader@3d43fe is not serializable
Warning: java.io.BufferedReader@74ad8d05 is not serializable
Warning: java.lang.UNIXProcess@676ff3b0 is not serializable
Warning: java.io.BufferedReader@35ff8fc9 is not serializable
Warning: java.io.BufferedReader@5fb7183b is not serializable
Warning: java.lang.UNIXProcess@476a736d is not serializable
Warning: java.io.BufferedReader@5f80fa43 is not serializable
Warning: java.io.BufferedReader@16c8b7bd is not serializable
Warning: java.lang.UNIXProcess@7159139f is not serializable
Warning: java.io.BufferedReader@65bcf7c2 is not serializable
Warning: java.io.BufferedReader@3db64bd4 is not serializable
Warning: java.lang.UNIXProcess@4ed38226 is not serializable
Warning: java.io.BufferedReader@3d43fe is not serializable
Warning: java.io.BufferedReader@74ad8d05 is not serializable
Warning: java.lang.UNIXProcess@676ff3b0 is not serializable
Warning: java.io.BufferedReader@35ff8fc9 is not serializable
Warning: java.io.BufferedReader@5fb7183b is not serializable
Warning: java.lang.UNIXProcess@476a736d is not serializable
Warning: java.io.BufferedReader@5f80fa43 is not serializable
Warning: java.io.BufferedReader@16c8b7bd is not serializable
Warning: java.lang.UNIXProcess@7159139f is not serializable
Warning: java.io.BufferedReader@65bcf7c2 is not serializable
Warning: java.io.BufferedReader@3db64bd4 is not serializable
Warning: java.lang.UNIXProcess@4ed38226 is not serializable
Warning: java.io.BufferedReader@3d43fe is not serializable
Warning: java.io.BufferedReader@74ad8d05 is not serializable
Warning: java.lang.UNIXProcess@676ff3b0 is not serializable
Warning: java.io.BufferedReader@35ff8fc9 is not serializable
Warning: java.io.BufferedReader@5fb7183b is not serializable
Warning: java.lang.UNIXProcess@476a736d is not serializable
Warning: java.io.BufferedReader@5f80fa43 is not serializable
Warning: java.io.BufferedReader@16c8b7bd is not serializable
Warning: java.lang.UNIXProcess@7159139f is not serializable
Warning: java.io.BufferedReader@65bcf7c2 is not serializable
Warning: java.io.BufferedReader@3db64bd4 is not serializable