ROOT.py import seg fault

Hi,

I’m running ROOT 5.32 on GNU/Linux and python 2.7. Both build and run fine individually, but importing ROOT.py into python causes a seg fault, any help?

[code]mm613> python
Python 2.7.3rc1 (default, Feb 26 2012, 10:02:58)
[GCC 4.1.2 20080704 (Red Hat 4.1.2-50)] on linux2
Type “help”, “copyright”, “credits” or “license” for more information.

import ROOT

*** Break *** segmentation violation

===========================================================
There was a crash.
This is the entire stack trace of all threads:

#0 0x00002aaaab608115 in waitpid () from /lib64/libc.so.6
#1 0x00002aaaab5aa481 in do_system () from /lib64/libc.so.6
#2 0x00002aaab1d168f2 in TUnixSystem::StackTrace() () from /home/m/mm/mm613/snoplus/software/root/lib/libCore.so
#3 0x00002aaab1d1378a in TUnixSystem::DispatchSignals(ESignals) () from /home/m/mm/mm613/snoplus/software/root/lib/libCore.so
#4
#5 0x00002aaaaf10486e in __static_initialization_and_destruction_0 () from //home/m/mm/mm613/snoplus/software/root/lib/libPyROOT.so
#6 0x00002aaaaf137a36 in __do_global_ctors_aux () from //home/m/mm/mm613/snoplus/software/root/lib/libPyROOT.so
#7 0x00002aaaaf0e74ab in _init () from //home/m/mm/mm613/snoplus/software/root/lib/libPyROOT.so
#8 0x00002aaaaf0d44a0 in ?? () from //home/m/mm/mm613/snoplus/software/root/lib/libPyROOT.so
#9 0x00002aaaaaab831b in call_init () from /lib64/ld-linux-x86-64.so.2
#10 0x00002aaaaaab8425 in _dl_init_internal () from /lib64/ld-linux-x86-64.so.2
#11 0x00002aaaaaabbf7e in dl_open_worker () from /lib64/ld-linux-x86-64.so.2
#12 0x00002aaaaaab7fa6 in _dl_catch_error () from /lib64/ld-linux-x86-64.so.2
#13 0x00002aaaaaabb75c in _dl_open () from /lib64/ld-linux-x86-64.so.2
#14 0x00002aaaaaee3f9a in dlopen_doit () from /lib64/libdl.so.2
#15 0x00002aaaaaab7fa6 in _dl_catch_error () from /lib64/ld-linux-x86-64.so.2
#16 0x00002aaaaaee450d in _dlerror_run () from /lib64/libdl.so.2
#17 0x00002aaaaaee3f11 in dlopen

