bugGNU Octave - Bugs: bug #43351, format + crashes the GUI

 
 

bug #43351: format + crashes the GUI

Submitted by:  None
Submitted on:  Fri 03 Oct 2014 07:51:41 PM UTC  
 
Category: GUISeverity: 3 - Normal
Priority: 5 - NormalItem Group: Segfault, Bus Error, etc.
Status: FixedAssigned to: None
Originator Name: Erik WantaOriginator Email: -unavailable-
Open/Closed: ClosedRelease: 3.8.2
Operating System: Any

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)

Tue 07 Oct 2014 12:57:04 PM UTC, comment #8:

The crash was fixed with 4b6f87c6739f, the default format "+- " and docstring with cset 97eea1e2d9ff (http://hg.savannah.gnu.org/hgweb/octave/rev/97eea1e2d9ff) in gui-release which should get the 4.0 release.

Andreas Weber <andy1978>
Project Member
Sun 05 Oct 2014 06:24:38 PM UTC, comment #7:

Yes I think we should also fix the default behavior.

The current default is that only a "+" is printed for positive elements; zero and negative element positions are left blank.
This is less useful for the average user: I suppose the predominant motive to use "format +" is to check which elements are non-zero.

One can use spy as well but 'format +' is easier and quicker.

Philip Nienhuis <philipnienhuis>
Project Member
Sun 05 Oct 2014 10:32:43 AM UTC, comment #6:

Btw, it is possible to change plus_format_chars:

But the help says (as Philip already stated) 'plus CHARS', for example '+ "+-."'.

I think the current octave implementation (with two args) is plausible here and we should fix the documentation.

Andreas Weber <andy1978>
Project Member
Sun 05 Oct 2014 09:42:03 AM UTC, comment #5:

Fixed in cset 4b6f87c6739f.

The reason for this was in short_disp from octave_base_scalar and octave_base_matrix which is only used for the GUI workspace in symtab.cc (not used in the CLI).

What should we do with the matlab incompatibility with "format +"? Should we change the defaults to "+- "?

Andreas Weber <andy1978>
Project Member
Sat 04 Oct 2014 10:27:21 AM UTC, comment #4:

In pr-output.cc the chars for "format plus" are defined as

(not as "+- " as matlab does but this isn't the problem here, only a ML incompatibility)

I think the problem is in ov-base-mat.cc:479 (default branch)

where "size_t pos = tmp.find_first_not_of (" ");" returns "string::npos" (not found) and then "os << tmp.substr (pos);" throws a out_of_range which isn't cached.

The same problem is also in ov-base-scalar.cc for "a=-1;format +"

Andreas Weber <andy1978>
Project Member
Sat 04 Oct 2014 09:59:47 AM UTC, comment #3:

On 4.1.0+ CLI I get no crash (but it looks intruiging):

I get the same on 3.6.4-MSVC:

So + only prints for positive elements rather than non-zero elements, which doesn't conform to "help format".

format '+ "+-."' isn't accepted, format + "abc" is but does nothing:

Matlab r2014b prerel does:

and Matlab's 'help format' says":

so it seems Octave's format command is also ML-incompatible (but I like Octave's intended behavior better)

Philip Nienhuis <philipnienhuis>
Project Member
Sat 04 Oct 2014 09:36:33 AM UTC, comment #2:

Confirmed (hard crash) on Windows as well w. 3.8.0, 3.8.2-64bit, 3.9.0+ & 4.1.0+

It works fine with 3.6.4-MSVC

OS -> any, I'll leave 'Release' as it is entered

Philip Nienhuis <philipnienhuis>
Project Member
Sat 04 Oct 2014 04:29:25 AM UTC, comment #1:

I can confirm this on the actual gui branch.

Torsten <ttl>
Project Member
Fri 03 Oct 2014 07:51:41 PM UTC, original submission:

./octave --force-gui

a=[1,2,-3,4]
format +

octave exited with signal 6

Anonymous

 

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

Attach File(s):
   
   
Comment:
   

No files currently attached

 

Depends on the following items: None found

Digest:
   bug dependencies.

 

Carbon-Copy List
  • -unavailable- added by andy1978 (Posted a comment)
  • -unavailable- added by ttl (Posted a comment)
  • -unavailable- added by None (Submitted the item)
  •  

    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 5 latest changes.

    Date Changed By Updated Field Previous Value => Replaced By
    Tue 21 Oct 2014 12:10:29 AM UTCmtmillerDependencies-=>bugs #43451 is dependent
    Tue 07 Oct 2014 03:11:47 PM UTCandy1978Open/ClosedOpen=>Closed
    Tue 07 Oct 2014 12:57:04 PM UTCandy1978StatusConfirmed=>Fixed
    Sat 04 Oct 2014 09:36:33 AM UTCphilipnienhuisOperating SystemGNU/Linux=>Any
    Sat 04 Oct 2014 04:29:25 AM UTCttlStatusNone=>Confirmed

    Back to the top


    Powered by Savane 3.1-cleanup1