bugGNU Octave - Bugs: bug #40294, Logical indexing into sparse...

 
 

bug #40294: Logical indexing into sparse matrix hangs/segfaults

Submitted by:  David Spies <dspyz>
Submitted on:  Thu 17 Oct 2013 07:07:53 PM UTC  
 
Category: Octave FunctionSeverity: 3 - Normal
Priority: 5 - NormalItem Group: Segfault, Bus Error, etc.
Status: FixedAssigned to: None
Originator Name: dspiesOpen/Closed: Closed
Release: 3.2.4Operating System: GNU/Linux

Add a New Comment(Rich Markup)
   

You are not logged in

Please log in, so followups can be emailed to you.

 

Thu 17 Oct 2013 10:10:11 PM UTC, comment #5:

I don't know why Ubuntu decided to package such an ancient version. In any case, you can use this PPA to get the latest stable version which is 3.6 (https://launchpad.net/~octave/+archive/stable). It is maintained by Mike Miller who is a contributor to Octave. I tested your code and it works on 3.6.

Rik <rik5>
Project Administrator
Thu 17 Oct 2013 09:14:00 PM UTC, comment #4:

Rik,

You're right this is a case of "logical indexing" rather than "sparse logical indexing" and the bug should probably be closed

D.

David Bateman <dbateman>
Project Member
Thu 17 Oct 2013 09:05:11 PM UTC, comment #3:

Thanks Rik,

Unfortunately I'm stuck with this version because it's the one that's compatible with https://kenai.com/projects/javaoctave/pages/Home
I tried using it with the dev version and just got syntax errors and segfaults everywhere.

If you know of another more current tool with the same functionality, I'd love to switch to it.

Also, 3.2.4 is the version of Octave available from aptitude on Ubuntu 12.04.

Thanks,
David

David Spies <dspyz>
Thu 17 Oct 2013 08:49:27 PM UTC, comment #2:

I note that you are using version 3.2.4 which is ancient and deprecated. I tried your problem on the soon-to-be-released 3.8 code and it returns instantly without problem.

Of course, if you try

Octave segfaults which is definitely bad. It should just issue a warning message.

Rik <rik5>
Project Administrator
Thu 17 Oct 2013 07:41:48 PM UTC, comment #1:

This is known problem and is documented on the Projects page since 2006. See

http://wiki.octave.org/Projects#Sparse_Matrices

where it says

At the moment the sparse logical indexing is converted in full matrix indexing and in your case you're are probably swapping madly rather than getting a memory overflow.

Its not that easy to implement and its always seemed that the amount of work to implemen it was always more than it was worth since as you've found there always seems to be a manner to work around it.

I'd suggest leaving this bug open, but giving it a low priority

D.

David Bateman <dbateman>
Project Member
Thu 17 Oct 2013 07:07:53 PM UTC, original submission:

After:

m = sparse(100000,100000);
v = logical(sprand(100000,1,0.3));

The operation:

m(v,:) = 0;

hangs (the same happens when 0 is replaced with a sparse matrix of the appropriate size).

However

m -= diag(v) * m

works just fine

David Spies <dspyz>

 

(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

Items that depend on this one: None found

 

Carbon-Copy List
  • -unavailable- added by rik5 (Posted a comment)
  • -unavailable- added by dbateman (Posted a comment)
  • -unavailable- added by dspyz (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 4 latest changes.

    Date Changed By Updated Field Previous Value => Replaced By
    Thu 17 Oct 2013 10:10:11 PM UTCrik5StatusNone=>Fixed
      Open/ClosedOpen=>Closed
    Thu 17 Oct 2013 08:49:27 PM UTCrik5Item GroupPerformance=>Segfault, Bus Error, etc.
      SummaryLogical indexing into sparse matrix hangs=>Logical indexing into sparse matrix hangs/segfaults

    Back to the top


    Powered by Savane 3.1-cleanup1