bugGNU Octave - Bugs: bug #37095, Segfault when calling chol () on...

 
 

bug #37095: Segfault when calling chol () on non-SPD sparse matrix and requesting a second output argument

Submitted by:  Guillaume <gyom>
Submitted on:  Tue Aug 14 15:44:54 2012  
 
Category: NoneSeverity: 3 - Normal
Priority: 5 - NormalItem Group: Crash
Status: FixedAssigned to: Jordi Gutiérrez Hermoso <jordigh>
Originator Name: GuillaumeOpen/Closed: Closed
Release: devOperating System: Any

Add a New Comment (Rich MarkupRich 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)

Thu Aug 16 15:46:00 2012, comment #7:

Okay, I pushed the fix:

http://hg.savannah.gnu.org/hgweb/octave/rev/82d51d6e470c

It's on the default branch, because it seems to be a relatively rare edge case and I wasn't confident enough to apply it to the stable branch. So it will see the light of day by Octave 3.8.

Jordi Gutiérrez Hermoso <jordigh>
Project AdministratorIn charge of this item.
Wed Aug 15 15:21:29 2012, comment #6:

Works fine, thanks!

Guillaume <gyom>
Wed Aug 15 14:26:43 2012, comment #5:

Okay, how about the revised patch?

(file #26362)

Jordi Gutiérrez Hermoso <jordigh>
Project AdministratorIn charge of this item.
Wed Aug 15 12:09:59 2012, comment #4:

Many thanks for looking into this, Jordi.

The patch seems to work for me (ie no segfault and the second output argument prevents an error to be triggered) but there are still warning messages that are displayed:

They are redundant with the information given by the second output argument so they could be removed (MATLAB does not display any).

Guillaume <gyom>
Tue Aug 14 19:58:52 2012, comment #3:

Okay, so the issue is that the Octave code stops computation prematurely if the cholmod library flags the matrix as not positive definite, and as part of those computations it's supposed to set the Lsparse pointer to a nonzero value. When it doesn't do that but the return values are requested anyways, it attempts to dereference a null pointer and segfaults.

My patch attached here is an attempt to test if more than output argument is requested, and to plod along even if the matrix fails to be positive definite and return whatever value cholmod thought should be returned.

If there are no complaints with this patch for a few days, I'll push it.

(file #26361)

Jordi Gutiérrez Hermoso <jordigh>
Project AdministratorIn charge of this item.
Tue Aug 14 16:27:10 2012, comment #2:

This seems like an easy fix, working on it...

Jordi Gutiérrez Hermoso <jordigh>
Project AdministratorIn charge of this item.
Tue Aug 14 16:25:26 2012, comment #1:

Hi I can confirm the bug on a recent build,
I changed the title to specify that the crash occurs
only if the input matrix is sparse.

Thanks for the report,
c.

Carlo de Falco <cdf>
Project Member
Tue Aug 14 15:44:54 2012, original submission:

Calling CHOL on a non positive definite sparse matrix and two output arguments generates a segmentation fault:

Guillaume <gyom>

 

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

Attach File(s):
   
   
Comment:
   

Attached Files
file #26362:  cholmod.patch added by jordigh (5kB - text/x-diff)
file #26361:  cholmod.patch added by jordigh (4kB - text/x-diff)

 

Depends on the following items: None found

Items that depend on this one: None found

 

Carbon-Copy List
  • -unavailable- added by jordigh (Posted a comment)
  • -unavailable- added by cdf (Posted a comment)
  • -unavailable- added by gyom (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 8 latest changes.

    Date Changed By Updated Field Previous Value => Replaced By
    Thu Aug 16 15:46:00 2012jordighStatusPatch Submitted=>Fixed
      Open/ClosedOpen=>Closed
    Wed Aug 15 14:26:43 2012jordighAttached File-=>Added cholmod.patch, #26362
    Tue Aug 14 19:58:52 2012jordighAttached File-=>Added cholmod.patch, #26361
      StatusConfirmed=>Patch Submitted
    Tue Aug 14 16:27:10 2012jordighAssigned toNone=>jordigh
    Tue Aug 14 16:25:26 2012cdfStatusNone=>Confirmed
      SummarySegfault with CHOL and a second output argument=>Segfault when calling chol () on non-SPD sparse matrix and requesting a second output argument

    Back to the top


    Powered by Savane 3.1-cleanup