GLIBC_2.2.5 () from /lib64/libdl.so.2
#18 0x00000000004d02b7 in PyImport_GetDynLoadFunc (fqname=, shortname=0x7fffffff9a40 “libPyROOT”,
pathname=0x7fffffff8980 “//home/m/mm/mm613/snoplus/software/root/lib/libPyROOT.so”, fp=0x89a9f0) at Python/dynload_shlib.c:130
#19 0x00000000004b5b08 in PyImport_LoadDynamicModule (name=0x7fffffff9a40 “libPyROOT”,
pathname=0x7fffffff8980 “//home/m/mm/mm613/snoplus/software/root/lib/libPyROOT.so”, fp=0x89a9f0) at ./Python/importdl.c:42
#20 0x00000000004b390f in import_submodule (mod=0x769fe0, subname=0x7fffffff9a40 “libPyROOT”, fullname=0x7fffffff9a40 “libPyROOT”) at Python/import.c:2595
#21 0x00000000004b3dd2 in load_next (mod=0x769fe0, altmod=0x769fe0, p_name=, buf=0x7fffffff9a40 “libPyROOT”, p_buflen=0x7fffffffaa50)
at Python/import.c:2415
#22 0x00000000004b4754 in import_module_level (name=, globals=0x84d080, locals=, fromlist=0x769fe0, level=-1)
at Python/import.c:2136
#23 PyImport_ImportModuleLevel (name=, globals=0x84d080, locals=, fromlist=0x769fe0, level=-1) at Python/import.c:2188
#24 0x0000000000494989 in builtin___import
(self=, args=, kwds=) at Python/bltinmodule.c:49
#25 0x00000000004189cd in PyObject_Call (func=0x2aaaaab0ddd0, arg=0x2aaaaac10208, kw=0x0) at Objects/abstract.c:2529
#26 0x0000000000494e76 in PyEval_CallObjectWithKeywords (func=0x2aaaaab0ddd0, arg=0x2aaaaac10208, kw=0x0) at Python/ceval.c:3890
#27 0x0000000000499b78 in PyEval_EvalFrameEx (f=0x881540, throwflag=) at Python/ceval.c:2333
#28 0x000000000049dd1b in PyEval_EvalCodeEx (co=0x2aaaaac0eab0, globals=, locals=, args=0x0, argcount=0, kws=0x0, kwcount=0,
defs=0x0, defcount=0, closure=0x0) at Python/ceval.c:3253
#29 0x000000000049dd92 in PyEval_EvalCode (co=0xb69730, globals=0x0, locals=0x0) at Python/ceval.c:667
#30 0x00000000004b24e0 in PyImport_ExecCodeModuleEx (name=0x7fffffffd010 “ROOT”, co=0x2aaaaac0eab0,
pathname=0x7fffffffae50 “//home/m/mm/mm613/snoplus/software/root/lib/ROOT.pyc”) at Python/import.c:681
#31 0x00000000004b31ef in load_source_module (name=0x7fffffffd010 “ROOT”, pathname=0x7fffffffae50 “//home/m/mm/mm613/snoplus/software/root/lib/ROOT.pyc”,
fp=) at Python/import.c:1018
#32 0x00000000004b390f in import_submodule (mod=0x769fe0, subname=0x7fffffffd010 “ROOT”, fullname=0x7fffffffd010 “ROOT”) at Python/import.c:2595
#33 0x00000000004b3dd2 in load_next (mod=0x769fe0, altmod=0x769fe0, p_name=, buf=0x7fffffffd010 “ROOT”, p_buflen=0x7fffffffe020)
at Python/import.c:2415
#34 0x00000000004b4754 in import_module_level (name=, globals=0x7e7150, locals=, fromlist=0x769fe0, level=-1)
at Python/import.c:2136
#35 PyImport_ImportModuleLevel (name=, globals=0x7e7150, locals=, fromlist=0x769fe0, level=-1) at Python/import.c:2188
#36 0x0000000000494989 in builtin___import__ (self=, args=, kwds=) at Python/bltinmodule.c:49
#37 0x00000000004189cd in PyObject_Call (func=0x2aaaaab0ddd0, arg=0x2aaaaabc3db8, kw=0x0) at Objects/abstract.c:2529
#38 0x0000000000494e76 in PyEval_CallObjectWithKeywords (func=0x2aaaaab0ddd0, arg=0x2aaaaabc3db8, kw=0x0) at Python/ceval.c:3890
#39 0x0000000000499b78 in PyEval_EvalFrameEx (f=0x881140, throwflag=) at Python/ceval.c:2333
#40 0x000000000049dd1b in PyEval_EvalCodeEx (co=0x2aaaaabd3730, globals=, locals=, args=0x0, argcount=0, kws=0x0, kwcount=0,
defs=0x0, defcount=0, closure=0x0) at Python/ceval.c:3253
#41 0x000000000049dd92 in PyEval_EvalCode (co=0xb69730, globals=0x0, locals=0x0) at Python/ceval.c:667
#42 0x00000000004bf9f6 in run_mod (fp=0x2aaaab8c06a0, filename=0x518127 “”, flags=0x7fffffffe540) at Python/pythonrun.c:1353
#43 PyRun_InteractiveOneFlags (fp=0x2aaaab8c06a0, filename=0x518127 “”, flags=0x7fffffffe540) at Python/pythonrun.c:852
#44 0x00000000004bfc14 in PyRun_InteractiveLoopFlags (fp=0x2aaaab8c06a0, filename=0x518127 “”, flags=0x7fffffffe540) at Python/pythonrun.c:772
#45 0x00000000004c035a in PyRun_AnyFileExFlags (fp=0x2aaaab8c06a0, filename=0x518127 “”, closeit=0, flags=0x7fffffffe540) at Python/pythonrun.c:741
#46 0x0000000000414bbd in Py_Main (argc=, argv=) at Modules/main.c:639
#47 0x00002aaaab58b994 in __libc_start_main () from /lib64/libc.so.6
#48 0x0000000000413d69 in _start ()

