bugGNU Octave - Bugs: bug #48482, Crash after plot interaction

 
 

bug #48482: Crash after plot interaction

Submitter:  Roman Kolbert <kurtkroemer>
Submitted:  Tue 12 Jul 2016 11:23:54 AM UTC
   
 
Category:  Plotting with OpenGL Severity:  3 - Normal
Priority:  5 - Normal Item Group:  Segfault, Bus Error, etc.
Status:  Wont Fix Assigned to:  None
Originator Name:  Open/Closed:  * Closed
Release:  * 4.0.3 Operating System:  * GNU/Linux
Fixed Release:  None Planned Release:  None
* Mandatory Fields

Add a New Comment Rich Markup
   

Jump to the original submission

Sun 19 Feb 2017 08:57:42 PM UTC, comment #16: 

I can confirm that on Ubuntu Xenial (16.04) upgrading to the latest stable Mesa as per http://www.omgubuntu.co.uk/2016/12/stable-mesa-drivers-ubuntu-ppa (ppa:paulo-miguel-dias/pkppa) the crash is resolved.


Neilen Marais <nmarais>
Fri 15 Jul 2016 04:02:36 PM UTC, comment #15: 

There is another bug report open already about a function to print and test opengl-related things, and an option to run Octave in a software-rendering only mode, so that would cover this problem. Closing this bug as won't fix since it's a problem in the mesa driver.

Mike Miller <mtmiller>
Group Member
Thu 14 Jul 2016 06:27:50 PM UTC, comment #14: 

I tried to run octave with LIBGL_ALWAYS_SOFTWARE=1 and it works! So it was the i965 driver. Thank you guys a lot. Neither 4.0.0 nor 4.0.3. has crashed so far.


Roman Kolbert <kurtkroemer>
Wed 13 Jul 2016 11:33:28 PM UTC, comment #13: 

I have been thinking of having something in the signal handler that takes a stack trace and tries to respond accordingly.

Suitable responses could include
1. Report "this looks like bug #xxxxx.  A work-around is XYZ"
2. Print "An internal error has occurred.  Please save your session and then restart", followed by throwing an exception to be caught in toplev.cc.  This is what Matlab does.  (Yes, I managed to get Matlab to crash :)

That would add to the maintenance burden, but would greatly reduce the user impact of crashes due to things outside our control.

Lachlan Andrew <lachlan>
Wed 13 Jul 2016 09:42:23 PM UTC, comment #12: 

Just in case this helps: I had crashes on Skylake architecture and Fedora 24, which was fixed by OS updates.

It always crashed if I clicked or otherwise interact with a figure.  I would either get a silent segfault or sometimes:

>> Mesa 11.2.2 implementation error: invalid target in _swrast_choose_texture_sample_func
Please report at https://bugs.freedesktop.org/enter_bug.cgi?product=Mesa
Mesa 11.2.2 implementation error: invalid target in _swrast_choose_texture_sample_func
Please report at https://bugs.freedesktop.org/enter_bug.cgi?product=Mesa
panic: Segmentation fault -- stopping myself...
attempting to save variables to 'octave-workspace'...
save to 'octave-workspace' complete
Segmentation fault (core dumped)


I updated my OS (new kernel and probably more importantly Mesa 12) and now I don't get the crash.

Colin Macdonald <cbm>
Wed 13 Jul 2016 04:33:29 PM UTC, comment #11: 

The top of the stack is in the i965 mesa driver, so maybe that is where the error is occurring. Do you have another system with a different video card you can compare against?

If not, can you try with software rendering, either


$ export LIBGL_ALWAYS_SOFTWARE=1
$ octave


or


$ LIBGL_ALWAYS_SOFTWARE=1 octave


and see if that prevents the crash from occurring for you? This should force mesa to use the "swrast" driver instead of the i965 driver.

Mike Miller <mtmiller>
Group Member
Wed 13 Jul 2016 12:24:20 PM UTC, comment #10: 

But I installed Octave right after Ubuntu. How hard is it to compile and link to libqt5? Any chance that would help?

Roman Kolbert <kurtkroemer>
Wed 13 Jul 2016 11:51:09 AM UTC, comment #9: 

Hmmm...  Beats me.

I can't see anything in opengl_renderer::set_linestyle that could cause a problem.  I'd guess that the state of the OpenGL system was corrupted previously.

Lachlan Andrew <lachlan>
Wed 13 Jul 2016 11:03:02 AM UTC, comment #8: 

Yes the patch doesn't seem to help, but thanks for trying! Here is some gdb output of the segfault:

