# pyRoot ROOT.gROOT.SetBatch(True) is still loading X11 libraries and crashing due to X11

**URL:** <https://root-forum.cern.ch/t/pyroot-root-groot-setbatch-true-is-still-loading-x11-libraries-and-crashing-due-to-x11/31186>\
**Category:** ROOT\
**Tags:** python\
**Created:** [October 19, 2018, 8:22am UTC](https://root-forum.cern.ch/t/pyroot-root-groot-setbatch-true-is-still-loading-x11-libraries-and-crashing-due-to-x11/31186 "2018-10-19T08:22:31Z")\
**Posts on this page:** 10\
**Page:** 1

<div class="post-metadata">

**Author:** ![adsherman](https://root-forum.cern.ch/letter_avatar_proxy/v4/letter/a/73ab20/32.png) [@adsherman](https://root-forum.cern.ch/u/adsherman)\
**Post date:** [October 19, 2018, 8:22am UTC](https://root-forum.cern.ch/t/pyroot-root-groot-setbatch-true-is-still-loading-x11-libraries-and-crashing-due-to-x11/31186/1 "2018-10-19T08:22:31Z")

</div>

* * *

_ROOT Version:_ 6.04  
_Platform:_ CentOS 6.4 (final)  
_Compiler:_ Not Provided

* * *

I am debugging X11 crashes in some analysis code, stepping off from this thread [Error in \<RootX11IOErrorHandler\>: fatal X11 error (connection to server lost?!) during nohup](https://root-forum.cern.ch/t/error-in-rootx11ioerrorhandler-fatal-x11-error-connection-to-server-lost-during-nohup/30738)

After printing out ROOT.gSystem.GetLibraries(), I still have /usr/lib64/libX11-xcb.so.1 /usr/lib64/libX11.so.6 in the list of libraries. And I still get the Error in : fatal X11 error (connection to server lost?!) error if I disconnect my session while it is running, even while running in batch mode and nohup’d.

This severley limits my ability to run large jobs especially if I need to move my laptop, and I would appreciate any help I can get. The very first thing I do in the steering macro is:

```auto
ROOT.PyConfig.IgnoreCommandLineOptions = True # stop PyRoot hijacking -h WHY DOESNT THIS ALWAYS WORK
ROOT.gROOT.SetBatch(True) # Don't want to plot these to screen as we generate them

```

and the first thing I do in **main** is:

```auto
if __name__ == " __main__":
    
    ROOT.gROOT.SetBatch(True) # Don't want to plot these to screen as we generate them
    print ROOT.gSystem.GetLibraries()# [x for x in ROOT.gSystem.GetLibraries() if "X11" in x or "x11" in x]

```

---

<div class="post-metadata">

**Author:** ![couet](https://root-forum.cern.ch/user_avatar/root-forum.cern.ch/couet/32/12037_2.png) [@couet](https://root-forum.cern.ch/u/couet)\
**Post date:** [October 19, 2018, 8:30am UTC](https://root-forum.cern.ch/t/pyroot-root-groot-setbatch-true-is-still-loading-x11-libraries-and-crashing-due-to-x11/31186/2 "2018-10-19T08:30:03Z")

</div>

Do you have this problem only when you run with python ?  
Does a .C script work ?  
Are you running run locally or remotely ?

---

<div class="post-metadata">

**Author:** ![adsherman](https://root-forum.cern.ch/letter_avatar_proxy/v4/letter/a/73ab20/32.png) [@adsherman](https://root-forum.cern.ch/u/adsherman)\
**Post date:** [October 19, 2018, 8:37am UTC](https://root-forum.cern.ch/t/pyroot-root-groot-setbatch-true-is-still-loading-x11-libraries-and-crashing-due-to-x11/31186/3 "2018-10-19T08:37:58Z")

</div>

Only python  
I don’t have the same macros in a .C script so I have not checked it  
Remotely, through ssh

---

<div class="post-metadata">

**Author:** ![couet](https://root-forum.cern.ch/user_avatar/root-forum.cern.ch/couet/32/12037_2.png) [@couet](https://root-forum.cern.ch/u/couet)\
**Post date:** [October 19, 2018, 8:43am UTC](https://root-forum.cern.ch/t/pyroot-root-groot-setbatch-true-is-still-loading-x11-libraries-and-crashing-due-to-x11/31186/4 "2018-10-19T08:43:50Z")

</div>

If it is related to python may be @etejedor has an idea.

Does a very simple line command works ?  
For instance:

```auto
root [0] TCanvas C

```

---

<div class="post-metadata">

**Author:** ![adsherman](https://root-forum.cern.ch/letter_avatar_proxy/v4/letter/a/73ab20/32.png) [@adsherman](https://root-forum.cern.ch/u/adsherman)\
**Post date:** [October 19, 2018, 9:46am UTC](https://root-forum.cern.ch/t/pyroot-root-groot-setbatch-true-is-still-loading-x11-libraries-and-crashing-due-to-x11/31186/5 "2018-10-19T09:46:12Z")

</div>

This command threw a segmentation fault actually. It is worth noting that I am using a virtual environment via anaconda

---

<div class="post-metadata">

**Author:** ![etejedor](https://root-forum.cern.ch/letter_avatar_proxy/v4/letter/e/e79b87/32.png) [@etejedor](https://root-forum.cern.ch/u/etejedor)\
**Post date:** [October 19, 2018, 11:31am UTC](https://root-forum.cern.ch/t/pyroot-root-groot-setbatch-true-is-still-loading-x11-libraries-and-crashing-due-to-x11/31186/6 "2018-10-19T11:31:58Z")

</div>

What is the command that threw a segfault? Just trying to create a TCanvas from the ROOT prompt?

---

<div class="post-metadata">

**Author:** ![adsherman](https://root-forum.cern.ch/letter_avatar_proxy/v4/letter/a/73ab20/32.png) [@adsherman](https://root-forum.cern.ch/u/adsherman)\
**Post date:** [October 19, 2018, 11:32am UTC](https://root-forum.cern.ch/t/pyroot-root-groot-setbatch-true-is-still-loading-x11-libraries-and-crashing-due-to-x11/31186/7 "2018-10-19T11:32:42Z")

</div>

Yes just exactly that:

```auto
(tZqAnalysis) -bash-4.1$ root
root [0] TCanvas C
cling::DynamicLibraryManager::loadLibrary(): libjpeg.so.8: cannot open shared object file: No such file or directory
cling::DynamicLibraryManager::loadLibrary(): libjpeg.so.8: cannot open shared object file: No such file or directory
cling::DynamicLibraryManager::loadLibrary(): libjpeg.so.8: cannot open shared object file: No such file or directory
Error in <TInterpreter::TCling::AutoLoad>: failure loading library libASImage.so for TASImage
cling::DynamicLibraryManager::loadLibrary(): libjpeg.so.8: cannot open shared object file: No such file or directory
cling::DynamicLibraryManager::loadLibrary(): libjpeg.so.8: cannot open shared object file: No such file or directory
Error in <TInterpreter::TCling::AutoLoad>: failure loading library libASImage.so for TASImage
cling::DynamicLibraryManager::loadLibrary(): libjpeg.so.8: cannot open shared object file: No such file or directory
Error in <TGHScrollBar::TGHScrollBar>: arrow_*.xpm not found
cling::DynamicLibraryManager::loadLibrary(): libjpeg.so.8: cannot open shared object file: No such file or directory
Error in <TInterpreter::TCling::AutoLoad>: failure loading library libASImage.so for TASImage
cling::DynamicLibraryManager::loadLibrary(): libjpeg.so.8: cannot open shared object file: No such file or directory
cling::DynamicLibraryManager::loadLibrary(): libjpeg.so.8: cannot open shared object file: No such file or directory
Error in <TInterpreter::TCling::AutoLoad>: failure loading library libASImage.so for TASImage
cling::DynamicLibraryManager::loadLibrary(): libjpeg.so.8: cannot open shared object file: No such file or directory
Error in <TGVScrollBar::TGVScrollBar>: arrow_*.xpm not found
cling::DynamicLibraryManager::loadLibrary(): libjpeg.so.8: cannot open shared object file: No such file or directory
Error in <TInterpreter::TCling::AutoLoad>: failure loading library libASImage.so for TASImage
cling::DynamicLibraryManager::loadLibrary(): libjpeg.so.8: cannot open shared object file: No such file or directory

```

---

<div class="post-metadata">

**Author:** ![couet](https://root-forum.cern.ch/user_avatar/root-forum.cern.ch/couet/32/12037_2.png) [@couet](https://root-forum.cern.ch/u/couet)\
**Post date:** [October 19, 2018, 12:41pm UTC](https://root-forum.cern.ch/t/pyroot-root-groot-setbatch-true-is-still-loading-x11-libraries-and-crashing-due-to-x11/31186/8 "2018-10-19T12:41:36Z")

</div>

So it is not a python issue. May be there is something special with the anaconda environment . @amadio may know.

---

<div class="post-metadata">

**Author:** ![amadio](https://root-forum.cern.ch/user_avatar/root-forum.cern.ch/amadio/32/12562_2.png) [@amadio](https://root-forum.cern.ch/u/amadio)\
**Post date:** [October 19, 2018, 12:49pm UTC](https://root-forum.cern.ch/t/pyroot-root-groot-setbatch-true-is-still-loading-x11-libraries-and-crashing-due-to-x11/31186/9 "2018-10-19T12:49:43Z")

</div>

> [@](#):
>
> This severley limits my ability to run large jobs especially if I need to move my laptop

Are you using CVMFS and losing access to the network? Or maybe loading data files from the network?

> [@adsherman](#):
>
> It is worth noting that I am using a virtual environment via anaconda

If you are using a special environment, it is likely that you are replacing libraries ROOT depends on (or removing directories from `LD_LIBRARY_PATH`) when you enter the environment, which then makes ROOT fail to open its dependency libraries, or makes it try to load incompatible libraries than the ones it was compiled with. We need more information about your environment to understand what exactly is causing the problem, but it doesn’t look like a problem with ROOT, but with your particular setup. Please print `LD_LIBRARY_PATH` before and after you enter your virtual environment, and please let us know how you installed ROOT. In particular the outputs of `which root` and `ldd $(which root)` from before and after you enter your environment would be useful as well.

---

<div class="post-metadata">

**Author:** ![system](https://root-forum.cern.ch/uploads/default/original/3X/e/f/efe4f24398fd8ffeb76bccb6ecc46d9d9c003376.png) [@system](https://root-forum.cern.ch/u/system)\
**Post date:** [November 2, 2018, 12:49pm UTC](https://root-forum.cern.ch/t/pyroot-root-groot-setbatch-true-is-still-loading-x11-libraries-and-crashing-due-to-x11/31186/10 "2018-11-02T12:49:46Z")

</div>

Closed on November 2, 2018, 12:49pm UTC

This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.
