bugGNU Octave - Bugs: bug #47543, segfault with warnings disabled in...


bug #47543: segfault with warnings disabled in subfunction when all warnings disabled globally

Submitter:  Orion Poplawski <opoplawski>
Submitted:  Sat 26 Mar 2016 05:00:37 PM UTC
Category:  Interpreter Severity:  4 - Important
Priority:  7 - High Item Group:  Regression
Status:  Fixed Assigned to:  None
Originator Name:  Open/Closed:  * Closed
Release:  * 4.0.1 Operating System:  * GNU/Linux
Fixed Release:  None Planned Release:  None
* Mandatory Fields

Add a New Comment Rich Markup

Jump to the original submission

Fri 15 Jul 2016 10:33:08 PM UTC, comment #9: 

Verified this fix.  Closing report.

Rik <rik5>
Group administrator
Fri 15 Jul 2016 07:41:26 PM UTC, comment #8: 

Um, yeah.

It's funny that #47387 is also an Octave bug, not something totally different.  But then again, I think we dominate the bug tracker activity on savannah...

John W. Eaton <jwe>
Group administrator
Fri 15 Jul 2016 06:52:17 PM UTC, comment #7: 

You mean bug #47837 right? :)

Mike Miller <mtmiller>
Group Member
Fri 15 Jul 2016 05:22:06 PM UTC, comment #6: 

Lachlan: I pushed your changset:


Can this bug be closed now?  What about bug #47387?

John W. Eaton <jwe>
Group administrator
Wed 08 Jun 2016 07:11:34 AM UTC, comment #5: 


Does anyone have any comments on this patch?

I'm happy either to fix it in response to comments, or to have http://hg.savannah.gnu.org/hgweb/octave/rev/6ed7bae8017b backed out completely.  Either way, I think we should fix the segfaults ASAP.

Lachlan Andrew <lachlan>
Sun 27 Mar 2016 04:07:29 AM UTC, comment #4: 

The attached patch should fix the problem.  Thanks for the simple test case, Mike.  I also plan to write a BIST for this, but want feedback first.

The code now does what I intended, but that is still not really the right thing.  Issuing "warning <state> all" only changes the default state, so that it doesn't disturb the "language-extension" warning.

This doesn't really affect Matlab compatibility, since the warning IDs are all different and no command can be used on both platforms.  That means that the team leaders can decide if "warning <state> all" should assign that state to all warnings, or just to those not explicitly specified.

My personal choice would be to provide a mechanism to turn "language-extension" off for core+forge functions, as was discussed at bug #36743, particularly jwe's comment 9 https://savannah.gnu.org/bugs/?func=detailitem&item_id=36743#comment9.  (Please overlook my intemperance in some comments in that discussion...)

I'd like to overhaul errors and warnings to give more flexibility than just "on" and "off", but first I need to learn to stop submitting bugs :)

(file #36776)

Lachlan Andrew <lachlan>
Sat 26 Mar 2016 06:34:03 PM UTC, comment #3: 

Bisecting confirms that the cause of this regression is the following change, made to fix bug #45753:


CC'ing Lachlan who worked on the patch for this other bug.

Mike Miller <mtmiller>
Group Member
Sat 26 Mar 2016 05:38:04 PM UTC, comment #2: 

And confirmed that this crash was not present in 4.0.0 but is present in 4.0.1. Beginning bisect.

Mike Miller <mtmiller>
Group Member
Sat 26 Mar 2016 05:20:03 PM UTC, comment #1: 

Thanks for reporting. I was looking at this at the same time, I've created a minimal test case to show that it has to do with the test environment and something to do with the way warnings are disabled and restored. Retitling to be more accurate and has nothing to do with the image package specifically.

Using the attached myfunc.m,

>> warning off all
>> test myfunc
warning: missing semicolon near line 2, column 1 in file ''
panic: impossible state reached in file '../../libinterp/corefcn/error.cc' at line 1470
panic: Aborted -- stopping myself...
attempting to save variables to 'octave-workspace'...
save to 'octave-workspace' complete

There have to be at least two test runs after warnings are turned off. The first test seems to enable all warnings, perhaps as it's trying to restore the warning state before test was called. The second test causes the segfault. It has to be a subfunction that disables warnings locally.

(file #36770)

Mike Miller <mtmiller>
Group Member
Sat 26 Mar 2016 05:00:37 PM UTC, original submission:  

>> pkg load image
>> warning off all
>> test graythresh

panic: impossible state reached in file '../../libinterp/corefcn/error.cc' at line 1470
panic: Aborted -- stopping myself...

Orion Poplawski <opoplawski>


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

Attach Files:

Attached Files
file #36770:  myfunc.m added by mtmiller (190B - text/x-objcsrc)


Depends on the following items: None found

   bug dependencies.


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

    There are 0 votes so far. Votes easily highlight which items people would like to see resolved in priority, independently of the priority of the item set by tracker managers.

    Only group members can vote.


    Follow 15 latest changes.

    Date Changed by Updated Field Previous Value => Replaced by
    2016-07-15 rik5 StatusReady For Test Fixed
        Open/ClosedOpen Closed
    2016-07-15 jwe StatusPatch Submitted Ready For Test
    2016-06-27 lachlan StatusIn Progress Patch Submitted
    2016-05-04 rik5 Dependencies- bugs #47837 is dependent
    2016-03-27 lachlan StatusPatch Submitted In Progress
    2016-03-27 lachlan Attached File- Added bug_47543_warning_all.cset, #36776
        StatusConfirmed Patch Submitted
    2016-03-26 mtmiller Priority5 - Normal 7 - High
        Carbon-Copy- Added lachlan
    2016-03-26 mtmiller Severity3 - Normal 4 - Important
        Item GroupSegfault, Bus Error, etc. Regression
    2016-03-26 mtmiller Attached File- Added myfunc.m, #36770
        StatusNone Confirmed
        SummaryCrash in image graythresh with warnings disabled segfault with warnings disabled in subfunction when all warnings disabled globally

    Back to the top

    Powered by Savane 3.13-ee12.
    Corresponding source code