Page MenuHomePhabricator

OpenGL error / crash when opening context menu
Closed, ResolvedPublic

Description

When opening the context menu in the data manager for a node (could happen in context menus alike, but not tested), we have OpenGL errors (that can lead to crashes of the application). See example error log below.

The problem occures when the following conditions are fullfilled:

  • a node selection widget has an node selected (A) which has a LabelSetImage
  • Triggering the context menu causes the Node A to change its selection property (e.g. calling A's context menu while A is not selected or calling the context menu of another node while A is selected).

The error could be narrowed down to happen in the Qt context. It happens when void QmitkNodeSelectionButton::changeEvent(QEvent *event) triggers a QWidget::repaint(). Our QmitkNodeSelectionButton::paintEvent(QPaintEvent *p) is not reached before the crash happens.
If we trigger changeEvent in other ways (e.g. changing properties with the property editor) no errors could be provoked.
So it seems to be a kind of race condition between the paint of the context menu and the repaint of the selection widget. Why this happens and more important only for LabelSetImages (other data types seem to have no problem at all?!?), I have no clue so far.
Hints or solutions welcome.

131.66 core.mod.core.loggingadapter ERROR: ERROR: In D:\Dev\MITK\b26741\ep\src\VTK\Rendering\OpenGL2\vtkOpenGLPolyDataMapper.cxx, line 3224
vtkOpenGLPolyDataMapper (0000028AA085F350): failed after BuildBufferObjects 1 OpenGL errors detected

0 : (1282) Invalid operation

131.68 core.mod.core.loggingadapter ERROR: ERROR: In D:\Dev\MITK\b26741\ep\src\VTK\Rendering\OpenGL2\vtkOpenGLPolyDataMapper.cxx, line 1818
vtkOpenGLPolyDataMapper (0000028AA085F350): failed after Render 1 OpenGL errors detected

0 : (1282) Invalid operation

131.69 core.mod.core.loggingadapter ERROR: ERROR: In D:\Dev\MITK\b26741\ep\src\VTK\Rendering\OpenGL2\vtkOpenGLActor.cxx, line 107
vtkOpenGLActor (0000028AA08C14B0): failed after Render 1 OpenGL errors detected

0 : (1282) Invalid operation

131.71 core.mod.core.loggingadapter ERROR: ERROR: In D:\Dev\MITK\b26741\ep\src\VTK\Rendering\OpenGL2\vtkOpenGLFramebufferObject.cxx, line 671
vtkOpenGLFramebufferObject (0000028A923BB250): failed at glDrawBuffers(GL_NONE) 1 OpenGL errors detected

0 : (1282) Invalid operation

131.73 core.mod.core.loggingadapter ERROR: ERROR: In D:\Dev\MITK\b26741\ep\src\VTK\Rendering\OpenGL2\vtkOpenGLFramebufferObject.cxx, line 623
vtkOpenGLFramebufferObject (0000028A923BB250): failed at glDrawBuffers 1 OpenGL errors detected

0 : (1282) Invalid operation

131.74 core.mod.core.loggingadapter ERROR: ERROR: In D:\Dev\MITK\b26741\ep\src\VTK\Rendering\OpenGL2\vtkOpenGLFramebufferObject.cxx, line 623
vtkOpenGLFramebufferObject (0000028A923BB250): failed at glDrawBuffers 1 OpenGL errors detected

0 : (1282) Invalid operation

131.76 core.mod.core.loggingadapter ERROR: ERROR: In D:\Dev\MITK\b26741\ep\src\VTK\Rendering\OpenGL2\vtkOpenGLFramebufferObject.cxx, line 671
vtkOpenGLFramebufferObject (0000028A923BB250): failed at glDrawBuffers(GL_NONE) 1 OpenGL errors detected

0 : (1282) Invalid operation

131.78 core.mod.core.loggingadapter ERROR: ERROR: In D:\Dev\MITK\b26741\ep\src\VTK\Rendering\OpenGL2\vtkOpenGLFramebufferObject.cxx, line 623
vtkOpenGLFramebufferObject (0000028A923BB250): failed at glDrawBuffers 1 OpenGL errors detected

0 : (1282) Invalid operation

131.79 core.mod.core.loggingadapter ERROR: ERROR: In D:\Dev\MITK\b26741\ep\src\VTK\Rendering\OpenGL2\vtkOpenGLFramebufferObject.cxx, line 671
vtkOpenGLFramebufferObject (0000028A923BB250): failed at glDrawBuffers(GL_NONE) 1 OpenGL errors detected

0 : (1282) Invalid operation

131.81 core.mod.core.loggingadapter ERROR: ERROR: In D:\Dev\MITK\b26741\ep\src\VTK\Rendering\OpenGL2\vtkOpenGLFramebufferObject.cxx, line 623
vtkOpenGLFramebufferObject (0000028A923BB250): failed at glDrawBuffers 1 OpenGL errors detected

0 : (1282) Invalid operation

131.87 core.mod.core.loggingadapter ERROR: ERROR: In D:\Dev\MITK\b26741\ep\src\VTK\Rendering\OpenGL2\vtkOpenGLPolyDataMapper.cxx, line 3224
vtkOpenGLPolyDataMapper (0000028AA085FE70): failed after BuildBufferObjects 1 OpenGL errors detected

0 : (1282) Invalid operation

131.88 core.mod.core.loggingadapter ERROR: ERROR: In D:\Dev\MITK\b26741\ep\src\VTK\Rendering\OpenGL2\vtkOpenGLPolyDataMapper.cxx, line 1818
vtkOpenGLPolyDataMapper (0000028AA085FE70): failed after Render 1 OpenGL errors detected

0 : (1282) Invalid operation

131.90 core.mod.core.loggingadapter ERROR: ERROR: In D:\Dev\MITK\b26741\ep\src\VTK\Rendering\OpenGL2\vtkOpenGLActor.cxx, line 107
vtkOpenGLActor (0000028AA08C6BD0): failed after Render 1 OpenGL errors detected

0 : (1282) Invalid operation

131.92 core.mod.core.loggingadapter ERROR: ERROR: In D:\Dev\MITK\b26741\ep\src\VTK\Rendering\OpenGL2\vtkOpenGLPolyDataMapper.cxx, line 3224
vtkOpenGLPolyDataMapper (0000028AA0862560): failed after BuildBufferObjects 1 OpenGL errors detected

0 : (1282) Invalid operation

131.94 core.mod.core.loggingadapter ERROR: ERROR: In D:\Dev\MITK\b26741\ep\src\VTK\Rendering\OpenGL2\vtkOpenGLPolyDataMapper.cxx, line 1767
vtkOpenGLPolyDataMapper (0000028AA0862560): failed after UpdateShader 1 OpenGL errors detected

0 : (1282) Invalid operation

131.95 core.mod.core.loggingadapter ERROR: ERROR: In D:\Dev\MITK\b26741\ep\src\VTK\Rendering\OpenGL2\vtkOpenGLActor.cxx, line 107
vtkOpenGLActor (0000028AA08C5250): failed after Render 1 OpenGL errors detected

0 : (1282) Invalid operation

131.97 core.mod.core.loggingadapter ERROR: ERROR: In D:\Dev\MITK\b26741\ep\src\VTK\Rendering\OpenGL2\vtkOpenGLPolyDataMapper.cxx, line 3224
vtkOpenGLPolyDataMapper (0000028AA0862560): failed after BuildBufferObjects 1 OpenGL errors detected

0 : (1282) Invalid operation

131.98 core.mod.core.loggingadapter ERROR: ERROR: In D:\Dev\MITK\b26741\ep\src\VTK\Rendering\OpenGL2\vtkOpenGLActor.cxx, line 107
vtkOpenGLActor (0000028AA08C0E50): failed after Render 1 OpenGL errors detected

0 : (1282) Invalid operation

132.00 core.mod.core.loggingadapter ERROR: ERROR: In D:\Dev\MITK\b26741\ep\src\VTK\Rendering\OpenGL2\vtkOpenGLFramebufferObject.cxx, line 623
vtkOpenGLFramebufferObject (0000028A923BB250): failed at glDrawBuffers 1 OpenGL errors detected

0 : (1282) Invalid operation

132.01 core.mod.core.loggingadapter ERROR: ERROR: In D:\Dev\MITK\b26741\ep\src\VTK\Rendering\OpenGL2\vtkOpenGLFramebufferObject.cxx, line 623
vtkOpenGLFramebufferObject (0000028A923BB250): failed at glDrawBuffers 1 OpenGL errors detected

0 : (1282) Invalid operation

132.03 core.mod.core.loggingadapter ERROR: ERROR: In D:\Dev\MITK\b26741\ep\src\VTK\Rendering\OpenGL2\vtkOpenGLFramebufferObject.cxx, line 623
vtkOpenGLFramebufferObject (0000028A923BB250): failed at glDrawBuffers 1 OpenGL errors detected

0 : (1282) Invalid operation

132.04 core.mod.core.loggingadapter ERROR: ERROR: In D:\Dev\MITK\b26741\ep\src\VTK\Rendering\OpenGL2\vtkOpenGLFramebufferObject.cxx, line 623
vtkOpenGLFramebufferObject (0000028A923BB250): failed at glDrawBuffers 1 OpenGL errors detected

0 : (1282) Invalid operation

132.06 core.mod.core.loggingadapter ERROR: ERROR: In D:\Dev\MITK\b26741\ep\src\VTK\Rendering\OpenGL2\vtkOpenGLFramebufferObject.cxx, line 671
vtkOpenGLFramebufferObject (0000028A923BB250): failed at glDrawBuffers(GL_NONE) 1 OpenGL errors detected

0 : (1282) Invalid operation

132.07 core.mod.core.loggingadapter ERROR: ERROR: In D:\Dev\MITK\b26741\ep\src\VTK\Rendering\OpenGL2\vtkOpenGLFramebufferObject.cxx, line 623
vtkOpenGLFramebufferObject (0000028A923BB250): failed at glDrawBuffers 1 OpenGL errors detected

0 : (1282) Invalid operation

132.08 core.mod.core.loggingadapter ERROR: ERROR: In D:\Dev\MITK\b26741\ep\src\VTK\Rendering\OpenGL2\vtkOpenGLPolyDataMapper.cxx, line 3224
vtkOpenGLPolyDataMapper (0000028AA085FE70): failed after BuildBufferObjects 1 OpenGL errors detected

0 : (1282) Invalid operation

132.10 core.mod.core.loggingadapter ERROR: ERROR: In D:\Dev\MITK\b26741\ep\src\VTK\Rendering\OpenGL2\vtkOpenGLActor.cxx, line 107
vtkOpenGLActor (0000028AA08C6BD0): failed after Render 1 OpenGL errors detected

0 : (1282) Invalid operation

132.11 core.mod.core.loggingadapter ERROR: ERROR: In D:\Dev\MITK\b26741\ep\src\VTK\Rendering\OpenGL2\vtkOpenGLPolyDataMapper.cxx, line 3224
vtkOpenGLPolyDataMapper (0000028AA0862560): failed after BuildBufferObjects 1 OpenGL errors detected

0 : (1282) Invalid operation

132.13 core.mod.core.loggingadapter ERROR: ERROR: In D:\Dev\MITK\b26741\ep\src\VTK\Rendering\OpenGL2\vtkOpenGLActor.cxx, line 107
vtkOpenGLActor (0000028AA08C5250): failed after Render 1 OpenGL errors detected

0 : (1282) Invalid operation

132.14 core.mod.core.loggingadapter ERROR: ERROR: In D:\Dev\MITK\b26741\ep\src\VTK\Rendering\OpenGL2\vtkOpenGLPolyDataMapper.cxx, line 3224
vtkOpenGLPolyDataMapper (0000028AA0862560): failed after BuildBufferObjects 1 OpenGL errors detected

0 : (1282) Invalid operation

132.16 core.mod.core.loggingadapter ERROR: ERROR: In D:\Dev\MITK\b26741\ep\src\VTK\Rendering\OpenGL2\vtkOpenGLActor.cxx, line 107
vtkOpenGLActor (0000028AA08C0E50): failed after Render 1 OpenGL errors detected

0 : (1282) Invalid operation

132.17 core.mod.core.loggingadapter ERROR: ERROR: In D:\Dev\MITK\b26741\ep\src\VTK\Rendering\OpenGL2\vtkOpenGLFramebufferObject.cxx, line 623
vtkOpenGLFramebufferObject (0000028A923BB250): failed at glDrawBuffers 1 OpenGL errors detected

0 : (1282) Invalid operation

132.19 core.mod.core.loggingadapter ERROR: ERROR: In D:\Dev\MITK\b26741\ep\src\VTK\Rendering\OpenGL2\vtkOpenGLFramebufferObject.cxx, line 671
vtkOpenGLFramebufferObject (0000028A923BB250): failed at glDrawBuffers(GL_NONE) 1 OpenGL errors detected

0 : (1282) Invalid operation

132.20 core.mod.core.loggingadapter ERROR: ERROR: In D:\Dev\MITK\b26741\ep\src\VTK\Rendering\OpenGL2\vtkOpenGLFramebufferObject.cxx, line 623
vtkOpenGLFramebufferObject (0000028A923BB250): failed at glDrawBuffers 1 OpenGL errors detected

0 : (1282) Invalid operation

132.22 core.mod.core.loggingadapter ERROR: ERROR: In D:\Dev\MITK\b26741\ep\src\VTK\Rendering\OpenGL2\vtkOpenGLFramebufferObject.cxx, line 623
vtkOpenGLFramebufferObject (0000028A923BB250): failed at glDrawBuffers 1 OpenGL errors detected

0 : (1282) Invalid operation

132.23 core.mod.core.loggingadapter ERROR: ERROR: In D:\Dev\MITK\b26741\ep\src\VTK\Rendering\OpenGL2\vtkOpenGLFramebufferObject.cxx, line 671
vtkOpenGLFramebufferObject (0000028A923BB250): failed at glDrawBuffers(GL_NONE) 1 OpenGL errors detected

0 : (1282) Invalid operation

132.26 core.mod.core.loggingadapter ERROR: ERROR: In D:\Dev\MITK\b26741\ep\src\VTK\Rendering\OpenGL2\vtkOpenGLFramebufferObject.cxx, line 623
vtkOpenGLFramebufferObject (0000028A923BB250): failed at glDrawBuffers 1 OpenGL errors detected

0 : (1282) Invalid operation

132.27 core.mod.core.loggingadapter ERROR: ERROR: In D:\Dev\MITK\b26741\ep\src\VTK\Rendering\OpenGL2\vtkOpenGLFramebufferObject.cxx, line 623
vtkOpenGLFramebufferObject (0000028A923BB250): failed at glDrawBuffers 1 OpenGL errors detected

0 : (1282) Invalid operation

132.29 core.mod.core.loggingadapter ERROR: ERROR: In D:\Dev\MITK\b26741\ep\src\VTK\Rendering\OpenGL2\vtkOpenGLFramebufferObject.cxx, line 764
vtkOpenGLFramebufferObject (0000028A923BB250): failed at glDrawBuffer 1 OpenGL errors detected

0 : (1282) Invalid operation

132.30 core.mod.core.loggingadapter ERROR: ERROR: In D:\Dev\MITK\b26741\ep\src\VTK\Rendering\OpenGL2\vtkOpenGLRenderer.cxx, line 410
vtkOpenGLRenderer (0000028A96F480D0): failed after DeviceRenderTranslucentPolygonalGeometry 1 OpenGL errors detected

0 : (1282) Invalid operation

132.32 core.mod.core.loggingadapter ERROR: ERROR: In D:\Dev\MITK\b26741\ep\src\VTK\Rendering\OpenGL2\vtkOpenGLPolyDataMapper2D.cxx, line 902
vtkOpenGLPolyDataMapper2D (0000028AA0BD2BD0): failed after RenderOverlay 1 OpenGL errors detected

0 : (1282) Invalid operation

132.33 core.mod.core.loggingadapter ERROR: ERROR: In D:\Dev\MITK\b26741\ep\src\VTK\Rendering\OpenGL2\vtkOpenGLPolyDataMapper2D.cxx, line 902
vtkOpenGLPolyDataMapper2D (0000028AA0BD4130): failed after RenderOverlay 1 OpenGL errors detected

0 : (1282) Invalid operation

Event Timeline

floca triaged this task as High priority.Thu, Feb 6, 4:21 PM
floca created this task.

Did a first test on my PC and the exception is thrown from the Nvidia OpenGL driver (nvoglv64.dll) because of a null pointer access. So whatever causes it to happen, there is at least also a bug in the driver.

I deactivated FXAA in the RenderingManager and BaseRenderer and while the error output is still the same, the crash doesn't happen anymore. Instead, one of the four render windows is black until it is redrawn for example by clicking in it.

kislinsk added a comment.EditedFri, Feb 14, 5:35 PM

The fix is to replace the calls of repaint() with update() in QmitkNodeSelectionButton.cpp. More info: https://doc.qt.io/qt-5/qwidget.html#repaint

floca added a comment.Fri, Feb 14, 5:46 PM

Yes. This solved the problem. Still do not understand why only LabelSetImages where that problematic, but thanks for having a look. The second pair of eyes really helped.

Yes. This solved the problem. Still do not understand why only LabelSetImages where that problematic, but thanks for having a look. The second pair of eyes really helped.

It also was other data types / mappers but the LabelSetImages were the ones that triggered the issue most reliably. It wasn't even only their mappers that triggered the OpenGL errors but all mappers. I think the following happened: VTK and Qt share the same OpenGL context. The repaints() messed up the OpenGL state by not resetting it to the prior state when finished and VTK's logic was out of sync with the current state then. In particular, the rendering of LabelSetImages indirectly uses an OpenGL feature affected by that part of the OpenGL state and BOOM: As OpenGL was in an invalid state, the Nvidia driver also made wrong assumptions in its FXAA implementation which lead ultimately to a crash.

floca added a comment.Sat, Feb 15, 9:28 AM

Thanks for the explenation and insight.

floca closed this task as Resolved.Sun, Feb 16, 10:26 PM
floca claimed this task.