#159 0x00007fffac7cc7bb in ?? () from /usr/lib/x86_64-linux-gnu/dri/i965_dri.so
#160 0x00007ffff6e9bd18 in opengl_renderer::set_linestyle (this=0x7fffffffad00, s="-", use_stipple=false) at /home/roman/octave-4.0.3/libinterp/corefcn/gl-render.cc:2947
#161 0x00007ffff6e8fddf in opengl_renderer::draw_axes (this=0x7fffffffad00, props=...) at /home/roman/octave-4.0.3/libinterp/corefcn/gl-render.cc:1483
#162 0x00007ffff6e8940b in opengl_renderer::draw (this=0x7fffffffad00, go=..., toplevel=true) at /home/roman/octave-4.0.3/libinterp/corefcn/gl-render.cc:577
#163 0x00007ffff7ac5f24 in opengl_selector::draw (this=0x7fffffffad00, go=..., toplevel=true) at /home/roman/octave-4.0.3/libgui/graphics/gl-select.cc:140
#164 0x00007ffff7ac5bb9 in opengl_selector::select (this=0x7fffffffad00, ax=..., x=202, y=336, flags=0) at /home/roman/octave-4.0.3/libgui/graphics/gl-select.cc:79
#165 0x00007ffff7aac6da in QtHandles::GLCanvas::selectFromAxes (this=0x9875b0, ax=..., pt=...) at /home/roman/octave-4.0.3/libgui/graphics/GLCanvas.cc:99
#166 0x00007ffff7a9adbf in QtHandles::Canvas::canvasMousePressEvent (this=0x9875d8, event=0x7fffffffba00) at /home/roman/octave-4.0.3/libgui/graphics/Canvas.cc:545
#167 0x00007ffff7aac933 in QtHandles::GLCanvas::mousePressEvent (this=0x9875b0, xevent=0x7fffffffba00) at /home/roman/octave-4.0.3/libgui/graphics/GLCanvas.cc:166
#168 0x00007ffff31b7490 in QWidget::event(QEvent*) () from /usr/lib/x86_64-linux-gnu/libQtGui.so.4
#169 0x00007ffff3cc5761 in QGLWidget::event(QEvent*) () from /usr/lib/x86_64-linux-gnu/libQtOpenGL.so.4
#170 0x00007ffff315ffdc in QApplicationPrivate::notify_helper(QObject*, QEvent*) () from /usr/lib/x86_64-linux-gnu/libQtGui.so.4
#171 0x00007ffff31670d6 in QApplication::notify(QObject*, QEvent*) () from /usr/lib/x86_64-linux-gnu/libQtGui.so.4
#172 0x00007ffff2c3290d in QCoreApplication::notifyInternal(QObject*, QEvent*) () from /usr/lib/x86_64-linux-gnu/libQtCore.so.4
#173 0x00007ffff31666dd in QApplicationPrivate::sendMouseEvent(QWidget*, QMouseEvent*, QWidget*, QWidget*, QWidget**, QPointer<QWidget>&, bool) () from /usr/lib/x86_64-linux-gnu/libQtGui.so.4
#174 0x00007ffff31e43f2 in ?? () from /usr/lib/x86_64-linux-gnu/libQtGui.so.4
#175 0x00007ffff31e3c83 in QApplication::x11ProcessEvent(_XEvent*) () from /usr/lib/x86_64-linux-gnu/libQtGui.so.4
#176 0x00007ffff320d542 in ?? () from /usr/lib/x86_64-linux-gnu/libQtGui.so.4
#177 0x00007fffed2b01a7 in g_main_context_dispatch () from /lib/x86_64-linux-gnu/libglib-2.0.so.0
#178 0x00007fffed2b0400 in ?? () from /lib/x86_64-linux-gnu/libglib-2.0.so.0
#179 0x00007fffed2b04ac in g_main_context_iteration () from /lib/x86_64-linux-gnu/libglib-2.0.so.0
#180 0x00007ffff2c632ae in QEventDispatcherGlib::processEvents(QFlags<QEventLoop::ProcessEventsFlag>) () from /usr/lib/x86_64-linux-gnu/libQtCore.so.4
#181 0x00007ffff320d616 in ?? () from /usr/lib/x86_64-linux-gnu/libQtGui.so.4
#182 0x00007ffff2c3118f in QEventLoop::processEvents(QFlags<QEventLoop::ProcessEventsFlag>) () from /usr/lib/x86_64-linux-gnu/libQtCore.so.4
---Type <return> to continue, or q <return> to quit---
#183 0x00007ffff2c314f5 in QEventLoop::exec(QFlags<QEventLoop::ProcessEventsFlag>) () from /usr/lib/x86_64-linux-gnu/libQtCore.so.4
#184 0x00007ffff2c374b9 in QCoreApplication::exec() () from /usr/lib/x86_64-linux-gnu/libQtCore.so.4
#185 0x00007ffff7a20189 in octave_start_gui (argc=9, argv=0x7fffffffc6f8, start_gui=false) at /home/roman/octave-4.0.3/libgui/src/octave-gui.cc:210
#186 0x00000000004021d2 in main (argc=9, argv=0x7fffffffc6f8) at /home/roman/octave-4.0.3/src/main-gui.cc:43
(gdb) frame 185
#185 0x00007ffff7a20189 in octave_start_gui (argc=9, argv=0x7fffffffc6f8, start_gui=false) at /home/roman/octave-4.0.3/libgui/src/octave-gui.cc:210
210           retval = application.exec ();
(gdb) frame 186
#186 0x00000000004021d2 in main (argc=9, argv=0x7fffffffc6f8) at /home/roman/octave-4.0.3/src/main-gui.cc:43
43   return octave_start_gui (argc, argv, start_gui);

