Failing to include TEveManager in a binary executable

Hi,

when trying to use TEveManager in a binary I get a crash during the graphics initialization when running the binary. The following code successfully compiles

#include <TEveManager.h>

int main(int argc, char* argv[]) {

  TEveManager* pEve = TEveManager::Create();

  return 0;
}

using the following command

g++ -std=c++17 -I /cvmfs/fairsoft.gsi.de/debian10/fairsoft/nov22p1/include/root/ -L /cvmfs/fairsoft.gsi.de/debian10/fairsoft/nov22p1/lib -l Graf3d -l Core -l Eve -Wl,-rpath,/cvmfs/fairsoft.gsi.de/debian10/fairsoft/nov22p1/lib test_root.cxx

but when executing the binary the code crashes with the following error

lxi100:/u/uhlig ! ./a.out

*** Break *** segmentation violation

===========================================================

There was a crash.

This is the entire stack trace of all threads:

===========================================================

#0 0x00007f78617812d7 in __GI___waitpid (pid=24289, stat_loc=stat_loc

entry=0x7fff2845cb88, options=options

entry=0) at ../sysdeps/unix/sysv/linux/waitpid.c:30

#1 0x00007f78616ff70f in do_system (line=<optimized out>) at ../sysdeps/posix/system.c:149

#2 0x00007f7862253913 in TUnixSystem::Exec (shellcmd=<optimized out>, this=0x55d8effed260) at /home/uhlig/containers/home/debian10/software/fairsoft/nov22p1/build/Source/root/core/unix/src/TUnixSystem.cxx:2104

#3 TUnixSystem::StackTrace (this=0x55d8effed260) at /home/uhlig/containers/home/debian10/software/fairsoft/nov22p1/build/Source/root/core/unix/src/TUnixSystem.cxx:2395

#4 0x00007f7862255c55 in TUnixSystem::DispatchSignals (this=0x55d8effed260, sig=kSigSegmentationViolation) at /home/uhlig/containers/home/debian10/software/fairsoft/nov22p1/build/Source/root/core/unix/src/TUnixSystem.cxx:3615

#5 <signal handler called>

#6 0x00007f786211da91 in TApplication::InitializeGraphics (this=0x0) at /home/uhlig/containers/home/debian10/software/fairsoft/nov22p1/build/Source/root/core/base/src/TApplication.cxx:248

#7 TApplication::InitializeGraphics (this=0x0) at /home/uhlig/containers/home/debian10/software/fairsoft/nov22p1/build/Source/root/core/base/src/TApplication.cxx:243

#8 0x00007f7861dfcfa6 in TEveManager::Create (map_window=<optimized out>, opt=0x55d8eec321fd "FIV") at /home/uhlig/containers/home/debian10/software/fairsoft/nov22p1/build/Source/root/graf3d/eve/src/TEveManager.cxx:904

#9 0x000055d8eec31165 in main ()

===========================================================

The lines below might hint at the cause of the crash.

You may get help by asking at the ROOT forum https://root.cern/forum

Only if you are really convinced it is a bug in ROOT then please submit a

report at https://root.cern/bugs Please post the ENTIRE stack trace

from above as an attachment in addition to anything else

that might help us fixing this issue.

===========================================================

#6 0x00007f786211da91 in TApplication::InitializeGraphics (this=0x0) at /home/uhlig/containers/home/debian10/software/fairsoft/nov22p1/build/Source/root/core/base/src/TApplication.cxx:248

#7 TApplication::InitializeGraphics (this=0x0) at /home/uhlig/containers/home/debian10/software/fairsoft/nov22p1/build/Source/root/core/base/src/TApplication.cxx:243

#8 0x00007f7861dfcfa6 in TEveManager::Create (map_window=<optimized out>, opt=0x55d8eec321fd "FIV") at /home/uhlig/containers/home/debian10/software/fairsoft/nov22p1/build/Source/root/graf3d/eve/src/TEveManager.cxx:904

#9 0x000055d8eec31165 in main ()

===========================================================

I hope you can help me to find out what I am doing wrong.

Ciao

Florian


ROOT Version: 6.26/10
Platform: Linux and Macosx
Compiler: gcc and clang


Okay. Found the problem meanwhile myself. I forgot to create a TApplication since I thought this is done automatically.

The following code works as expected

#include <TEveManager.h>
#include <TApplication.h>

int main(int argc, char** argv) {

  TApplication* app = new TApplication("RootApp", &argc, argv);
  TEveManager* pEve = TEveManager::Create();

  app->Run();
  return 0;
}

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