0.4.4 Matlab Window

Hi Chris,

I’ve been trying to run MWorks 0.4.4 on OS X 10.6.4. Most of it seems to work, but I’m having trouble with a Matlab window crash. I configured it as described in the documentation (alias in /Applications). I get the Matlab window dialog and I can select the events Matlab should see, but things look wrong when I prime the Matlab engine. WIth the Application Monitor I can see Matlab launch, but I get no splash screen, and X11 doesn’t launch. I get no output in the Matlab dialog text field. It will sit like that, but if I run a few trials Client crashes (e.g., below). I never see a Matlab window.

I’ve tried setting the Server, Client and Matlab to all run in 64 bit or all run in 32 bit, but it doesn’t seem to matter. Do you have any ideas about this?

I’ve attached the XML I’m using. It uses our LabJackU6 driver, but I suspect this would be trouble with the Fake Monkey as well.

Thanks,
John

Thread 2 Crashed:
0   libobjc.A.dylib               	0x90a7eedb objc_msgSend + 27
1   ...yourcompany.yourcocoabundle	0x02fa64fc -[MWMATLABWindowController MATLABExecutionLoop:] + 631
2   com.apple.Foundation          	0x943218d4 -[NSThread main] + 45
3   com.apple.Foundation          	0x94321884 __NSThread__main__ + 1499
4   libSystem.B.dylib             	0x9032d81d _pthread_start + 345
5   libSystem.B.dylib             	0x9032d6a2 thread_start + 34

[From Mark]

Hi Chris,

I looked at this very very briefly, as well. I saw everything John describes below with one addendum. The Matlab engine definitely starts and is functional. A Matlab process starts running, and before the crash (which happens on the first or second “processed event”), you see some Matlab output in the window, which had to have been returned by the live engine.

Hope that helps,
Mark

Hi John and Mark,

Thanks for the report. I’ll look into this and get back to you ASAP.

Chris

Hi guys,

I’ve managed to reproduce the problem. It appears to be a memory error that was introduced (somehow) when I moved some code that’s shared by the MATLAB window and getCodecs/getEvents into a static library. I’ll keep investigating and work out a proper fix.

For now, I’ve reverted the problematic code move and rebuilt the MATLAB plugin. I’m attaching it in a zip file, which you can unpack and uninstall into /Library/Application Support/MWorks/Plugins/Client. Can you give it a try and verify that it resolves the issue?

Thanks,
Chris

Hi Chris,

Thanks for working on this. You seem to have stopped the Client from crashing, but I’m still not getting Matlab to work properly. It loads and I get messages in the Matlab Window dialog, but Matlab doesn’t give a splash screen, doesn’t launch X11 and never displays figures.

According to Mark, he never got the Matlab window to work correctly unless the MWorks plugin made sure X11 was running before launching Matlab (by launching X11 itself if necessary). Additionally, the Matlab window didn’t display properly unless the Matlab launch command included a -display flag:

“/Applications/MATLAB/bin/matlab -maci -display :0.0”

as in http://github.com/histed/MWorks/blob/master/0.4.3_dev/DLabClientPlugins/MATLABWindow/MATLABInterface.m.

Thanks,
John

Hi John,

According to Mark, he never got the Matlab window to work correctly unless the MWorks plugin made sure X11 was running before launching Matlab (by launching X11 itself if necessary). Additionally, the Matlab window didn’t display properly unless the Matlab launch command included a -display flag

Actually, it appears that as of Mac OS X 10.5, you should not set DISPLAY. See this explanation.

The MATLAB GUI isn’t launching because MWClient sets DISPLAY. I modified it to not do so and rebuilt, and now X11 automatically launches when the MATLAB window executes a plotting command. I’ve attached the fixed application. Can you download it and see if this fix works for you, too?

Thanks,
Chris

Hi Chris,

That seems to have done the trick. I now get X11 launching, a Matlab splash screen and my plots displayed.

Thank you for taking care of this so quickly.

Best,

John

Hi John,

That seems to have done the trick. I now get X11 launching, a Matlab splash screen and my plots displayed.

Great!

FYI, I just posted a bugfix installer on the official MWorks download page, which you can use to patch the MATLAB window in other 0.4.4 installations.

Chris