Matlab system() call interrupted by resizing tmux/screen window

Viewed 214

I am executing another program from Matlab using system(). I am using Matlab in -nodisplay mode inside a tmux session (over ssh). The call to system() takes several minutes to execute. If I resize the tmux window (or e.g. split the pane) during this time, then the call is interrupted with the following error:

>> system('sleep 10');
Error using system
Unexpected system error: bang: poll [4] Interrupted system call

After that, all future calls to system() return immediately, without waiting for the process to finish. I need to restart Matlab to make it work correctly again.

This does not happen if I just use Matlab directly in the ssh session without tmux.

How can I prevent this from happening?

Other details:

  • The same thing happens if the ssh connection is lost (e.g. computer sleep and wake).
  • I am using tmux but the same thing happens in screen.
  • The system is Ubuntu 14.04, Matlab version 9.2.0.538062 (R2017a).
0 Answers
Related