I don't know what else to check. All the other stack frames are the same as #159.

Roman Kolbert <kurtkroemer>
Wed 13 Jul 2016 10:06:12 AM UTC, comment #7: 

Thanks for trying, Roman.  If there was no error message, then the patch I mentioned is unlikely to help.

Lachlan Andrew <lachlan>
Wed 13 Jul 2016 08:40:25 AM UTC, comment #6: 

When I try with --no-gui I get a segmentation fault:

>> plot(1:10)
>> plot(1:10)
>> panic: Segmentation fault -- stopping myself...

attempting to save variables to 'octave-workspace'...
save to 'octave-workspace' complete
Segmentation fault (core dumped)

I will compile 4.0.3 now with the patch and gdb.

Roman Kolbert <kurtkroemer>
Tue 12 Jul 2016 10:35:47 PM UTC, comment #5: 

Roman, if you run with  --no-gui,  does it give you an error message?

Also, can you try it with patch file #37622 from bug #46501?

There is a bug that any error thrown by the Qt graphics toolkit causes a crash.  The above patch doesn't fix the errors, but should prevent the crash.

Lachlan Andrew <lachlan>
Tue 12 Jul 2016 04:01:36 PM UTC, comment #4: 

Please provide a gdb backtrace of the crash with 4.0.3 to identify where it occurs.

Mike Miller <mtmiller>
Group Member
Tue 12 Jul 2016 02:01:09 PM UTC, comment #3: 

Yes, it is possible.

Dmitri.
--

Dmitri A. Sergatskov <dasergatskov>
Tue 12 Jul 2016 01:32:34 PM UTC, comment #2: 

Is it possible, that it has to do with my hardware?
For example I use the Intel 915 graphics driver.

Roman Kolbert <kurtkroemer>
Tue 12 Jul 2016 11:50:02 AM UTC, comment #1: 

works for me

ubuntu 16.04
octave 4.1 
hg id   43646269998d


Doug Stewart <dastew>
Tue 12 Jul 2016 11:23:54 AM UTC, original submission:  

Ubuntu 16.04

Within the gui using qt graphics toolkit:

plot(1:10)

Closing the figure window.

again plot(1:10)

Then I select the zoom in tool and click somewhere in the plot.

octave exited with signal 11

Same thing happens with Octave 4.0.3 built from sources.

I'll downgrade now to Ubuntu 14.04.4 and try again.

Roman Kolbert <kurtkroemer>

 

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

Attach Files:
   
   
Comment:
   

No files currently attached

 

Depends on the following items: None found

Items that depend on this one: None found

 

Carbon-Copy List
  • -email is unavailable- added by nmarais (Posted a comment)
  • -email is unavailable- added by cbm (Posted a comment)
  • -email is unavailable- added by lachlan (Posted a comment)
  • -email is unavailable- added by mtmiller (Posted a comment)
  • -email is unavailable- added by dasergatskov (Posted a comment)
  • -email is unavailable- added by dastew (Posted a comment)
  • -email is unavailable- added by kurtkroemer (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 5 latest changes.

    Date Changed by Updated Field Previous Value => Replaced by
    2016-07-15 mtmiller StatusNeed Info Wont Fix
        Open/ClosedOpen Closed
    2016-07-12 mtmiller CategoryGUI Plotting with OpenGL
        StatusNone Need Info
        Release4.0.0 4.0.3

    Back to the top

    Powered by Savane 3.13-02a9.
    Corresponding source code