bugGNU Octave - Bugs: bug #65730, Some remaining cases of silent...

 
 

bug #65730: Some remaining cases of silent conversion of fractional inputs

Submitter:  Arun Giridhar <arungiridhar>
Submitted:  Mon 13 May 2024 12:58:57 AM UTC
   
 
Category:  Octave Function Severity:  3 - Normal
Priority:  5 - Normal Item Group:  Missed Error or Warning
Status:  Fixed Assigned to:  None
Originator Name:  Open/Closed:  * Closed
Release:  * dev Operating System:  * Any
Fixed Release:  10.1.0 (current default) Planned Release:  10.1.0 (current default)
* Mandatory Fields

Add a New Comment Rich Markup
   

Mon 13 May 2024 01:08:02 AM UTC, comment #1: 

Pushed to https://hg.savannah.gnu.org/hgweb/octave/rev/3e446791b7ef

No new BISTs.

Ready for test.

Arun Giridhar <arungiridhar>
Group Member
Mon 13 May 2024 12:58:57 AM UTC, original submission:  

Some remaining cases of fractional inputs being converted silently to integer dimensions:


filter (ones(3,3,3,3), 2, ones(3,3,3,3), [], pi)   # Last argument is dimension

cellfun ("size", cell(3,3), pi)                    # Last argument is dimension

A = rand (3, 3); D = eigs (@(x) A*x, pi, 1)        # Penultimate argument is dimension

rats (e, 12.345)                                   # Last argument is string length


Changing `nint_value` to `strict_int_value` causes these functions to give errors for those fractional inputs and also continue to trap nan inputs like they did with nint_value, which overall seems better.

I'll push that change once I get a bug number.

Inputs of +inf and -inf are still allowed by strict_int_value, exactly like nint_value. Whether that constitutes legal input depends on the individual function. Some functions have additional checks after the call to integer conversion to check for inf.

Note that this code:

rats (pi, N)

asks Octave to construct a rational approximation to `pi` whose string representation is N characters long. Setting N to a very large value or inf causes an OOM crash, also on stable. Not sure whether to guard against it, since such code specifically asks for it...

Arun Giridhar <arungiridhar>
Group Member

 

(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 arungiridhar (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 4 latest changes.

    Date Changed by Updated Field Previous Value => Replaced by
    2024-05-20 arungiridhar StatusReady For Test Fixed
        Open/ClosedOpen Closed
        Fixed ReleaseNone 10.1.0 (current default)
    2024-05-13 arungiridhar StatusNone Ready For Test

    Back to the top

    Powered by Savane 3.13-3e34.
    Corresponding source code