bugGNU Octave - Bugs: bug #49736, GUI: Crash when attempting to use...

 
 

bug #49736: GUI: Crash when attempting to use the editor after too many files are opened

Submitter:  None
Submitted:  Tue 29 Nov 2016 02:23:00 PM UTC
   
 
Category:  GUI Severity:  2 - Minor
Priority:  5 - Normal Item Group:  Segfault, Bus Error, etc.
Status:  Confirmed Assigned to:  None
Originator Name:  Alberto Donizetti Originator Email:  -email is unavailable-
Open/Closed:  * Open Release:  * 5.1.0
Operating System:  * GNU/Linux Fixed Release:  None
Planned Release:  None
* Mandatory Fields

Add a New Comment Rich Markup
   

Jump to the original submission

Sun 03 Feb 2019 06:58:12 PM UTC, comment #11: 

Confirmed. It seems that each time a file dialog via Qt is opened, the crash occurs. I think there is little we can do in order to prevent the possibly many different cases where Qt might internally run into problems when too many files are open.


Torsten Lilge <ttl>
Group Member
Fri 01 Feb 2019 07:40:17 AM UTC, comment #10: 

The Octave GUI still crashes for me with signal 5 on the stable branch (hg id 903c9a39e051) when trying to open a file from the GUI after maxing out the open file descriptor limit in the interpreter with


>> version -hgid
ans = 903c9a39e051
>> system ("ulimit -n");
1024
>> fid = []; for i = 1:1024; fid(i) = fopen (tempname (), "w+"); endfor


Mike Miller <mtmiller>
Group Member
Fri 11 Jan 2019 09:24:48 PM UTC, comment #9: 

I have pushed changeset
http://hg.savannah.gnu.org/hgweb/octave/rev/d6a4237a26b4
which fixes the crash of the gui for me. It is not the use of the settings object in general that has been causing the crash but the generation of files required for qscintillas auto completion.

Torsten Lilge <ttl>
Group Member
Sat 29 Dec 2018 01:08:23 PM UTC, comment #8: 

This still happens with the current stable branch on my Ubuntu 18.04. Both cli und gui versions are affected ("error: no such file"), in addition gui is crashing with signal 5 when initiating an action that would open a file dialog.

Torsten Lilge <ttl>
Group Member
Thu 08 Mar 2018 11:05:36 PM UTC, comment #7: 


> You said the crash happens sometimes, still with signal 5?


From the GUI yes, it's always signal 5: "octave exited with signal 5"

> Can you avoid the crash using close("all") when nothing works any longer?


No, because when nothing works, "close" also doesn't work:

-----

>> files = glob("/usr/bin/*");
>> for i = 1:length(files)

  [f, err] = fopen(files{i});
endfor

>> ls

error: no such file, '/usr/share/octave/4.2.1/m/miscellaneous/ls.m'

>> close("all");

error: no such file, '/usr/share/octave/4.2.1/m/plot/util/close.m'
-----

> Which Linux do you use?


Debian Buster.

$ uname -a
Linux 4.14.0-3-amd64 #1 SMP Debian 4.14.17-1 (2018-02-14) x86_64 GNU/Linux

Anonymous
Thu 08 Mar 2018 11:05:33 PM UTC, comment #6: 

Oh, I see now that the original issue of crashing the GUI when trying to use the editor does still happen with dev too.

I misunderstood the issue.  I thought that the crash was happening at the point of opening files, not that it was crashing when trying to use the editor after that.

I'll take a look and see what we can do to prevent that.

Sorry for the confusion.

John W. Eaton <jwe>
Group administrator
Thu 08 Mar 2018 10:54:05 PM UTC, comment #5: 

Please reply at https://savannah.gnu.org/bugs/?49736 for further comments.

<quoting="Alberto Donizetti">

I am still seeing a crash using the reproducer that Kai Torben Ohlhus
posted below. My Octave version is 4.2.1, which according to your
website: https://ftp.gnu.org/gnu/octave/ is the latest.

I don't know if this is fixed on master, but I can tell you for sure
that this is NOT fixed in 4.2.1.
</quoting>

@Alberto Donizetti: You said the crash happens sometimes, still with signal 5? Can you avoid the crash using close("all") when nothing works any longer? Which Linux do you use?

Kai Torben Ohlhus <siko1056>
Group Member
Thu 08 Mar 2018 10:36:15 PM UTC, comment #4: 

Agree to close this item.

