bugGNU Octave - Bugs: bug #37469, crash when making a large cell...

 
 

bug #37469: crash when making a large cell array

Submitter:  Doug Stewart <dastew>
Submitted:  Sun 30 Sep 2012 02:04:10 AM UTC
   
 
Category:  Interpreter Severity:  3 - Normal
Priority:  5 - Normal Item Group:  Segfault, Bus Error, etc.
Status:  Wont Fix Assigned to:  None
Originator Name:  Doug Stewart Open/Closed:  * Closed
Release:  * dev Operating System:  * GNU/Linux
Fixed Release:  None Planned Release:  None
* Mandatory Fields

Add a New Comment Rich Markup
   

Fri 12 Oct 2012 03:16:24 PM UTC, comment #3: 

From testing, this seems to be an operating system issue (how much stack space is reserved for program use) rather than an Octave issue.  Closing report.

Rik <rik5>
Group administrator
Sun 30 Sep 2012 05:29:10 AM UTC, comment #2: 

Here is a bit more information.  The problem is not in the construction of the large nested cell array.  Rather the segfault results from the 'whos' command.  Apparently while trying to calculate the size of the variable 'a' Octave repeatedly calls byte_size on each element.  This leads to a call stack that is on the order of 2.4e5.

So, one way to test things is to increase the size of the stack.  I find that if I increase the size of the stack to 64MB then everything works correctly.  You might try increasing the size of the stack at the shell prompt and then trying 'run-octave' and see if everything works.  It does for me.  If that is the case then this is not an Octave issue and I will close this report.


Limit commands
Operation                sh/ksh/bash command    csh/tcsh command
View soft limits         ulimit -S -a           limit
View hard limits         ulimit -H -a           limit -h
Set stack size to 64 MB  ulimit -S -s 65536     limit stacksize 64m


Rik <rik5>
Group administrator
Sun 30 Sep 2012 04:45:39 AM UTC, comment #1: 

Confirmed on hg id 2fa06d83263a.  I changed the summary to reflect that this happens with a cell array, not a struct array.  I've also uploaded a script to demonstrate the problem (mk_lg_cell.m).

Note that the problem is with nesting, not with ordinary cell arrays that contain a large number of elements.  I reduced the loop to just for i = 1:5 to get an idea of what the variable 'a' would look like.  See the output below.


a =
{
  [1,1] =  1
  [1,2] =
  {
    [1,1] =  1
    [1,2] =
    {
      [1,1] =  1
      [1,2] =
      {
        [1,1] =  1
        [1,2] =
        {
          [1,1] =  1
          [1,2] = {}(0x0)
        }
      }
    }
  }
}



(file #26666)

Rik <rik5>
Group administrator
Sun 30 Sep 2012 02:04:10 AM UTC, original submission:  

 hg id
219479b461b8 tip

If I run the script at
http://agora.octave.org/snippet/JVWZ/
Octave crashes (disappears)

I also tested some older versions and they also crashed.

I don't think this is a high priority item: but thought it should be mentioned.

Doug Stewart <dastew>

 

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

Attach Files:
   
   
Comment:
   

Attached Files
file #26666:  mk_lg_cell.m added by rik5 (128B - text/x-octave)

 

Depends on the following items: None found

Items that depend on this one: None found

 

Carbon-Copy List
  • -email is unavailable- added by rik5 (Updated the item)
  • -email is unavailable- added by dastew (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 6 latest changes.

    Date Changed by Updated Field Previous Value => Replaced by
    2012-10-12 rik5 CategoryGUI Interpreter
        StatusConfirmed Wont Fix
        Open/ClosedOpen Closed
    2012-09-30 rik5 Attached File- Added mk_lg_cell.m, #26666
        StatusNone Confirmed
        Summarycrash when making a large struct array crash when making a large cell array

    Back to the top

    Powered by Savane 3.13-4448.
    Corresponding source code