View Issue Details

IDProjectCategoryView StatusLast Update
0003969Slicer4Core: Renderingpublic2018-03-02 11:06
Reporterjcfr Assigned Tomsmolens  
PrioritynormalSeverityminorReproducibilityhave not tried
Status closedResolutionfixed 
Product Version 
Target VersionSlicer 4.6.0Fixed in VersionSlicer 4.6.0 
Summary0003969: VTKOpenGL2: OpenGL error (1282) Invalid operation
Description

To reproduce the problem:

  1. Download the latest Slicer VTKOpenGL2 package of 02/25/2015 from:

       http://slicer.kitware.com/midas3/folder/2667
  2. Create an empty folder named for example "~/Desktop/TriggerOpenGLError"

  3. Download the attached file named "TriggerOpenGLError.py" into the empty
    folder you just created.

  4. Start Slicer using:

    ./Slicer --disable-builtin-cli-modules  --disable-builtin-loadable-modules --disable-builtin-scripted-loadable-modules --python-code "slicer.mrmlScene.Clear(0)" --additional-module-path ~/Desktop/TriggerOpenGLError/

The following message will be printed on the terminal:

Number of registered modules: 2
Number of instantiated modules: 2
Number of loaded modules: 2
makeScalingRuler
makeScalingRuler
makeScalingRuler
makeScalingRuler
makeScalingRuler
makeScalingRuler
makeScalingRuler
makeScalingRuler
makeScalingRuler
makeScalingRuler
makeScalingRuler
makeScalingRuler
makeScalingRuler
makeScalingRuler
makeScalingRuler
makeScalingRuler
failed after Render 1 OpenGL errors detected
0 : (1282) Invalid operation

failed after Render 1 OpenGL errors detected
0 : (1282) Invalid operation

failed after Render 1 OpenGL errors detected
0 : (1282) Invalid operation

Additional Information

The issue is not reproducible with Slicer build against VTK/OpenGL backend

TagsNo tags attached.

Activities

jcfr

jcfr

2015-02-26 20:38

administrator   ~0012942

Adding a breakpoint at line 148 of vtkOpenGLError.h (in function vtkPrintOpenGLErrors), I got the following stack trace:

#0 vtkPrintOpenGLErrors (os=..., maxErrors=16, numErrors=1, errCode=0x7ffff6b89410, errDesc=0x7ffff6b89450) at /home/jcfr/Projects/Slicer-Release-OpenGL2/VTKv6-build/Rendering/OpenGL2/vtkOpenGLError.h:148
0000001 0x00007f81fa356e0f in vtkOpenGLActor::Render (this=0x28f4e80, ren=0x2891590, mapper=0x2956880) at /home/jcfr/Projects/Slicer-Release-OpenGL2/VTKv6/Rendering/OpenGL2/vtkOpenGLActor.cxx:87
0000002 0x00007f81f732fa9b in vtkActor::RenderOpaqueGeometry (this=0x28f4e80, vp=0x2891590) at /home/jcfr/Projects/Slicer-Release-OpenGL2/VTKv6/Rendering/Core/vtkActor.cxx:187
0000003 0x00007f81f741e887 in vtkRenderer::UpdateGeometry (this=0x2891590) at /home/jcfr/Projects/Slicer-Release-OpenGL2/VTKv6/Rendering/Core/vtkRenderer.cxx:554
0000004 0x00007f81fa3b45d7 in vtkOpenGLRenderer::DeviceRender (this=0x2891590) at /home/jcfr/Projects/Slicer-Release-OpenGL2/VTKv6/Rendering/OpenGL2/vtkOpenGLRenderer.cxx:154
0000005 0x00007f81f741dc51 in vtkRenderer::Render (this=0x2891590) at /home/jcfr/Projects/Slicer-Release-OpenGL2/VTKv6/Rendering/Core/vtkRenderer.cxx:291
0000006 0x00007f81f741c335 in vtkRendererCollection::Render (this=0x2872c60) at /home/jcfr/Projects/Slicer-Release-OpenGL2/VTKv6/Rendering/Core/vtkRendererCollection.cxx:51
0000007 0x00007f81f7431f34 in vtkRenderWindow::DoStereoRender (this=0x2874940) at /home/jcfr/Projects/Slicer-Release-OpenGL2/VTKv6/Rendering/Core/vtkRenderWindow.cxx:771
0000008 0x00007f81f7431e44 in vtkRenderWindow::DoFDRender (this=0x2874940) at /home/jcfr/Projects/Slicer-Release-OpenGL2/VTKv6/Rendering/Core/vtkRenderWindow.cxx:740
0000009 0x00007f81f74317f0 in vtkRenderWindow::DoAARender (this=0x2874940) at /home/jcfr/Projects/Slicer-Release-OpenGL2/VTKv6/Rendering/Core/vtkRenderWindow.cxx:619
0000010 0x00007f81f7430dc0 in vtkRenderWindow::Render (this=0x2874940) at /home/jcfr/Projects/Slicer-Release-OpenGL2/VTKv6/Rendering/Core/vtkRenderWindow.cxx:435
0000011 0x00007f81fa436f0d in vtkXOpenGLRenderWindow::Render (this=0x2874940) at /home/jcfr/Projects/Slicer-Release-OpenGL2/VTKv6/Rendering/OpenGL2/vtkXOpenGLRenderWindow.cxx:1794
0000012 0x00007f82133dd26d in ctkVTKAbstractView::forceRender (this=0x2872b50) at /home/jcfr/Projects/Slicer-Release-OpenGL2/CTK/Libs/Visualization/VTK/Widgets/ctkVTKAbstractView.cpp:233
0000013 0x00007f82133dd0d4 in ctkVTKAbstractView::scheduleRender (this=0x2872b50) at /home/jcfr/Projects/Slicer-Release-OpenGL2/CTK/Libs/Visualization/VTK/Widgets/ctkVTKAbstractView.cpp:181
0000014 0x00007f82134139e6 in ctkVTKAbstractView::qt_static_metacall (_o=0x2872b50, _c=QMetaObject::InvokeMetaMethod, _id=0, _a=0x7ffff6b8a000) at /home/jcfr/Projects/Slicer-Release-OpenGL2/CTK-build/CTK-build/Libs/Visualization/VTK/Widgets/moc_ctkVTKAbstractView.cxx:91
0000015 0x00007f81fb70ddca in QMetaObject::activate(QObject, QMetaObject const, int, void*) () from /home/jcfr/Support/qt-everywhere-opensource-release-build-4.8.6/lib/libQtCore.so.4
0000016 0x00007f8210883660 in ctkVTKConnection::emitExecute (this=0x292e3f0, _t1=0x28f3880, _t2=0x0, _t3=5, _t4=0x28f3e90) at /home/jcfr/Projects/Slicer-Release-OpenGL2/CTK-build/CTK-build/Libs/Visualization/VTK/Core/moc_ctkVTKConnection.cxx:116
0000017 0x00007f82108748e6 in ctkVTKConnectionPrivate::execute (this=0x28f3e90, vtk_obj=0x28f3880, vtk_event=5, client_data=0x28f3e90, call_data=0x0) at /home/jcfr/Projects/Slicer-Release-OpenGL2/CTK/Libs/Visualization/VTK/Core/ctkVTKConnection.cpp:422
0000018 0x00007f8210874646 in ctkVTKConnectionPrivate::DoCallback (vtk_obj=0x28f3880, event=5, client_data=0x28f3e90, call_data=0x0) at /home/jcfr/Projects/Slicer-Release-OpenGL2/CTK/Libs/Visualization/VTK/Core/ctkVTKConnection.cpp:381
0000019 0x00007f81f43e2e99 in vtkCallbackCommand::Execute (this=0x28f1550, caller=0x28f3880, event=5, callData=0x0) at /home/jcfr/Projects/Slicer-Release-OpenGL2/VTKv6/Common/Core/vtkCallbackCommand.cxx:42
0000020 0x00007f820d3f79bb in vtkEventBroker::InvokeObservation (this=0x1587460, observation=0x28fdaf0, eid=5, callData=0x0) at /home/jcfr/Projects/Slicer/Libs/MRML/Core/vtkEventBroker.cxx:838
0000021 0x00007f820d3f7011 in vtkEventBroker::ProcessEvent (this=0x1587460, observation=0x28fdaf0, caller=0x28f3880, eid=5, callData=0x0) at /home/jcfr/Projects/Slicer/Libs/MRML/Core/vtkEventBroker.cxx:687
0000022 0x00007f820d3f7f7f in vtkEventBroker::Callback (caller=0x28f3880, eid=5, clientData=0x28fdaf0, callData=0x0) at /home/jcfr/Projects/Slicer/Libs/MRML/Core/vtkEventBroker.cxx:913
0000023 0x00007f81f43e2e99 in vtkCallbackCommand::Execute (this=0x29301a0, caller=0x28f3880, event=5, callData=0x0) at /home/jcfr/Projects/Slicer-Release-OpenGL2/VTKv6/Common/Core/vtkCallbackCommand.cxx:42
0000024 0x00007f81f45771da in vtkSubjectHelper::InvokeEvent (this=0x2930920, event=5, callData=0x0, self=0x28f3880) at /home/jcfr/Projects/Slicer-Release-OpenGL2/VTKv6/Common/Core/vtkObject.cxx:616
0000025 0x00007f81f45776f1 in vtkObject::InvokeEvent (this=0x28f3880, event=5, callData=0x0) at /home/jcfr/Projects/Slicer-Release-OpenGL2/VTKv6/Common/Core/vtkObject.cxx:785
0000026 0x00007f81f743d6a9 in vtkRenderWindowInteractor::Render (this=0x28f3880) at /home/jcfr/Projects/Slicer-Release-OpenGL2/VTKv6/Rendering/Core/vtkRenderWindowInteractor.cxx:175
0000027 0x00007f81fca795f8 in QVTKWidget::paintEvent (this=0x28f1930) at /home/jcfr/Projects/Slicer-Release-OpenGL2/VTKv6/GUISupport/Qt/QVTKWidget.cxx:477
0000028 0x00007f81fbff8d9c in QWidget::event(QEvent
) () from /home/jcfr/Support/qt-everywhere-opensource-release-build-4.8.6/lib/libQtGui.so.4
0000029 0x00007f81fca793ba in QVTKWidget::event (this=0x28f1930, e=0x7ffff6b8aa00) at /home/jcfr/Projects/Slicer-Release-OpenGL2/VTKv6/GUISupport/Qt/QVTKWidget.cxx:412
0000030 0x00007f81fbfacc7c in QApplicationPrivate::notify_helper(QObject, QEvent) () from /home/jcfr/Support/qt-everywhere-opensource-release-build-4.8.6/lib/libQtGui.so.4
0000031 0x00007f81fbfb323a in QApplication::notify(QObject, QEvent) () from /home/jcfr/Support/qt-everywhere-opensource-release-build-4.8.6/lib/libQtGui.so.4
0000032 0x00007f8215e186ee in qSlicerApplication::notify (this=0x7ffff6b8b3b0, receiver=0x28f1930, event=0x7ffff6b8aa00) at /home/jcfr/Projects/Slicer/Base/QTGUI/qSlicerApplication.cxx:330
0000033 0x00007f81fb6fa65d in QCoreApplication::notifyInternal(QObject, QEvent) () from /home/jcfr/Support/qt-everywhere-opensource-release-build-4.8.6/lib/libQtCore.so.4
0000034 0x00007f81fbff3661 in QWidgetPrivate::drawWidget(QPaintDevice, QRegion const&, QPoint const&, int, QPainter, QWidgetBackingStore) () from /home/jcfr/Support/qt-everywhere-opensource-release-build-4.8.6/lib/libQtGui.so.4
0000035 0x00007f81fc1a515b in QWidgetPrivate::repaint_sys(QRegion const&) () from /home/jcfr/Support/qt-everywhere-opensource-release-build-4.8.6/lib/libQtGui.so.4
0000036 0x00007f81fbfe9027 in QWidgetPrivate::syncBackingStore() () from /home/jcfr/Support/qt-everywhere-opensource-release-build-4.8.6/lib/libQtGui.so.4
0000037 0x00007f81fbff88d2 in QWidget::event(QEvent
) () from /home/jcfr/Support/qt-everywhere-opensource-release-build-4.8.6/lib/libQtGui.so.4
0000038 0x00007f81fca793ba in QVTKWidget::event (this=0x28f1930, e=0x29a5170) at /home/jcfr/Projects/Slicer-Release-OpenGL2/VTKv6/GUISupport/Qt/QVTKWidget.cxx:412
0000039 0x00007f81fbfacc7c in QApplicationPrivate::notify_helper(QObject, QEvent) () from /home/jcfr/Support/qt-everywhere-opensource-release-build-4.8.6/lib/libQtGui.so.4
0000040 0x00007f81fbfb323a in QApplication::notify(QObject, QEvent) () from /home/jcfr/Support/qt-everywhere-opensource-release-build-4.8.6/lib/libQtGui.so.4
0000041 0x00007f8215e186ee in qSlicerApplication::notify (this=0x7ffff6b8b3b0, receiver=0x28f1930, event=0x29a5170) at /home/jcfr/Projects/Slicer/Base/QTGUI/qSlicerApplication.cxx:330
0000042 0x00007f81fb6fa65d in QCoreApplication::notifyInternal(QObject, QEvent) () from /home/jcfr/Support/qt-everywhere-opensource-release-build-4.8.6/lib/libQtCore.so.4
0000043 0x00007f81fb6fd73d in QCoreApplicationPrivate::sendPostedEvents(QObject, int, QThreadData) () from /home/jcfr/Support/qt-everywhere-opensource-release-build-4.8.6/lib/libQtCore.so.4
0000044 0x00007f81fb7268e3 in ?? () from /home/jcfr/Support/qt-everywhere-opensource-release-build-4.8.6/lib/libQtCore.so.4
0000045 0x00007f81f05afe04 in g_main_context_dispatch () from /lib/x86_64-linux-gnu/libglib-2.0.so.0
0000046 0x00007f81f05b0048 in ?? () from /lib/x86_64-linux-gnu/libglib-2.0.so.0
0000047 0x00007f81f05b00ec in g_main_context_iteration () from /lib/x86_64-linux-gnu/libglib-2.0.so.0
0000048 0x00007f81fb7261a5 in QEventDispatcherGlib::processEvents(QFlags<QEventLoop::ProcessEventsFlag>) () from /home/jcfr/Support/qt-everywhere-opensource-release-build-4.8.6/lib/libQtCore.so.4
0000049 0x00007f81fc043556 in ?? () from /home/jcfr/Support/qt-everywhere-opensource-release-build-4.8.6/lib/libQtGui.so.4
0000050 0x00007f81fb6f92af in QEventLoop::processEvents(QFlags<QEventLoop::ProcessEventsFlag>) () from /home/jcfr/Support/qt-everywhere-opensource-release-build-4.8.6/lib/libQtCore.so.4
0000051 0x00007f81fb6f95a5 in QEventLoop::exec(QFlags<QEventLoop::ProcessEventsFlag>) () from /home/jcfr/Support/qt-everywhere-opensource-release-build-4.8.6/lib/libQtCore.so.4
0000052 0x00007f81fb6fe599 in QCoreApplication::exec() () from /home/jcfr/Support/qt-everywhere-opensource-release-build-4.8.6/lib/libQtCore.so.4
0000053 0x0000000000406375 in (anonymous namespace)::SlicerAppMain (argc=9, argv=0x7ffff6b8b548) at /home/jcfr/Projects/Slicer/Applications/SlicerApp/Main.cxx:209
0000054 0x00000000004066cb in main (argc=9, argv=0x7ffff6b8b548) at /home/jcfr/Projects/Slicer/Applications/SlicerApp/Main.cxx:243