1. Even in the case of comment #2, Octave did not crash for me using 4.2.1 and dev using openSUSE 42.3.  The original author claimed this to happen using GNU/Linux for an rather old Octave version.

2. The variable `err` contains a useful message.

3. After typing `close("all")` everything works as expected.

4. No news for more than a year.

P.S.: I get the same numbers for `ulimit` as in comment #3.

Kai Torben Ohlhus <siko1056>
Group Member
Thu 08 Mar 2018 09:11:15 PM UTC, comment #3: 

Doesn't /proc/sys/fs/file-max give the overall limit for all processes on the system?  In bash, the commands


ulimit -S -n
ulimit -H -n


will give you the soft and hard limits for the current process.  On my system, those numbers are 1024 and 4096.

I don't see a crash with the current development sources, just an error message.  And the error returned by fopen is "too many open files".

Is there anything we can do here?  It seems that Octave is behaving as expected here and that this report can be closed.

John W. Eaton <jwe>
Group administrator
Sat 03 Dec 2016 06:32:01 PM UTC, comment #2: 

There is an OS limit to a number of total open files. On my computer it is


cat /proc/sys/fs/file-max
1528426


This can be changed through usual sysctl interface.

Dmitri.

Dmitri A. Sergatskov <dasergatskov>
Sat 03 Dec 2016 11:15:18 AM UTC, comment #1: 

This still happens for the dev version in GUI and CLI for a slightly modified version to get enough files to open:

mytest.m

files = glob("/usr/bin/*");
for i = 1:length(files)
  [f, err] = fopen(files{i});
endfor



$ ./run-octave --no-gui
GNU Octave, version 4.3.0+
[snip]

octave:1> mytest
octave:2> ls
error: no such file, '/workspace/octave/build/../repo/scripts/miscellaneous/ls.m'
octave:2> exit
error: no such file, '/workspace/octave/build/../repo/scripts/startup/__finish__.m'
error: ignoring const octave::execution_exception& while preparing to exit
error: writing file '/home/siko1056/.octave_hist': Too many open files
error: ignoring const octave::execution_exception& while preparing to exit


Kai Torben Ohlhus <siko1056>
Group Member
Tue 29 Nov 2016 02:23:00 PM UTC, original submission:  

Octave 4.0.3 crashes with "signal 5" when using the editor after too many files are opened in the command window.

Steps to reproduce:
 
1) Keep opening files in the command window until fopen returns an error. For example, if 'dir' is a directory with many files in it, chdir to dir and then


files = glob("*");
for i = 1:length(files)
  [f, err] = fopen(files{i});
end


and keep going until err is "Too many open files".

2) Switch to the editor tab in the GUI

- sometimes, Octave crashes right away
- when it doesn't, it'll crash as soon as you try to open a new file, or try to save an existing .m file

Anonymous

 

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

Attach Files:
   
   
Comment:
   

No files currently attached

 

Depends on the following items: None found

Items that depend on this one: None found

 

Carbon-Copy List
  • -email is unavailable- added by ttl (Posted a comment)
  • -email is unavailable- added by jwe (Posted a comment)
  • -email is unavailable- added by dasergatskov (Posted a comment)
  • -email is unavailable- added by siko1056 (Posted a comment)
  • -email is unavailable- added by None (Submitted the item)
  •  

    There are 0 votes so far. Votes easily highlight which items people would like to see resolved in priority, independently of the priority of the item set by tracker managers.

    Only group members can vote.

     

    Follow 15 latest changes.

    Date Changed by Updated Field Previous Value => Replaced by
    2019-02-26 mtmiller Severity3 - Normal 2 - Minor
        StatusReady For Test Confirmed
        Release5.0.90 5.1.0
    2019-02-01 mtmiller Release5.0.1 5.0.90
    2019-01-11 ttl StatusInvalid / Not an Octave Bug Ready For Test
        Releasedev 5.0.1
    2018-03-08 jwe SummaryCrash when too many files are opened GUI: Crash when attempting to use the editor after too many files are opened
    2018-03-08 siko1056 Open/ClosedClosed Open
    2018-03-08 siko1056 Severity4 - Important 3 - Normal
        StatusConfirmed Invalid / Not an Octave Bug
        Open/ClosedOpen Closed
    2016-12-03 siko1056 Severity3 - Normal 4 - Important
        StatusNone Confirmed
        Release4.0.3 dev
        SummaryGUI crash when too many files are open Crash when too many files are opened

    Back to the top

    Powered by Savane 3.13-d3ae.
    Corresponding source code