Error in <TGLLockable::TakeLock>...again

Dear all

I have checked that there is some information about this problem in this forum but not a real solution to it. In my case, I have created a macro that loads several libraries from a framework based on FairRoot (a data analysis framework). One of those libraries is an event visualizer based on the TEveManager class. It spawns a window that contains several embedded canvas and a 3D geometry constructed with TGeo.

I never had problems with this before since today that I moved the framework from root 5 to 6. When the window appears I can do anything but “touch” the 3D geometry to rotate it or stretch it and so on. I get this error message:

Error in <TGLLockable::TakeLock>: 'TGLSceneBase Geometry scene' unable to take DrawLock, already DrawLock Warning in <TGLViewerBase::PreRender>: locking of scene 'Geometry scene' failed, skipping.

I am running in Fedora 21 (in Yosemite I do not have this problem under the same conditions). The point is, that I already had this problem before (in other computer with an integrated Intel graphics card) and I managed to solve it somehow going to /etc/X11/xorg.conf.d/ and creating a configuration file (20-intel.conf) for the xorg to disable the direct rendering with this:

Section "Device"
   Identifier  "Intel Graphics"
   Driver      "intel"
   Option "DRI" "False"

And this worked like a charm (through glxinfo I couldnt see that DR was disabled though).

Now, on another computer with also Fedora 21 and a Radeon 8500 graphics card on it, I can’t fix the error by creating a configuration file for the radeon card (The identifier and Driver in this case are radeon of course).

Any suggestion is more than welcome.
Thank you very much in advance.

May be this post can help you ?


Thank you for the answer. Indeed Ive followed the information on that post to disable the DRI, but for some weird reason the problem came back after porting to ROOT6. This problem also exists in MacOS when using a particular version of XQuartz.

I am installing the full package in a virtual machine where I can control the acceleration easily because I am not really sure I am disabling the DRI properly.

Best regards

Is there any error before the take-lock one? This is really just the consequence of exception being thrown for some gl command in previous render path …

For disabling dri you should look into the docs of the driver you use … is it the free radeon or ATI’s fglrx?

We have a bug report open with xquartz guys.


Hi again

I really appreciate the answer. I will post the full stack trace but before I want to point out that:

  • I am using Fedora 21 and and ATI card with free Radeon drivers.
  • I have the same crash in a computer with Fedora 21 running under a virtual machine with this controller: VGA compatible controller: InnoTek Systemberatung GmbH VirtualBox Graphics Adapter and OpenGL vendor string: VMware, Inc) and two nvida gtx 970 in SLI (but thats useless information I guess)
  • It works perfectly in Yosemite with Xquartz 2.7.7 (I think it crashes with 2.7.8 )
  • It works with ROOT5 but it crashes with ROOT6

To answer your questions: The first time I posted I was debugging with the free Radeon drivers (I could try catalyst). I have no idea how to disable the DRI except in the xorg configuration file.

Here goes the full trace:

[code]#10 0x00007f1b53007365 in operator() (this=, __ptr=0x75031a0) at /usr/include/c++/4.9.2/bits/unique_ptr.h:76
#11 reset (__p=0x75031a0, this=0x7ffd1692af90) at /usr/include/c++/4.9.2/bits/unique_ptr.h:344
#12 operator= (this=0x7ffd1692af90) at /usr/include/c++/4.9.2/bits/unique_ptr.h:280
#13 llvm::EngineBuilder::InitEngine (this=0x7ffd1692af70) at /home/yassid/fair_install_ROOT6/FairSoft/tools/root/interpreter/llvm/src/lib/ExecutionEngine/ExecutionEngine.cpp:423
#14 0x00007f1b3c16e16e in lp_build_create_jit_compiler_for_module () from /usr/lib64/dri/
#15 0x00007f1b3c14c312 in gallivm_create () from /usr/lib64/dri/
#16 0x00007f1b3c3a1edd in llvmpipe_update_fs () from /usr/lib64/dri/
#17 0x00007f1b3c39a7f0 in llvmpipe_update_derived () from /usr/lib64/dri/
#18 0x00007f1b3c382046 in llvmpipe_draw_vbo () from /usr/lib64/dri/
#19 0x00007f1b3bfba30f in st_draw_vbo () from /usr/lib64/dri/
#20 0x00007f1b3bf8eb78 in vbo_exec_vtx_flush () from /usr/lib64/dri/
#21 0x00007f1b3bf75fac in vbo_exec_FlushVertices_internal () from /usr/lib64/dri/
#22 0x00007f1b3bf8bb14 in vbo_exec_FlushVertices () from /usr/lib64/dri/
#23 0x00007f1b3be9a6e6 in _mesa_EndList () from /usr/lib64/dri/
#24 0x00007f1b41cc176f in TGLLogicalShape::Draw (this=0x750a8e0, rnrCtx=…) at /home/yassid/fair_install_ROOT6/FairSoft/tools/root/graf3d/gl/src/TGLLogicalShape.cxx:414
#25 0x00007f1b41df7872 in TGLPhysicalShape::Draw (this=0x720650, rnrCtx=…) at /home/yassid/fair_install_ROOT6/FairSoft/tools/root/graf3d/gl/src/TGLPhysicalShape.cxx:413
#26 0x00007f1b41d22dd0 in TGLScene::RenderElements (this=0x6d47680, rnrCtx=…, elVec=std::vector of length 3, capacity 4 = {…}, check_timeout=true, clipPlanes=0x0) at /home/yassid/fair_install_ROOT6/FairSoft/tools/root/graf3d/gl/src/TGLScene.cxx:913
#27 0x00007f1b41d229aa in TGLScene::RenderAllPasses (this=0x6d47680, rnrCtx=…, elVec=std::vector of length 3, capacity 4 = {…}, check_timeout=true) at /home/yassid/fair_install_ROOT6/FairSoft/tools/root/graf3d/gl/src/TGLScene.cxx:812
#28 0x00007f1b41d221d4 in TGLScene::RenderOpaque (this=0x6d47680, rnrCtx=…) at /home/yassid/fair_install_ROOT6/FairSoft/tools/root/graf3d/gl/src/TGLScene.cxx:612
#29 0x00007f1b41d5026f in TGLViewerBase::SubRenderScenes (this=0x6d68ba0, render_foo=&virtual table offset 144) at /home/yassid/fair_install_ROOT6/FairSoft/tools/root/graf3d/gl/src/TGLViewerBase.cxx:409
#30 0x00007f1b41d505fa in TGLViewerBase::RenderOpaque (this=0x6d68ba0, rnr_non_selected=true, rnr_selected=true) at /home/yassid/fair_install_ROOT6/FairSoft/tools/root/graf3d/gl/src/TGLViewerBase.cxx:490
#31 0x00007f1b41d502ef in TGLViewerBase::Render (this=0x6d68ba0) at /home/yassid/fair_install_ROOT6/FairSoft/tools/root/graf3d/gl/src/TGLViewerBase.cxx:423
#32 0x00007f1b41d195f4 in TGLViewer::Render (this=0x6d68b90) at /home/yassid/fair_install_ROOT6/FairSoft/tools/root/graf3d/gl/src/TGLViewer.cxx:519
#33 0x00007f1b41d19c76 in TGLViewer::DoDrawMono (this=0x6d68b90, swap_buffers=true) at /home/yassid/fair_install_ROOT6/FairSoft/tools/root/graf3d/gl/src/TGLViewer.cxx:636
#34 0x00007f1b41d19a5a in TGLViewer::DoDraw (this=0x6d68b90, swap_buffers=true) at /home/yassid/fair_install_ROOT6/FairSoft/tools/root/graf3d/gl/src/TGLViewer.cxx:598
#35 0x00007f1b41d193c2 in TGLViewer::RequestDraw (this=0x6d68b90, LODInput=100) at /home/yassid/fair_install_ROOT6/FairSoft/tools/root/graf3d/gl/src/TGLViewer.cxx:462
#36 0x00007f1b432a3042 in TEveViewerList::RepaintAllViewers (this=0x6cbeea0, resetCameras=true, dropLogicals=false) at /home/yassid/fair_install_ROOT6/FairSoft/tools/root/graf3d/eve/src/TEveViewer.cxx:487
#37 0x00007f1b4329234c in TEveManager::FullRedraw3D (this=0x5e667f0, resetCameras=true, dropLogicals=false) at /home/yassid/fair_install_ROOT6/FairSoft/tools/root/graf3d/eve/src/TEveManager.cxx:451
#38 0x00007f1b435f301f in FairEventManager::Init (this=0x5b162a0, visopt=, vislvl=3, maxvisnds=10000) at /home/yassid/fair_install_ROOT6/FairRoot/eventdisplay/FairEventManager.cxx:61
#39 0x00007f1b577302aa in ?? ()
#40 0x00000000059398f0 in ?? ()
#41 0x00007f1b52f9c4d8 in deallocate (this=, __p=) at /usr/include/c++/4.9.2/ext/new_allocator.h:110
#42 deallocate (__a=…, __n=1, __p=) at /usr/include/c++/4.9.2/bits/alloc_traits.h:383
#43 _M_put_node (this=0x7f1b577305c0, __p=) at /usr/include/c++/4.9.2/bits/stl_tree.h:389
#44 _M_destroy_node (this=0x7f1b577305c0, __p=) at /usr/include/c++/4.9.2/bits/stl_tree.h:438
#45 std::_Rb_tree<std::_List_iteratorllvm::ObjectLinkingLayerBase::LinkedObjectSet, std::pair<std::_List_iteratorllvm::ObjectLinkingLayerBase::LinkedObjectSet const, std::set<void const*, std::less<void const*>, std::allocator<void const*> > >, std::_Select1st<std::pair<std::_List_iteratorllvm::ObjectLinkingLayerBase::LinkedObjectSet const, std::set<void const*, std::less<void const*>, std::allocator<void const*> > > >, cling::IncrementalJIT::ObjSetHandleCompare, std::allocator<std::pair<std::_List_iteratorllvm::ObjectLinkingLayerBase::LinkedObjectSet const, std::set<void const*, std::less<void const*>, std::allocator<void const*> > > > >::_M_erase (this=0x7f1b577305c0, __x=) at /usr/include/c++/4.9.2/bits/stl_tree.h:1247
#46 0x0000000005628080 in ?? ()
#47 0x00000000020db060 in ?? ()
#48 0x00007f1b56e41790 in vtable for TString () from /home/yassid/fair_install_ROOT6/FairSoft.jul15p2/lib/root/
#49 0x0000001400000021 in ?? ()
#50 0x0000000005808040 in ?? ()
#51 0x0000000005935bf0 in ?? ()
#52 0x00007f1b56e41790 in vtable for TString () from /home/yassid/fair_install_ROOT6/FairSoft.jul15p2/lib/root/
#53 0x0000001500000021 in ?? ()
#54 0x000000000594e950 in ?? ()
#55 0x000000000076d490 in ?? ()
#56 0x000000000076d578 in ?? ()
#57 0x00007f1b56e41790 in vtable for TString () from /home/yassid/fair_install_ROOT6/FairSoft.jul15p2/lib/root/
#58 0x0000001400000021 in ?? ()
#59 0x0000000005924550 in ?? ()
#60 0x00007f1b56e41790 in vtable for TString () from /home/yassid/fair_install_ROOT6/FairSoft.jul15p2/lib/root/
#61 0x0000001400000021 in ?? ()
#62 0x000000000587baa0 in ?? ()
#63 0x00007ffd1692be60 in ?? ()
#64 0x00007ffd1692be60 in ?? ()
#65 0x00000000007684f0 in ?? ()
#66 0x0000000000000015 in ?? ()
#67 0x00007ffd1692ba50 in ?? ()
#68 0x00007f1b5773002b in ?? ()
#69 0x00007ffd1692bac0 in ?? ()
#70 0x00007ffd1692be60 in ?? ()
#71 0x000000000076c7f0 in ?? ()
#72 0x0000000005928498 in ?? ()
#73 0x00007ffd1692bac0 in ?? ()
#74 0x00007f1b52f4abd6 in executeWrapper (returnValue=0x5b162a0, function=…, this=0x5c21c50) at /home/yassid/fair_install_ROOT6/FairSoft/tools/root/interpreter/cling/lib/Interpreter/IncrementalExecutor.h:181
#75 cling::Interpreter::RunFunction (this=, FD=, res=0x5b162a0) at /home/yassid/fair_install_ROOT6/FairSoft/tools/root/interpreter/cling/lib/Interpreter/Interpreter.cpp:755
#76 0x00007f1b52f5054e in cling::Interpreter::EvaluateInternal (this=0x7684f0, input=“eventDisplay() /* invoking function corresponding to ‘.x’ /", CO=…, V=V
entry=0x7ffd1692be60, T=T
entry=0x0) at /home/yassid/fair_install_ROOT6/FairSoft/tools/root/interpreter/cling/lib/Interpreter/Interpreter.cpp:995
#77 0x00007f1b52f5078f in cling::Interpreter::echo (this=, input="eventDisplay() /
invoking function corresponding to ‘.x’ */”, V=V
entry=0x7ffd1692be60) at /home/yassid/fair_install_ROOT6/FairSoft/tools/root/interpreter/cling/lib/Interpreter/Interpreter.cpp:622
#78 0x00007f1b52ff2f39 in cling::MetaSema::actOnxCommand (this=0x796630, file=…, args=…, result=result
entry=0x7ffd1692be60) at /home/yassid/fair_install_ROOT6/FairSoft/tools/root/interpreter/cling/lib/MetaProcessor/MetaSema.cpp:125
#79 0x00007f1b52ffe9f9 in cling::MetaParser::isXCommand (this=this
entry=0x142c570, actionResult=
0x7ffd1692bdbc: cling::MetaSema::AR_Success, resultValue=resultValue
entry=0x7ffd1692be60) at /home/yassid/fair_install_ROOT6/FairSoft/tools/root/interpreter/cling/lib/MetaProcessor/MetaParser.cpp:272
#80 0x00007f1b52fffa8e in cling::MetaParser::isCommand (this=0x142c570, actionResult=
0x7ffd1692bdbc: cling::MetaSema::AR_Success, resultValue=0x7ffd1692be60) at /home/yassid/fair_install_ROOT6/FairSoft/tools/root/interpreter/cling/lib/MetaProcessor/MetaParser.cpp:124
#81 0x00007f1b52fecb23 in cling::MetaProcessor::process (this=0xa49c30, input_text=0x1b32a70 “.X /home/yassid/fair_install_ROOT6/ATTPCROOT/macro/Simulation/./eventDisplay.C”, compRes=
0x7ffd1692c19c: cling::Interpreter::kSuccess, result=0x7ffd1692be60) at /home/yassid/fair_install_ROOT6/FairSoft/tools/root/interpreter/cling/lib/MetaProcessor/MetaProcessor.cpp:138

