81182 / matlabcontrol

Automatically exported from code.google.com/p/matlabcontrol
0 stars 0 forks source link

eval occasionally runs in non-base workspace #10

Closed GoogleCodeExporter closed 8 years ago

GoogleCodeExporter commented 8 years ago
What version of matlabcontrol are you using?
(Release versions: 4.0.0, 3.1.0, 3.0.1, 3.0.0, or 2.0.0)
4.0.0

What version of MATLAB are you using?
2012a

What operating system are you using?
Linux

Are you using matlabcontrol from inside MATLAB or outside MATLAB?
Inside matlab

What steps will reproduce the problem?
1.
2.
3.

What did you expect to happen? What happened instead?

Please provide any additional information below.

Sometimes matlabproxy.eval(cmd) runs the command inside a method namespace 
instead of the main namespace. This happens in a gui matlab application, and 
I'm guessing it's related to callback functions. I expected this to not be 
possible due to matlab's single-threading, but I can see it happen occasionally.

Anyway: Replacing "eval" with "evalin","base" in the three relevant functions 
of JMIWrapper.MatlabThreadOperations seems to fix it.

Original issue reported on code.google.com by j...@simula.no on 3 Oct 2012 at 10:29

GoogleCodeExporter commented 8 years ago
Can you provide me with code that reproduces this issue?

Original comment by nonot...@gmail.com on 18 Feb 2013 at 8:20

GoogleCodeExporter commented 8 years ago

Original comment by nonot...@gmail.com on 18 Feb 2013 at 8:21

GoogleCodeExporter commented 8 years ago
Sorry, no. It was (is) a race condition, and not easily reproducible. The 
application where it happened is a matlab gui (java driven) application, and 
receives user events simultaneously with matlabcontrol commands. I have not 
seen the problem since replacing eval by evalin.

Original comment by j...@simula.no on 18 Feb 2013 at 7:14

GoogleCodeExporter commented 8 years ago
This issue was closed by revision r479.

Original comment by nonot...@gmail.com on 19 Feb 2013 at 7:21