bugGNU Octave - Bugs: bug #42512, qr with permutation fails with...

 
 

bug #42512: qr with permutation fails with --enable-64

Submitted by:  Anton <ajf>
Submitted on:  Thu 05 Jun 2014 09:51:06 AM UTC  
 
Category:  Libraries Severity:  3 - Normal
Priority:  5 - Normal Item Group:  Incorrect Result
Status:  Invalid Assigned to:  None
Originator Name:  Anton Open/Closed:  Closed
Release:  3.8.1 Operating System:  GNU/Linux

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)

Mon 09 Jun 2014 11:16:26 AM UTC, comment #9: 

Ok, I seem to have solved that problem as well, by deleting the launcher files in ~/.local/share/applications, after that I could restart Octave again from terminal and re-attach it to the sidebar, and now it seems to work. Strange, but well, more an Ubuntu problem I guess.

Thanks again for helping to sort that out.

Anton <ajf>
Mon 09 Jun 2014 11:05:10 AM UTC, comment #8: 

Thanks for all the help getting that sorted so far.

Not having correctly compiled the dependencies was probably part of the problem. I have now managed to do that (after some trial and error).

... now I get the strange behaviour that [Q, R, P] = qr ([1 2; 3 4]) works if I start octave from a terminal window, but still fails with the same error message, if I start octave from the Ubuntu/Unity side/launcher bar. Any ideas how to fix that?

Anton <ajf>
Thu 05 Jun 2014 02:58:56 PM UTC, comment #7: 

How did you build the dependencies for Octave?  Were you careful to follow the directions here

http://www.gnu.org/software/octave/doc/interpreter/Compiling-Octave-with-64_002dbit-Indexing.html#Compiling-Octave-with-64_002dbit-Indexing

especially the part about enabling 64-bit integers for all Fortran dependencies?

If you think you did build and link with the libraries correctly, are you sure you are using them when you run Octave?  You may need to set LD_LIBRARY_PATH in your environment so that Octave links with the libraries you built instead of other 32-bit versions of those libraries that may be installed.

I'm unable to duplicate the problem with a 64-bit build when I'm using properly built dependency libraries, but if I don't set LD_LIBRARY_PATH appropriately, I get a segfault when trying your example.

John W. Eaton <jwe>
Project Administrator
Thu 05 Jun 2014 02:45:12 PM UTC, comment #6: 

I don't know how to run gdb, debuging C code is probably beyond my capabilities. If someone tells me which commands to use, I am happy to try them and report the results, but otherwise I am out of my depth here.

... got my linear regression computed with the LinearRegression function in the octave-forge optim package, so although it would be nice to get it working, my work does not depend on it right now.

Anton <ajf>
Thu 05 Jun 2014 02:15:53 PM UTC, comment #5: 

This might have something to do with 64-bit support then, I have no way to test that at the moment. Retitling to reflect what seems to be the actual error here.

Since you built this yourself, can you dig into where the error is coming from? Since it's only for 3 output arguments it might be in the QRP classes. You can try setting a breakpoint for gripe_invalid_index in gdb and run the same qr command and possibly see where the problem lies.

Mike Miller <mtmiller>
Project Administrator
Thu 05 Jun 2014 01:50:54 PM UTC, comment #4: 

PPS
Spoken too quickly [Q, R] = qr ([1 2; 3 4]) works, calling [Q, R, P] = qr ([1 2; 3 4]) again produces the error:
error: qr: subscript indices must be either positive integers less than 2^63 or logicals

So seem to have something to do with the third return parameter for QR - P...

Anton <ajf>
Thu 05 Jun 2014 01:46:46 PM UTC, comment #3: 

PS
Just calling QR, e.g. [Q, R] = qr ([1 2; 3 4]) works fine.

Anton <ajf>
Thu 05 Jun 2014 01:33:09 PM UTC, comment #2: 

Hi,

thanks for the answer, the output for your commands below. I am running Octave 3.8.1, I compiled it myself from the official sources to enable 64bit support. My OS is the current Ubuntu 14.04 LTS.

%%%%%%%%%%%%%%%%%
dbstop polyfit 114
ans =  114
octave:2> polyfit ([0 1 2], [0 1 4], 2)
stopped in /opt/octave3.8/share/octave/3.8.1/m/polynomial/polyfit.m at line 114
114:   [q, r, k] = qr (v(:, polymask), 0);
debug> type qr
qr is a dynamically-linked function
debug> whos
Variables in the current scope:

   Attr Name                 Size                     Bytes  Class
   ==== ====                 ====                     =====  =====
        ans                  1x1                          8  double
  a     argn                 3x9                         27  char
        l                    1x1                          8  double
        m                    1x1                          8  double
    f   n                    1x1                          8  double
        polymask             1x3                          3  logical
        v                    3x3                         72  double
    f   x                    3x1                         24  double
    f   y                    3x1                         24  double
        y_is_row_vector      1x1                          1  logical

Total is 50 elements using 183 bytes

debug> qr
error: Invalid call to qr.  Correct usage is:

 -- Loadable Function: [Q, R, P] = qr (A)
 -- Loadable Function: [Q, R, P] = qr (A, '0')
 -- Loadable Function: [C, R] = qr (A, B)
 -- Loadable Function: [C, R] = qr (A, B, '0')

error: called from:
error:   /opt/octave3.8/share/octave/3.8.1/m/help/print_usage.m at line 85, column 5

Anton <ajf>
Thu 05 Jun 2014 01:13:24 PM UTC, comment #1: 

Thanks for your bug report. This looks like an error due to the qr function not being defined or being replaced by a variable somehow, which I am unable to reproduce.

Can you try the following:

dbstop polyfit 114
polyfit ([0 1 2], [0 1 4], 2)
type qr
whos
qr

What does Octave report back for each of those commands?

How did you install Octave, and on which distribution and version?

Mike Miller <mtmiller>
Project Administrator
Thu 05 Jun 2014 09:51:06 AM UTC, original submission:  

When calling polyfit with a value for n of larger than 0, e.g. polyfit([0 1 2],[0 1 4], 2), I get the following error:
error: qr: subscript indices must be either positive integers less than 2^63 or logicals
error: called from:
error:   /opt/octave3.8/share/octave/3.8.1/m/polynomial/polyfit.m at line 114, column 10

The error does not occur if I just want to estimate the constant term, e.g. polyfit([0 1 2],[0 1 4], 0), but for anything larger than 0 it produces the error.

Anton <ajf>

 

(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 jwe (Posted a comment)
  • -email is unavailable- added by mtmiller (Posted a comment)
  • -email is unavailable- added by ajf (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 6 latest changes.

    Date Changed by Updated Field Previous Value => Replaced by
    2014-06-09 mtmiller StatusNeed Info => Invalid
        Open/ClosedOpen => Closed
    2014-06-05 mtmiller CategoryOctave Function => Libraries
        Summarypolyfit function produces error => qr with permutation fails with --enable-64
    2014-06-05 mtmiller Item GroupNone => Incorrect Result
        StatusNone => Need Info

    Back to the top


    Powered by Savane 3.5