Drexel dragonThe Math ForumDonate to the Math Forum



Search All of the Math Forum:

Views expressed in these public forums are not endorsed by Drexel University or The Math Forum.


Math Forum » Discussions » Software » comp.soft-sys.matlab

Topic: print and saveas segmentation fault with -nodisplay
Replies: 3   Last Post: Jul 16, 2013 2:00 PM

Advanced Search

Back to Topic List Back to Topic List Jump to Tree View Jump to Tree View   Messages: [ Previous | Next ]
Jan Neggers

Posts: 4
Registered: 5/9/13
print and saveas segmentation fault with -nodisplay
Posted: Jul 16, 2013 4:29 AM
  Click to see the message monospaced in plain text Plain Text   Click to reply to this topic Reply

This seems to be quite an old but persistent problem,

Problem definition:
when you try to save a figure to a file (e.g. pdf, png, fig, etc.) matlab exists with a segmentation fault (newer versions also give a core dump). It mostly seems to happen when the figure contains some patch or surface type objects.

When does it happen:
When you run a matlab version on linux using the -nodisplay (or -nodesktop) option. I've tried many matlab versions ranging from 2007a to 2013a all seem to have the problem (for my figures).

Selection links of topics of others with this problem:
http://www.mathworks.com/matlabcentral/newsreader/view_thread/311701
http://www.mathworks.com/matlabcentral/newsreader/view_thread/258144
http://www.mathworks.com/matlabcentral/newsreader/view_thread/165283
http://www.mathworks.com/matlabcentral/newsreader/view_thread/139979
http://stackoverflow.com/questions/13293956/segmentation-violation-detected-matlab

Mentioned solutions:
1) Change the renderer:
>> set(gcf,'Renderer','Painters')
>> set(gcf,'Renderer','zbuffer')
>> set(gcf,'Renderer','OpenGL')


2) Set openGL to software (which is already the default on unix, according to the manual)
>> opengl software

3) Use smaller meshgrids, Aaron Hoffer (thread 139979) found that the problem was fixed when his grid was less then 80 by 80 pixels.

None of the solutions worked for me, for none of the tested matlab versions, after a lot of attempts and many segfaults I found the solution for my figures:

4) Don't use the latex interperpreter.
Switching back to the normal text renderer for all my text objects (xlabels, titles, etc.) made the segmentation faults go away. Which is not really a solution, but at least now I can generate figures from our cluster.

Just my two pennies, good luck to anyone suffering from this "bug".



Point your RSS reader here for a feed of the latest messages in this topic.

[Privacy Policy] [Terms of Use]

© Drexel University 1994-2014. All Rights Reserved.
The Math Forum is a research and educational enterprise of the Drexel University School of Education.