Root > Error in TGLLockable::TakeLock: ‘TGLSceneBase Geometry scene’ unable to take ModifyLock, already DrawLock
Error in TGLLockable::ReleaseLock: ‘TGLSceneBase Geometry scene’ unable to release ModifyLock, is DrawLock[/code]

Thank you very much again!

Sure … you’re welcome :slight_smile: Sorry I missed your question originally, I usually scan the forum for GL / EVE questions every day :frowning:

As this goes through mesa, you could try

It seems the problem is with definitions of display lists (from the call to _mesa_EndList()) and from: … e.cxx#L414

It might be it’s the GL_COMPILE_AND_EXECUTE that’s troubling the beast. Can you try using GL_COMPILE and then just calling
glCallList(fDLBase + off);
at the end of the block?

As this happens before any draw commands are passed I assume it doesn’t matter what we try to define in this display list and this happens the first time we try to create a display list … otherwise it would be interesting to know in which subclass of TGLLogical shape it happens.

What seems super strange is that you have this problem with root-6 and not 5 … graf3d/gl and eve are practically the same in both branches.


Nailed it.
Thank you for your kind help :slight_smile:

Hi again

I just wanted to provide more feedback on the problem itself to help the developers. The only part that it is not understood is why it crashes in ROOT6.

After fixing the previous problem in ROOT6, forcing TH3 histograms to be drawn with the gl option makes the program crash on exit (.q) if the TCanvas is embedded in any TEveManager window. The error is this one: Error in : GLXBadContextTag.

In ROOT5, the glcolz option makes the framework crash (again with the TCanvas embedded in the TEveManager window) even after forcing the gStyle->SetCanvasPreferGL(kTRUE); option. Options like box1, lego and so on are properly working.

If I run one of the tutorial macros on the gl folder of root, everything works smoothly.

I keep on debugging.
Best regards


Thanks for looking into this. My guess would be that TRootCanvas does not destroy the gl context it is using for gl-in-pad soon enough … or that somebody tries to draw into it after it is destroyed.

Do you have a short macro showing the problem?



Thank you very much for the reply and sorry for the late answer, I am just taking care of other issues. Just a brief update, an independent canvas with the gl option also makes the program crash. I am trying to find other solutions already working with the TEveManager class (the ones from the tutorials).

I will try to prepare some macro you could run, the problem is that any of these macros use libraries from the framework and from FairRoot package (from GSI).

I will keep updating if I find a solution to this.

Best regards