bugGNU Octave - Bugs: bug #42596, OpenGL toolkits for the GUI on...


bug #42596: OpenGL toolkits for the GUI on MacOS X

Submitted by:  Ben Abbott <bpabbott>
Submitted on:  Sun Jun 22 15:28:43 2014  
Category: Plotting with OpenGLSeverity: 4 - Important
Priority: 5 - NormalItem Group: Regression
Status: FixedAssigned to: None
Originator Name: Ben AbbottOpen/Closed: Closed
Release: devOperating System: Mac OS

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 Jun 9 16:34:23 2016, comment #15:

Yes. The FLTK toolkit does work, but if I use it octave crashes when I exit.

Ben Abbott <bpabbott>
Project Member
Thu Jun 9 13:04:31 2016, comment #14:

@Ben: does fltk toolkit also work now? If so then your hypothesis may be true because fltk runs in the interpreter thread, which is not the main thread.

Pantxo Diribarne <pantxo>
Project Member
Thu Jun 9 11:01:08 2016, comment #13:

Prior to Apple's switch to clang, the Carbon framework required that the gui thread be the main thread. At some point that changed. Perhaps Apple removed that requirement with clang?

Ben Abbott <bpabbott>
Project Member
Wed Jun 8 15:09:42 2016, comment #12:

I think what changed is that we used to use package managers and thus clang for compiling dependencies like Qt, while we used to use gcc to compile Octave itself. This worked until there was some dynamic_cast from Octave functions on Qt objects which crashed the whole GUI. I think I explained that somewhere but can't find it right now.

Pantxo Diribarne <pantxo>
Project Member
Wed Jun 8 11:07:00 2016, comment #11:

