bugGNU Octave - Bugs: bug #50696, Iterating "saveas" or...

 
 

bug #50696: Iterating "saveas" or "print" function crashes after many iterations (e.g. 500)

Submitted by:  None
Submitted on:  Sat 01 Apr 2017 12:02:36 PM UTC  
 
Category: PlottingSeverity: 3 - Normal
Priority: 5 - NormalItem Group: Unexpected Error
Status: FixedAssigned to: None
Originator Name: Originator Email: -unavailable-
Open/Closed: ClosedRelease: 4.2.1
Operating System: Microsoft Windows

Add a New Comment(Rich Markup)
   

You are not logged in

Please log in, so followups can be emailed to you.

 

(Jump to the original submission Jump to the original submission)

Thu 06 Jul 2017 08:29:05 PM UTC, comment #6:

Thanks. I pushed the change here:

http://hg.savannah.gnu.org/hgweb/octave/rev/38188d1aaf3f

Closing report as fixed.

John W. Eaton <jwe>
Project Administrator
Thu 06 Jul 2017 08:19:42 PM UTC, comment #5:

it does for me on Fedora 26.

Dmitri.
--

Dmitri A. Sergatskov <dasergatskov>
Thu 06 Jul 2017 06:55:14 PM UTC, comment #4:

Does the attached patch fix the problem for you?

(file #41134)

John W. Eaton <jwe>
Project Administrator
Thu 06 Jul 2017 06:40:09 PM UTC, comment #3:

I can duplicate this problem with the development sources on a Debian system, so I'll try to see if I can figure out what is opening and unlinking these files.

John W. Eaton <jwe>
Project Administrator
Tue 04 Jul 2017 02:25:57 AM UTC, comment #2:

It seems to me that the bug here is octave leaking open file handles (i.e. it creates and deletes files without closing them).
The crash happens becqause you exceed ulimit on number of open files.
I modified (simplified) the script to:

every time i run it I see number of open files
(as reported by "lsof | grep octave | wc -l") is increasing by 200. Eventually it reaches my ulimit and octave crashes.

(this is with a recent developemnt snapshot)

Dmitri.
--

Dmitri A. Sergatskov <dasergatskov>
Mon 03 Jul 2017 10:43:52 PM UTC, comment #1:

I get this crash with the following code:

It crashes exactly after the 504th print. This might be related to bug #34631, because before simplifying my crashing code down to what's shown here, I was able to catch

warning: ft_manager: unable to load font: ...
warning: ft_render: unable to load ...

repeated frequently. However, currently the code shown here crashes without any flash of these warnings as it exits.

I ran into this problem while saving images to later piece together as a video animation.

Marshall <marsian>
Sat 01 Apr 2017 12:02:36 PM UTC, original submission:

% Iterating "saveas" or "print" function crashes after many iterations (e.g. 500):

% given the following set up where we have an array of vectors we wish to plot, loading vectors in loop, performing plotting, labelling and saving works successfully up to a limit. Above this limit, the octave engine crashes. In the GUI I reach a limit of 505 plots, in the CLI I reach the limit of 509 plots.

for i = dataIndex = 1:N %(e.g. N = 1000)

v1 = csvread(strcat(PATHTOFILE,v1Data(dataIndex ).name));
v2 = csvread(strcat(PATHTOFILE,v2Data(dataIndex ).name));

% assuming length(v1) == length(v2) - my measurements were length(v1) == length(v2) == circa 40 to 50

h = figure;

plot(v1,v2,'-ob');

title(num2str(dataIndex));
u = max(max(v1,v2));

xlim([0 u]);
ylim([0 u]);
xlabel('v1');
ylabel('v2');

drawnow;

% following assumes filenames are preallocated in filenameout:
saveas(h,strcat(SAVEDIR,filenameout(dataIndex).name,'.png'),'png');
% OR:
%print(h,strcat(SAVEDIR,filenameout(dataIndex).name,'.png'),'-dpng');

close(h)

end

The Windows system resources are very far from saturation. Can anyone else replicate this condition or similar?

Anonymous

 

(Note: upload size limit is set to 16384 kB, after insertion of the required escape characters.)

Attach File(s):
   
   
Comment:
   

Attached Files
file #41134:  diffs.txt added by jwe (1KiB - text/plain)

 

Depends on the following items: None found

Items that depend on this one: None found

 

Carbon-Copy List
  • -unavailable- added by jwe (Posted a comment)
  • -unavailable- added by dasergatskov (Posted a comment)
  • -unavailable- added by marsian (Posted a comment)
  •  

    Do you think this task is very important?
    If so, you can click here to add your encouragement to it.
    This task has 0 encouragements so far.

    Only project members can vote.

     

    Please enter the title of George Orwell's famous dystopian book (it's a date):

     

     

    Follow 4 latest changes.

    Date Changed By Updated Field Previous Value => Replaced By
    Thu 06 Jul 2017 08:29:05 PM UTCjweStatusPatch Submitted=>Fixed
      Open/ClosedOpen=>Closed
    Thu 06 Jul 2017 06:55:14 PM UTCjweAttached File-=>Added diffs.txt, #41134
      StatusNone=>Patch Submitted

    Back to the top


    Powered by Savane 3.1-cleanup1