Thread Subject: print causes matlab to crash in linux

Subject: print causes matlab to crash in linux

From: David Doria

Date: 24 Apr, 2008 14:00:19

Message: 1 of 7

x=1:10;
y=x.^2;
plot(x,y);
print(gcf,'-dpng','test.png');

this crashes matlab in linux!! works fine in windows.

anyone know why this may be??

Thanks,

Dave

Subject: print causes matlab to crash in linux

From: David Doria

Date: 24 Apr, 2008 14:19:04

Message: 2 of 7

After more looking, it seems that does in fact work - that
was just a simple demo i thought I could give. However:

peaks
saveas(gcf,'test.png','png')

doesn't crash matlab, but saves an entirely black image!

If I run saveas(gcf,'test3.png','png') on my actual data (a
surf plot) then matlab does crash.

Any clues?

Subject: print causes matlab to crash in linux

From: Ben

Date: 24 Apr, 2008 16:51:54

Message: 3 of 7

I'm having a similar problem.

When I try to save an image file, using
saveas(<handle>,'filename.eps','epsc2'),
it crashes my entire desktop, not just matlab. It seems to happen
when i have a relatively complicated image, for example one with 4
subplots. It doesn't crash every single time, I can usually save a
file once, then the second time it crashes.

It does this in both command line mode and in desktop mode.

The only solution I've found is to use the "print" command, e.g.

print -f2 -depsc2 filename.eps
(where -f<...> is the figure handle, in my case, I'm trying to save
figure 2).

It doesn't seem to be crashing (yet).



On Apr 24, 10:19 am, "David Doria" <daviddo...@gmail.com> wrote:
> After more looking, it seems that does in fact work - that
> was just a simple demo i thought I could give. However:
>
> peaks
> saveas(gcf,'test.png','png')
>
> doesn'tcrashmatlab, but saves an entirely black image!
>
> If I run saveas(gcf,'test3.png','png') on my actual data (a
> surf plot) then matlab doescrash.
>
> Any clues?

Subject: print causes matlab to crash in linux

From: Ben

Date: 24 Apr, 2008 17:09:35

Message: 4 of 7

Update: Check this message for a possible solution:

http://groups.google.com/group/comp.soft-sys.matlab/msg/ff4a311272efbd15


On Apr 24, 10:19 am, "David Doria" <daviddo...@gmail.com> wrote:
> After more looking, it seems that does in fact work - that
> was just a simple demo i thought I could give. However:
>
> peakssaveas(gcf,'test.png','png')
>
> doesn'tcrashmatlab, but saves an entirely black image!
>
> If I runsaveas(gcf,'test3.png','png') on my actual data (a
> surf plot) then matlab doescrash.
>
> Any clues?

Subject: print causes matlab to crash in linux

From: Richard Quist

Date: 24 Apr, 2008 17:13:40

Message: 5 of 7

Ben wrote:
> I'm having a similar problem.
>
> When I try to save an image file, using
> saveas(<handle>,'filename.eps','epsc2'),
> it crashes my entire desktop, not just matlab. It seems to happen
> when i have a relatively complicated image, for example one with 4
> subplots. It doesn't crash every single time, I can usually save a
> file once, then the second time it crashes.
>
> It does this in both command line mode and in desktop mode.
>
> The only solution I've found is to use the "print" command, e.g.
>
> print -f2 -depsc2 filename.eps
> (where -f<...> is the figure handle, in my case, I'm trying to save
> figure 2).
>
> It doesn't seem to be crashing (yet).
>
>
>
> On Apr 24, 10:19 am, "David Doria" <daviddo...@gmail.com> wrote:
>> After more looking, it seems that does in fact work - that
>> was just a simple demo i thought I could give. However:
>>
>> peaks
>> saveas(gcf,'test.png','png')
>>
>> doesn'tcrashmatlab, but saves an entirely black image!
>>
>> If I run saveas(gcf,'test3.png','png') on my actual data (a
>> surf plot) then matlab doescrash.
>>
>> Any clues?
>

There can be a number of causes. I suggest you contact your local support
office so they can address the specific situations.

--

Richard Quist
Software Developer
The MathWorks, Inc.

Subject: print causes matlab to crash in linux

From: Richard Quist

Date: 24 Apr, 2008 17:18:38

Message: 6 of 7

Ben wrote:
> Update: Check this message for a possible solution:
>
> http://groups.google.com/group/comp.soft-sys.matlab/msg/ff4a311272efbd15
>
>
> On Apr 24, 10:19 am, "David Doria" <daviddo...@gmail.com> wrote:
>> After more looking, it seems that does in fact work - that
>> was just a simple demo i thought I could give. However:
>>
>> peakssaveas(gcf,'test.png','png')
>>
>> doesn'tcrashmatlab, but saves an entirely black image!
>>
>> If I runsaveas(gcf,'test3.png','png') on my actual data (a
>> surf plot) then matlab doescrash.
>>
>> Any clues?
>
That particular message only applies if MATLAB was started with the -nojvm option

--

Richard Quist
Software Developer
The MathWorks, Inc.

Subject: print causes matlab to crash in linux

From: Levi Kilcher

Date: 27 May, 2008 21:58:01

Message: 7 of 7

I had a similar problem in which not only matlab crashed,
but the entire xsession. I posted my fix here:
http://www.mathworks.com/matlabcentral/newsreader/view_thread/158572

--
LFK

Tags for this Thread

Add a New Tag:

Separated by commas
Ex.: root locus, bode

What are tags?

A tag is like a keyword or category label associated with each thread. Tags make it easier for you to find threads of interest.

Anyone can tag a thread. Tags are public and visible to everyone.

rssFeed for this Thread

Contact us at files@mathworks.com