Command window corruption bug in Linux

3 views (last 30 days)
Joris Gillis
Joris Gillis on 21 Nov 2016
Commented: dnavidad on 2 Nov 2019
Hi,
The following code seems to corrupt the user-terminal: background changes color, and characters meld into each other when scrolling.
for i=1:1000,'x',drawnow('update'),pause(0.0001),end
The corruption is repaired, by issuing a clc command.
The code may look rather pointless, but is in fact an abstraction of what with software project we are working on. We have a C++ codebase with a mex interface. The C++ methods we call can take a long while to compute, and intermediate results are being "mexPrintf"-printed. We issue a 'drawnow('update'),pause(0.0001)' after each newline to have the effect of updating the Command Window, while the C++ code is being run.
Best regards, Joris
  1 Comment
f
f on 18 Apr 2017
I have this bug too. Ubuntu 16.10, Intel 520 graphics (Skylake). Whenever I use something that scrolls heavily, the command window gets corrupted.

Sign in to comment.

Answers (2)

Folkert Bleichrodt
Folkert Bleichrodt on 29 Mar 2017
I think I found the issue (and a fix). I set the MATLAB_JAVA environment variable to point to the jre version installed on my machine, so that Matlab does not uses its own java jre version. Simply put this in your .bashrc file:
export MATLAB_JAVA=/usr/lib/jvm/java-8-openjdk/jre
or when starting matlab use
$ MATLAB_JAVA=/usr/lib/jvm/java-8-openjdk/jre matlab -desktop -nosplash
I don't get the same glitches anymore when I run your code.
  2 Comments
Christoph
Christoph on 4 Dec 2018
Hi Dr Bleichrodt,
thanks for your answer.
Would it perhaps be possible for you (or anyone else for that matter) to help me adjusting this fix to the following situation:
My libjvm.so lies in
/usr/lib/jvm/java-11-openjdk-amd64/lib/server
When set mu MATLAB_JAVA to
/usr/lib/jvm/java-11-openjdk-amd64/
The problem is that Matlab (v2016a) attaches a misguided suffix to my MATLAB_JAVA:
/usr/lib/jvm/java-11-openjdk-amd64//lib/amd64/server/libjvm.so
(i.e., the "amd64" seems to have moved to the "java-11-openjdk-amd64" and is no longer a subdirectory).
So, how can I change what is appended to MATLAB_JAVA in order to find the libjvm.so?
Many thanks,
Christoph
dnavidad
dnavidad on 2 Nov 2019
Hello Joris
Have you solved your problem? I have the same one and I am using the same version of Matlab that you does. 2016a. The problem is so annoyning, it is not only the command windows who is corrupted but everything is mixed up, in the workspace window you see the text of your actual script and things like that.
Please, I would be glad if you could help.
I tried what was suggested by Dr Bleichrodt, but it does not work for me.
export MATLAB_JAVA=/usr/lib/jvm/java-8-openjdk/jre. I do not get any error but, Matlab is still doing the same thing...

Sign in to comment.


Folkert Bleichrodt
Folkert Bleichrodt on 29 Mar 2017
Edited: Folkert Bleichrodt on 30 Mar 2017
Hi Joris, I have the same problem in Matlab R2017a, which version do you use? I have this with an NVIDIA + intel graphics card combination. Clearing the screen by running
clc
seems to resolve the issue (temporarily). My guess is that it is either the java runtime environment or some graphics card driver issue.
Best regards, Folkert

Categories

Find more on Interactive Control and Callbacks in Help Center and File Exchange

Tags

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!