2015-02-26 20:39

 

TriggerOpenGLError.py (903 bytes)
msmolens

msmolens

2015-11-10 10:38

developer   ~0013581

I get a different stack trace now, but still see the OpenGL errors.

The problem is that a vertex array object is deleted from the wrong context. The class vtkOpenGLVertexArrayObject::Private manages creation and deletion of vertex array objects. Each instance manages a single handle. The problem is that there's currently no guarantee that the same context that was current when creating the handle is current when deleting the handle.

This can be checked by making vtkOpenGLVertexArrayObject::Private save the current context when it calls glGenVertexArrays() and verify that the current context is the same when it calls glDeleteVertexArrays(). The testcase in this bug demonstrates a failure of that check.

I see that this has already been reported in VTK:
http://www.vtk.org/Bug/view.php?id=15765

jcfr

jcfr

2016-10-12 02:43

administrator   ~0014156

This has been addressed by https://gitlab.kitware.com/vtk/vtk/merge_requests/1636

and Slicer now build against a recent version of VTK

Issue History

Date Modified Username Field Change
2015-02-26 20:33 jcfr New Issue
2015-02-26 20:33 jcfr Status new => assigned
2015-02-26 20:33 jcfr Assigned To => jcfr
2015-02-26 20:33 jcfr Assigned To jcfr => aashish24
2015-02-26 20:33 jcfr Target Version => Slicer 4.5.0-1
2015-02-26 20:33 jcfr Description Updated
2015-02-26 20:38 jcfr Note Added: 0012942
2015-02-26 20:39 jcfr File Added: TriggerOpenGLError.py
2015-11-02 11:22 jcfr Assigned To aashish24 => msmolens
2015-11-02 11:22 jcfr Target Version Slicer 4.5.0-1 => Slicer 4.5.1
2015-11-10 10:38 msmolens Note Added: 0013581
2016-10-12 02:43 jcfr Note Added: 0014156
2016-10-12 02:43 jcfr Status assigned => resolved
2016-10-12 02:43 jcfr Fixed in Version => Slicer 4.6.0
2016-10-12 02:43 jcfr Resolution open => fixed
2016-10-13 01:27 jcfr Target Version Slicer 4.5.1 => Slicer 4.6.0
2018-03-02 11:06 jcfr Status resolved => closed