bugGNU Octave - Bugs: bug #53991, Octave crashes using fsolve when...


bug #53991: Octave crashes using fsolve when x0 is a stationary point

Submitted by:  None
Submitted on:  Sun 27 May 2018 11:23:35 AM UTC  
Category:  Octave Function Severity:  3 - Normal
Priority:  5 - Normal Item Group:  Unexpected Error
Status:  Confirmed Assigned to:  None
Originator Name:  Stefano Toro Originator Email:  -email is unavailable-
Open/Closed:  Open Release:  4.4.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.


Wed 13 Jun 2018 07:14:27 PM UTC, comment #4:

I think there are two separate bug reports here. The first is that calling balance can lead to a segfault on Windows platforms.

Using the test code from comment #1 on a Linux machine I get

The segfault is probably back to the inability to overide the XERBLA handler on Windows (bug #39000). The question is how far we want to keep patching things. It seems like possibly every routine which ever interacts with the BLAS or LAPACK library would potentially need to look for NaN values before continuing. At the very least, it would seem that this should be restricted to Windows platforms which would require putting in #ifdef tests.

The second bug report is about fsolve not returning a correct error code when it encounters a stationary point. This should be fixed, and it shouldn't be that difficult.

Rik <rik5>
Project Administrator
Mon 28 May 2018 08:55:06 AM UTC, comment #3:

I think the problem is in the algorithm itself. Matlab returns with the exit flag -2 which means

This happens when the Jacobian fjac has a small norm (0, in this report) but the solution fvec is far from 0. This can be detected before calling _dogleg_ at line 307.

Marco Caliari <caliari>
Project Member
Sun 27 May 2018 08:51:29 PM UTC, comment #2:

The problem is in the call to DGEBAL in liboctave/numeric/aepbalance.cc

Avinoam Kalma <avinoam>
Project Member
Sun 27 May 2018 08:38:49 PM UTC, comment #1:

The line that cause the crash is

The bug seems to be related to bug #39000

Avinoam Kalma <avinoam>
Project Member
Sun 27 May 2018 11:23:35 AM UTC, original submission:

Trying to solve equation det (B(lam)) = 0 for lam, if starting point lam0 = 0, Octave crashes without error or warning.
If lam0 = 0.1, solution found correctly.

Here the script, with a plot of B vs. lam:



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

Attach Files:

Attached Files
file #44228:  detB_vs_lam.pdf added by None (188KiB - application/pdf)
file #44227:  B_vs_lam.ps added by None (185KiB - application/postscript)


Depends on the following items: None found

Items that depend on this one: None found


Carbon-Copy List
  • -email is unavailable- added by rik5 (Posted a comment)
  • -email is unavailable- added by caliari (Posted a comment)
  • -email is unavailable- added by avinoam (Posted a comment)
  • -email is unavailable- added by None (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 3 latest changes.

    Date Changed by Updated Field Previous Value => Replaced by
    2018-05-27 avinoam StatusNone => Confirmed
    2018-05-27 None Attached File- => Added detB_vs_lam.pdf, #44228
    2018-05-27 None Attached File- => Added B_vs_lam.ps, #44227

    Back to the top

    Powered by Savane 3.3