The lines below might hint at the cause of the crash.
If they do not help you then please submit a bug report at
http://root.cern.ch/bugs. Please post the ENTIRE stack trace
from above as an attachment in addition to anything else
that might help us fixing this issue.

#5 0x00002aaaaf10486e in __static_initialization_and_destruction_0 () from //home/m/mm/mm613/snoplus/software/root/lib/libPyROOT.so
#6 0x00002aaaaf137a36 in __do_global_ctors_aux () from //home/m/mm/mm613/snoplus/software/root/lib/libPyROOT.so
#7 0x00002aaaaf0e74ab in _init () from //home/m/mm/mm613/snoplus/software/root/lib/libPyROOT.so
#8 0x00002aaaaf0d44a0 in ?? () from //home/m/mm/mm613/snoplus/software/root/lib/libPyROOT.so
#9 0x00002aaaaaab831b in call_init () from /lib64/ld-linux-x86-64.so.2
#10 0x00002aaaaaab8425 in _dl_init_internal () from /lib64/ld-linux-x86-64.so.2
#11 0x00002aaaaaabbf7e in dl_open_worker () from /lib64/ld-linux-x86-64.so.2
#12 0x00002aaaaaab7fa6 in _dl_catch_error () from /lib64/ld-linux-x86-64.so.2
#13 0x00002aaaaaabb75c in _dl_open () from /lib64/ld-linux-x86-64.so.2
#14 0x00002aaaaaee3f9a in dlopen_doit () from /lib64/libdl.so.2
#15 0x00002aaaaaab7fa6 in _dl_catch_error () from /lib64/ld-linux-x86-64.so.2
#16 0x00002aaaaaee450d in _dlerror_run () from /lib64/libdl.so.2
#17 0x00002aaaaaee3f11 in dlopen