Yes, this should be closed (but I don' know what changed).

Ben Abbott <bpabbott>
Project Member
Wed Jun 8 07:09:08 2016, comment #10:

Can this be closed now? I assume there would have been more noise if it were still an issue.

Lachlan Andrew <lachlan>
Project Member
Mon Dec 8 22:56:10 2014, comment #9:

Yes, I didn't upgrade to Yosemite partly because of the unappealing messages on maintainers list :-).

Pantxo Diribarne <pantxo>
Project Member
Mon Dec 8 22:19:39 2014, comment #8:

I'm running Yosemite and am unable to build the default branch without encountering problems.

Ben Abbott <bpabbott>
Project Member
Mon Dec 8 22:14:39 2014, comment #7:

I am at 19386:f054112912df on default.
Can you confirm that saving a new file crashes Octave on default or is this specific to my build?


Pantxo Diribarne <pantxo>
Project Member
Mon Dec 8 20:25:44 2014, comment #6:


Are you building the default or stable branch?


Ben Abbott <bpabbott>
Project Member
Mon Dec 8 19:12:00 2014, comment #5:

Using os X 10.9 Mavericks with fink for dependencies.
AFAICS, the crash happens when a dynamic_cast is performed on a Qt object. E.g. if I replace dynamic_cast by static_cast in Figure.cc (Figure::eventNotifyAfter) I can run plot demos with the Qt toolkit and the gui.

That is no solution though. I see similar crashes for example if I create a new file (using the integrated editor) and try to save it: I obtain the attached crash log which shows that it is still in dynamic_cast operation that the crash happens.

I am wondering if the bug is related to mixed libc++/libstdc++ as in this thread [1].

As Qt4 is compiled with clang in fink, it is linked with system libc++ while octave is compiled using g++ (4.9 in my case) which links to its own libstdc++. I have no clue on how to proceed, but this may be worth investigating.

[1] http://qt-project.org/forums/viewthread/17150

Pantxo Diribarne <pantxo>
Project Member
Mon Jun 23 12:45:45 2014, comment #4:

No. The bug in this instance is that no OpenGL toolkits work for the GUI on MacOS X.

I'll change the summary to make it more clear.

From the gui, when the commands below are run, the gui exists with the error "octave exited with signal 1".

Ben Abbott <bpabbott>
Project Member
Mon Jun 23 12:26:34 2014, comment #3:

Then isn't this a duplicate of bug 40242? The "--no-gui" option leads to a Qt application as main thread: octave interpreter is run in a child thread and it is expected that fltk won't work.

Pantxo Diribarne <pantxo>
Project Member
Mon Jun 23 11:31:25 2014, comment #2:

ah-ha. I wasn't keeping up with the command line options and was using --no-gui instead of -cli.

Using "-cli" I also have a functional FLTK toolkit.

I'm changing the title, but leaving the severity (the OpenGL toolkits do not work with the gui)

Ben Abbott <bpabbott>
Project Member
Mon Jun 23 08:21:15 2014, comment #1:


Even though I have to patch the sources a bit (otherwise I obtain build failures) my mac build still has functional fltk in cli mode.

Here is my config.:

  • os x 10.9.3
  • fink is used for most dependencies (see octave_build.sh)
  • GraphicsMagick is self compiled (compile flags are commented in the build script)
  • I have to patch _init_fltk_.cc (blindly commented offending code, see x11_mac.patch) in order to be able to build octave, due to duplicate definitions when including x11 headers

Then "./run-octave -cli" leads me to have a functional command line octave with fltk working (at least "demo patch" works fine).
As for Qt toolkit, I never had it work on mac since it was introduced in octave source tree.

(file #31597, file #31598)

Pantxo Diribarne <pantxo>
Project Member
Sun Jun 22 15:28:43 2014, original submission:

The last default branch revision for which the cli had a functional FLTK toolkit was 55e376fd8636. Meaning "hg revert -a -r 55e376fd8636" followed by bootstraping, configure, and make produces a functional fltk toolkit on MacOS 10.9.

The next changeset to the default branch was a periodic merge of gui-release to default. However, I don't see anything suspicious in that changeset.


In any even, the problem maybe related to the bug #40242 (no GUI interaction outside the main thread on MacOS X).


When running the gui, both the qt and fltk toolkits crash when plotting. The programs exists with "octave exited with signal 11" reported to the terminal.

The crash logs for both fltk and qt are attached.

I'm marking this as a blocker because I think it qualifies.

Ben Abbott <bpabbott>
Project Member


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

Attach File(s):

Attached Files
file #31597:  octave_build.sh added by pantxo (2kB - application/x-sh)
file #31598:  x11_mac.patch added by pantxo (2kB - text/x-diff)
file #31594:  fltk-crash.log added by bpabbott (58kB - application/octet-stream - GUI crash logs for both the qt and fltk toolkits)
file #31595:  qt-crash.log added by bpabbott (54kB - application/octet-stream - GUI crash logs for both the qt and fltk toolkits)


Depends on the following items: None found

Items that depend on this one: None found


Carbon-Copy List
  • -unavailable- added by lachlan (Posted a comment)
  • -unavailable- added by pantxo (Updated the item)
  • -unavailable- added by bpabbott (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 10 latest changes.

    Date Changed By Updated Field Previous Value => Replaced By
    Thu Jun 9 15:08:19 2016rik5Carbon-CopyRemoved 72865=>-
    Wed Jun 8 11:07:00 2016bpabbottStatusNone=>Fixed
    Sat Apr 25 05:42:49 2015rik5Severity5 - Blocker=>4 - Important
    Mon Jun 23 12:45:45 2014bpabbottSummaryOpenGL toolkits cause seg-faults for the GUI on MacOS X=>OpenGL toolkits for the GUI on MacOS X
    Mon Jun 23 11:31:25 2014bpabbottSummaryOpenGL toolkits cause seg-faults on MacOS X=>OpenGL toolkits cause seg-faults for the GUI on MacOS X
    Mon Jun 23 08:21:15 2014pantxoAttached File-=>Added octave_build.sh, #31597
      Attached File-=>Added x11_mac.patch, #31598
    Sun Jun 22 15:28:43 2014bpabbottAttached File-=>Added fltk-crash.log, #31594
      Attached File-=>Added qt-crash.log, #31595

    Back to the top

    Powered by Savane 3.1-cleanup1