bugGNU Octave - Bugs: bug #50880, octave-gui segfault after...

 
 

bug #50880: octave-gui segfault after completion of welcome wizard initialization

Submitted by:  Mike Miller <mtmiller>
Submitted on:  Tue 25 Apr 2017 09:17:34 PM UTC  
 
Category: GUISeverity: 4 - Important
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)

Tue 02 May 2017 09:51:14 PM UTC, comment #14:

Verified the fix works for this bug and #50396. Closing reports.

Rik <rik5>
Project Administrator
Tue 02 May 2017 09:26:56 PM UTC, comment #13:

I pushed this changeset:

http://hg.savannah.gnu.org/hgweb/octave/rev/b605146ed2ed

Does it fix the problem for you? The change is to initialize the global variables in the application object instead of the interpreter object. That way, Voct_etc_dir is available for the GUI resource manager initialization.

There are about 50 global variables like Voct_etc_dir. Many are given default values by the call to install_defaults. Eventually, I'd like to move variables like this to be members of the application or interpreter object, whichever is more appropriate for each of them.

John W. Eaton <jwe>
Project Administrator
Thu 27 Apr 2017 04:52:48 PM UTC, comment #12:

Yeah that makes sense.

I managed to bisect this specific error to one of the following two related changes (the first one doesn't compile for me):

https://hg.savannah.gnu.org/hgweb/octave/rev/af48d8be62b3
https://hg.savannah.gnu.org/hgweb/octave/rev/252975fdc444

The second of these changesets moved the call to install_defaults from octave::application::init() octave::interpreter::interpreter(). So it occurs later in the startup sequence now, after the application object has been initialized but before the interpreter is started. Meanwhile the GUI application is setting itself up and accessing some of these global parameters that haven't been initialized yet.

Mike Miller <mtmiller>
Project Administrator
Thu 27 Apr 2017 03:31:36 PM UTC, comment #11:

This could be because of a race issue between the GUI thread and the Octave interpreter thread. The interpreter has not yet initialized Voct_etc_dir before the GUI requests it.

See bug #50396 where a similar situation prevents the documentation from being loaded in the GUI.

Rik <rik5>
Project Administrator
Thu 27 Apr 2017 03:25:57 PM UTC, comment #10:

What I have found so far is, that the resource_manager seems not be able to create the settings file because

default_qt_settings_file (void)

returns "/default-qt-settings", i.e. the variable Voct_etc_dir is empty.

Torsten <ttl>
Project Member
Thu 27 Apr 2017 03:03:25 PM UTC, comment #9:

Thanks Rik, I can confirm the crash when the environment variable is not set. I'm going to give bisecting another shot with a modified run-octave script.

Mike Miller <mtmiller>
Project Administrator
Wed 26 Apr 2017 05:57:40 PM UTC, comment #8:

It's different from the build tree because the run-octave script establishes a fallback in case the file qt-settings does not exist. In run-octave,

If I comment this out, and run from the build tree, then I get a segfault.

Rik <rik5>
Project Administrator
Wed 26 Apr 2017 05:45:04 PM UTC, comment #7:

Why is it different if you run it from build tree or from installed location?

Dmitri.
--

Dmitri A. Sergatskov <dasergatskov>
Wed 26 Apr 2017 05:31:28 PM UTC, comment #6:

Confirmed for me as well with an installed version of the development branch. I changed my HOME variable to point to somewhere innocuous and I get the segfault as soon as the welcome wizard finishes.

This might be related to threading. Currently any code in the GUI which calls error() leads to an unhandled exception which then goes to std::terminate. There is already a bug report about that.

Rik <rik5>
Project Administrator
Wed 26 Apr 2017 04:49:40 PM UTC, comment #5:

Sure it's possible. I know why bug #50396 occurs only when Octave is installed and not in the build tree, but I don't know why this one would behave that way. Besides I was seeing it in my build directory originally, but after deleting and building again that was not reproducible.

I now only see this when running the installed octave binary, not using run-octave. Adding all of the command-line arguments that run-octave inserts does not change anything.

I can try to bisect but that might take a long time, can't devote time to that for now.

Mike Miller <mtmiller>
Project Administrator
Wed 26 Apr 2017 09:14:26 AM UTC, comment #4:

could this be related to https://savannah.gnu.org/bugs/?50396

Both reports are linked to starting the GUI and only occur on the installed version.

A.R. Burgers <arb>
Wed 26 Apr 2017 01:37:46 AM UTC, comment #3:

Same. I started bisecting but that makes it a lot more tedious.

Mike Miller <mtmiller>
Project Administrator
Tue 25 Apr 2017 11:44:42 PM UTC, comment #2:

I cannot reproduce the error if I run ./run-octave from
the build tree, but I can reproduce it if I install it proper
(to /usr/local ) and run then...

Dmitri.
--

Dmitri A. Sergatskov <dasergatskov>
Tue 25 Apr 2017 10:13:11 PM UTC, comment #1:

I just run 1fadf480a63b
and it was fine.
Cannot reproduce the problem (Fedora 25 Qt 5.7.1)

Dmitri.
--

Dmitri A. Sergatskov <dasergatskov>
Tue 25 Apr 2017 09:17:34 PM UTC, original submission:

Octave's GUI crashes immediately after completion of the welcome wizard dialog. This is 100% reproducible for me on the default branch. The released 4.2.1 and the stable branch do not have this problem.

To reproduce this you will need to move or delete the ~/.config/octave directory, run Octave as a different user, or with a different temporary HOME directory.

Creating an empty file ~/.config/octave/qt-settings is enough to bypass the welcome wizard and avoid this error. I have built Octave with both Qt 4 and 5 and both exhibit the same behavior.

Stack trace:

I don't mind debugging if someone more familiar with GUI startup can help point me in the right direction.

Mike Miller <mtmiller>
Project Administrator

 

(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 jwe (Posted a comment)
  • -unavailable- added by ttl (Posted a comment)
  • -unavailable- added by rik5 (Posted a comment)
  • -unavailable- added by arb (Posted a comment)
  • -unavailable- added by dasergatskov (Posted a comment)
  • -unavailable- added by mtmiller (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
    Tue 02 May 2017 09:51:14 PM UTCrik5StatusReady For Test=>Fixed
      Open/ClosedOpen=>Closed
    Tue 02 May 2017 09:26:56 PM UTCjweStatusConfirmed=>Ready For Test
    Wed 26 Apr 2017 04:49:46 PM UTCmtmillerStatusNone=>Confirmed

    Back to the top


    Powered by Savane 3.1-cleanup1