GLIBC_2.2.5 () from /lib64/libdl.so.2
#18 0x00000000004d02b7 in PyImport_GetDynLoadFunc (fqname=, shortname=0x7fffffff9a40 “libPyROOT”,
pathname=0x7fffffff8980 “//home/m/mm/mm613/snoplus/software/root/lib/libPyROOT.so”, fp=0x89a9f0) at Python/dynload_shlib.c:130
#19 0x00000000004b5b08 in PyImport_LoadDynamicModule (name=0x7fffffff9a40 “libPyROOT”,
pathname=0x7fffffff8980 “//home/m/mm/mm613/snoplus/software/root/lib/libPyROOT.so”, fp=0x89a9f0) at ./Python/importdl.c:42
#20 0x00000000004b390f in import_submodule (mod=0x769fe0, subname=0x7fffffff9a40 “libPyROOT”, fullname=0x7fffffff9a40 “libPyROOT”) at Python/import.c:2595
#21 0x00000000004b3dd2 in load_next (mod=0x769fe0, altmod=0x769fe0, p_name=, buf=0x7fffffff9a40 “libPyROOT”, p_buflen=0x7fffffffaa50)
at Python/import.c:2415
#22 0x00000000004b4754 in import_module_level (name=, globals=0x84d080, locals=, fromlist=0x769fe0, level=-1)
at Python/import.c:2136
#23 PyImport_ImportModuleLevel (name=, globals=0x84d080, locals=, fromlist=0x769fe0, level=-1) at Python/import.c:2188
#24 0x0000000000494989 in builtin___import
(self=, args=, kwds=) at Python/bltinmodule.c:49
#25 0x00000000004189cd in PyObject_Call (func=0x2aaaaab0ddd0, arg=0x2aaaaac10208, kw=0x0) at Objects/abstract.c:2529
#26 0x0000000000494e76 in PyEval_CallObjectWithKeywords (func=0x2aaaaab0ddd0, arg=0x2aaaaac10208, kw=0x0) at Python/ceval.c:3890
#27 0x0000000000499b78 in PyEval_EvalFrameEx (f=0x881540, throwflag=) at Python/ceval.c:2333
#28 0x000000000049dd1b in PyEval_EvalCodeEx (co=0x2aaaaac0eab0, globals=, locals=, args=0x0, argcount=0, kws=0x0, kwcount=0,
defs=0x0, defcount=0, closure=0x0) at Python/ceval.c:3253
#29 0x000000000049dd92 in PyEval_EvalCode (co=0xb69730, globals=0x0, locals=0x0) at Python/ceval.c:667
#30 0x00000000004b24e0 in PyImport_ExecCodeModuleEx (name=0x7fffffffd010 “ROOT”, co=0x2aaaaac0eab0,
pathname=0x7fffffffae50 “//home/m/mm/mm613/snoplus/software/root/lib/ROOT.pyc”) at Python/import.c:681
#31 0x00000000004b31ef in load_source_module (name=0x7fffffffd010 “ROOT”, pathname=0x7fffffffae50 “//home/m/mm/mm613/snoplus/software/root/lib/ROOT.pyc”,
fp=) at Python/import.c:1018
#32 0x00000000004b390f in import_submodule (mod=0x769fe0, subname=0x7fffffffd010 “ROOT”, fullname=0x7fffffffd010 “ROOT”) at Python/import.c:2595
#33 0x00000000004b3dd2 in load_next (mod=0x769fe0, altmod=0x769fe0, p_name=, buf=0x7fffffffd010 “ROOT”, p_buflen=0x7fffffffe020)
at Python/import.c:2415
#34 0x00000000004b4754 in import_module_level (name=, globals=0x7e7150, locals=, fromlist=0x769fe0, level=-1)
at Python/import.c:2136
#35 PyImport_ImportModuleLevel (name=, globals=0x7e7150, locals=, fromlist=0x769fe0, level=-1) at Python/import.c:2188
#36 0x0000000000494989 in builtin___import__ (self=, args=, kwds=) at Python/bltinmodule.c:49
#37 0x00000000004189cd in PyObject_Call (func=0x2aaaaab0ddd0, arg=0x2aaaaabc3db8, kw=0x0) at Objects/abstract.c:2529
#38 0x0000000000494e76 in PyEval_CallObjectWithKeywords (func=0x2aaaaab0ddd0, arg=0x2aaaaabc3db8, kw=0x0) at Python/ceval.c:3890
#39 0x0000000000499b78 in PyEval_EvalFrameEx (f=0x881140, throwflag=) at Python/ceval.c:2333
#40 0x000000000049dd1b in PyEval_EvalCodeEx (co=0x2aaaaabd3730, globals=, locals=, args=0x0, argcount=0, kws=0x0, kwcount=0,
defs=0x0, defcount=0, closure=0x0) at Python/ceval.c:3253
#41 0x000000000049dd92 in PyEval_EvalCode (co=0xb69730, globals=0x0, locals=0x0) at Python/ceval.c:667
#42 0x00000000004bf9f6 in run_mod (fp=0x2aaaab8c06a0, filename=0x518127 “”, flags=0x7fffffffe540) at Python/pythonrun.c:1353
#43 PyRun_InteractiveOneFlags (fp=0x2aaaab8c06a0, filename=0x518127 “”, flags=0x7fffffffe540) at Python/pythonrun.c:852
#44 0x00000000004bfc14 in PyRun_InteractiveLoopFlags (fp=0x2aaaab8c06a0, filename=0x518127 “”, flags=0x7fffffffe540) at Python/pythonrun.c:772
#45 0x00000000004c035a in PyRun_AnyFileExFlags (fp=0x2aaaab8c06a0, filename=0x518127 “”, closeit=0, flags=0x7fffffffe540) at Python/pythonrun.c:741
#46 0x0000000000414bbd in Py_Main (argc=, argv=) at Modules/main.c:639
#47 0x00002aaaab58b994 in __libc_start_main () from /lib64/libc.so.6
#48 0x0000000000413d69 in _start ()

mm613>
[/code]

Hmm, oddly, when I try to build a new version of ROOT to see if it’s a conflict with the installed version of libPyROOT, no libPyROOT.so is created. I try to force enable-python in the configure:

./configure --enable-python --prefix= --with-python-incdir=/inc --with-python-libdir=/lib

But no libPyROOT is created. I checked the config output, compatible python libraries are found in the specified locations, I even try a new install of python2.7, but to no avail…

Hi,

I think the standard builds are still with p2.6 (as that is what the LHC experiments use). As for the second part, with the explicit inc-dir/lib-dir, it looks to me that python is not found and hence libPyROOT.so is not build. Can you verify the output of configure, and make sure that the dirs are indeed pointing to Python.h and libpython2.7.so, respectively?

Cheers,
Wim