bugGNU Octave - Bugs: bug #45484, mldivide/mrdivide crashes octave 4...

 
 

bug #45484: mldivide/mrdivide crashes octave 4 on windows, triggers exception on Linux and MacOSX

Submitted by:  Alois Schlögl <schloegl>
Submitted on:  Mon 06 Jul 2015 08:27:35 PM UTC  
 
Category:  Octave Function Severity:  3 - Normal
Priority:  5 - Normal Item Group:  Segfault, Bus Error, etc.
Status:  Duplicate Assigned to:  None
Originator Name:  Open/Closed:  Closed
Release:  4.0.0 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.

 

Thu 03 Dec 2015 03:52:51 AM UTC, comment #4: 

This is essentially a duplicate of bug #39000: The inability to install a XERBLA handler in Windows.  If we had that we could catch the exception in the Fortran code and just issue an error rather than segfaulting.  Closing this report as a duplicate.

Rik <rik5>
Project Administrator
Tue 07 Jul 2015 06:35:27 PM UTC, comment #3: 

@jwe: The Windows build installs OpenBLAS by default so that is what I was using on that OS.  On Linux, I tried both OpenBLAS and reference BLAS with the same result.

Rik <rik5>
Project Administrator
Tue 07 Jul 2015 05:11:00 PM UTC, comment #2: 

@Rik:  Are you using the same BLAS on both systems?

John W. Eaton <jwe>
Project Administrator
Tue 07 Jul 2015 03:52:14 PM UTC, comment #1: 

Confirmed on Windows XP Virtual Machine, Octave 4.0.0 from installer.  I tried both with octave-gui.exe and octave-cli.exe and both have the problem.  When running from the CLI there is at least some reporting of the problem, the same error message you saw.

warning: matrix singular to machine precision, rcond = nan

        On entry to DLASCL parameter number 4 had an illegal value

I also get a pop-up error message from Windows that an instruction tried to read from memory location 0x10 which is bound to be a segmentation violation.

However, on Linux (Ubuntu 12.04), I don't get an exception.  I do get a warning about the matrix being singular.  In addition, the output is all zeros instead of being all NaNs.

y = NaN (4)
y =

   NaN   NaN   NaN   NaN
   NaN   NaN   NaN   NaN
   NaN   NaN   NaN   NaN
   NaN   NaN   NaN   NaN

>> y / y
warning: matrix singular to machine precision
ans =

   0   0   0   0
   0   0   0   0
   0   0   0   0
   0   0   0   0

>> mrdivide (y,y)
ans =

   0   0   0   0
   0   0   0   0
   0   0   0   0
   0   0   0   0

>> mldivide (y,y)
ans =

   0   0   0   0
   0   0   0   0
   0   0   0   0
   0   0   0   0

Interestingly, if I change the matrix slightly, I can generate the same warning on Linux as well.

y = Nan (4);
y(3,3) = 1;
y / y
warning: matrix singular to machine precision
 ** On entry to DLASCL parameter number  4 had an illegal value
error: exception encountered in Fortran subroutine dgelsd_

Rik <rik5>
Project Administrator
Mon 06 Jul 2015 08:27:35 PM UTC, original submission:  

The following commands crash octave 4 on windows 7.

  x=repmat(NaN,4); x/x
  x=repmat(NaN,4); xx
  mldivide(x,x)
  mrdivide(x,x)

The binary download
 https://ftp.gnu.org/gnu/octave/windows/octave-4.0.0_0-installer.exe
was used.

The same commands cause an exception on Octave 3.8.2 and 4.0 on Linux (compiled from source on debian 8), as well as in MacOSX/homebrew.

octave:1>   x=repmat(NaN,4); y=x/x
warning: matrix singular to machine precision, rcond = nan

    • On entry to DLASCL parameter number  4 had an illegal value

error: exception encountered in Fortran subroutine dgelsd_
octave:1>   x=repmat(NaN,4); y=xx
warning: matrix singular to machine precision, rcond = nan

    • On entry to DLASCL parameter number  4 had an illegal value

error: exception encountered in Fortran subroutine dgelsd_
octave:1>   y=mldivide(x,x)
warning: matrix singular to machine precision, rcond = nan

    • On entry to DLASCL parameter number  4 had an illegal value

error: mldivide: exception encountered in Fortran subroutine dgelsd_
octave:1>   y=mrdivide(x,x)
warning: matrix singular to machine precision, rcond = nan

    • On entry to DLASCL parameter number  4 had an illegal value

error: mrdivide: exception encountered in Fortran subroutine dgelsd_

and the result is undefined.

I'd expect that no exception is triggered, but a result should be a matrix of proper size as the following:

y =
   NaN   NaN   NaN   NaN
   NaN   NaN   NaN   NaN
   NaN   NaN   NaN   NaN
   NaN   NaN   NaN   NaN

That's what Matlab is providing.

  Alois

Alois Schlögl <schloegl>

 

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

Attach Files:
   
   
Comment:
   

No files currently attached

 

Carbon-Copy List
  • -email is unavailable- added by jwe (Posted a comment)
  • -email is unavailable- added by rik5 (Posted a comment)
  • -email is unavailable- added by schloegl (Submitted the item)
  •  

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

    Only project members can vote.

     

     

     

    Follow 7 latest changes.

    Date Changed by Updated Field Previous Value => Replaced by
    2015-12-03 rik5 StatusConfirmed => Duplicate
        Open/ClosedOpen => Closed
    2015-09-12 mtmiller DependenciesRemoved dependency from bugs #45577 => -
    2015-09-12 mtmiller Dependencies- => Depends on bugs #39000
    2015-09-01 rik5 Dependencies- => bugs #45849 is dependent
    2015-07-22 rik5 Dependencies- => bugs #45577 is dependent
    2015-07-07 rik5 StatusNone => Confirmed

    Back to the top


    Powered by Savane 3.7