bugGNU Octave - Bugs: bug #52567, invoking octave with conflicting...

 
 

bug #52567: invoking octave with conflicting arguments dumps core

Submitted by:  Dmitri A. Sergatskov <dasergatskov>
Submitted on:  Fri 01 Dec 2017 01:28:22 AM UTC  
 
Category: InterpreterSeverity: 3 - Normal
Priority: 5 - NormalItem Group: Segfault, Bus Error, etc.
Status: FixedAssigned to: None
Originator Name: Open/Closed: Closed
Release: devOperating 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 Jump to the original submission)

Fri 01 Dec 2017 07:25:57 PM UTC, comment #6:

I pushed the final changeset, which changes all calls to warning() in octave.cc with direct printing of the message to std::cerr, here: http://hg.savannah.gnu.org/hgweb/octave/rev/cac0f8a1c696.

Marking as fixed and closing report.

Rik <rik5>
Project Administrator
Fri 01 Dec 2017 06:42:30 AM UTC, comment #5:

OK, I found the function in the code (error.cc).

Those remaining two uses of warning will surely fail if the two others fail. They are called immediately at the start of main.

Out of curiosity, I looked at the warning() routine. It's pretty standard code, using variable argument list routines, up until calling this routine:

From about

onward the code becomes dodgy as to whether stack, protect, current frame and do_keyboard are using things all properly initialized by this point.

Dan Sebald <sebald>
Fri 01 Dec 2017 05:52:15 AM UTC, comment #4:

I'm pretty sure warning() is referencing the Octave interpreter function, which is a problem at this stage since the interpreter, exception handling routines, etc. are not installed yet.

We should probably print an additional prefix like "error:". I've attached a second cset that does that.

There are two remaining instances of warning in octave.cc. They seem to be associated with creating an embedded interpreter. They should also be tested to see if there is a problem. There is an example in Appendix A, and some sample code in examples/code that could probably be used to create a test bed.

(file #42542)

Rik <rik5>
Project Administrator
Fri 01 Dec 2017 05:32:48 AM UTC, comment #3:

Works here. Do you want some type of warning/error prompt before the message? E.g.:

What is "warning()" function? A gnulib command? Or is it somehow accessing the equivalent of Octave interpreter function "warning"? If the latter, is the use of "warning()" in the early stages of launch a problem?

Dan Sebald <sebald>
Fri 01 Dec 2017 05:14:42 AM UTC, comment #2:

The interpreter should never segfault, even for erroneous input.

I have some guesses as to why this is happening, but the simplest thing to do is probably to print the message directly to stderr rather than going through warning().

And looking through octave.cc, this is not the only place where warning() is used. I tried combining --eval CODE with specifying an m-file to run and got a slightly different core dump.
)

Try the attached patch 52567.cset. It works for me.

(file #42541)

Rik <rik5>
Project Administrator
Fri 01 Dec 2017 02:23:15 AM UTC, comment #1:

Confirmed. If I comment out the warning() call:

I see the usage message and no abort signal:

Dan Sebald <sebald>
Fri 01 Dec 2017 01:28:22 AM UTC, original submission:

./run-octave --no-gui --force-gui
warning: only one of --force-gui and --no-gui may be used
Aborted (core dumped)

(this was a result of a typo "./run-octave --f --no-gui")

Probably a low priority...

Dmitri.

Dmitri A. Sergatskov <dasergatskov>

 

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

Attach File(s):
   
   
Comment:
   

Attached Files
file #42542:  52567.v2.cset added by rik5 (1KiB - application/octet-stream)
file #42541:  52567.cset added by rik5 (1KiB - application/octet-stream)

 

Depends on the following items: None found

Items that depend on this one: None found

 

Carbon-Copy List
  • -unavailable- added by rik5 (Updated the item)
  • -unavailable- added by sebald (Posted a comment)
  • -unavailable- added by dasergatskov (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 6 latest changes.

    Date Changed By Updated Field Previous Value => Replaced By
    Fri 01 Dec 2017 07:25:57 PM UTCrik5StatusPatch Submitted=>Fixed
      Open/ClosedOpen=>Closed
    Fri 01 Dec 2017 05:52:15 AM UTCrik5Attached File-=>Added 52567.v2.cset, #42542
    Fri 01 Dec 2017 05:14:42 AM UTCrik5Attached File-=>Added 52567.cset, #42541
      CategoryNone=>Interpreter
      StatusNone=>Patch Submitted

    Back to the top


    Powered by Savane 3.1-cleanup1