[SOLVED]Segmentaion fault when I import anything from ROOT

Hi,

I’ve installed pyROOT as explained here:
root.cern.ch/drupal/content/how- … nterpreter

in my $ROOTSYS/lib, there are ROOT.py and libPyROOT.so as it should be.

I defined environment variables:

export LD_LIBRARY_PATH=$ROOTSYS/lib:$PYTHONDIR/lib:$LD_LIBRARY_PATH
export PYTHONPATH=$ROOTSYS/lib:$PYTHONPATH

However I can’t import anything from ROOT in python. I get

 *** Break *** segmentation violation
Segmentation fault

I can import libPyROOT, but not anything from ROOT. What can it be?

OS: Ubuntu 9.04 Jaunty
Root version: 5.26
python version: 2.6.2

Hi,

import ROOT does not do all that much more than import libPyROOT (until access of first objects, that is). Can you run the code under gdb to get a more informative stack trace?

[code]$ gdb python
(gdb) run

import ROOT
(gdb) where[/code]
Cheers,
Wim

If I run under gdb, I get this output

Program received signal SIGSEGV, Segmentation fault.
[Switching to Thread 0xb7e216c0 (LWP 16554)]
0x080a7a76 in ?? ()
(gdb) where
#0  0x080a7a76 in ?? ()
#1  0x080b828f in ?? ()
#2  0xb7c252e2 in PyROOT::(anonymous namespace)::pt_getattro ()
   from /home/cyildiz/program/root/lib/libPyROOT.so
#3  0xb7c2ac08 in PyROOT::Pythonize ()
   from /home/cyildiz/program/root/lib/libPyROOT.so
#4  0xb7c37e1b in PyROOT::MakeRootClassFromString<PyROOT::TScopeAdapter, PyROOT::TBaseAdapter, PyROOT::TMemberAdapter> ()
   from /home/cyildiz/program/root/lib/libPyROOT.so
#5  0xb7c303e3 in PyROOT::MakeRootClass ()
   from /home/cyildiz/program/root/lib/libPyROOT.so
#6  0x080de562 in PyEval_EvalFrameEx ()
#7  0x080e00b8 in PyEval_EvalCodeEx ()
#8  0x080de5f8 in PyEval_EvalFrameEx ()
#9  0x080e00b8 in PyEval_EvalCodeEx ()
#10 0x080e0217 in PyEval_EvalCode ()
#11 0x080f21a9 in PyImport_ExecCodeModuleEx ()
#12 0x080f301d in ?? ()
#13 0x080f3e19 in ?? ()
#14 0x080f40ba in ?? ()
#15 0x080f4692 in ?? ()
#16 0x080f4c52 in PyImport_ImportModuleLevel ()
#17 0x080d8464 in ?? ()
---Type <return> to continue, or q <return> to quit---
#18 0x0806111a in PyObject_Call ()
#19 0x080d8922 in PyEval_CallObjectWithKeywords ()
#20 0x080dae40 in PyEval_EvalFrameEx ()
#21 0x080e00b8 in PyEval_EvalCodeEx ()
#22 0x080e0217 in PyEval_EvalCode ()
#23 0x080fdc45 in PyRun_InteractiveOneFlags ()
#24 0x080fded8 in PyRun_InteractiveLoopFlags ()
#25 0x080fe716 in PyRun_AnyFileExFlags ()
#26 0x0805c882 in Py_Main ()
#27 0x0805b972 in main ()

I downloaded new source of root 5.27 and compiled with python support. This time it worked, maybe it was a version incompatibility problem.

Thanks for your help :wink:

Hi,

just for reference: if before you downloaded a binary from root.cern.ch, then that would’ve been compiled against python 2.5.

Cheers,
Wim