pyROOT crash after script finishes

I have a PyROOT script which loads a library (gSystem->Load(“name.so”) created from a script containing a bunch of C++ classes. The script is basically using different classes and making plots after a set of procedures. It makes the plots and runs fine but then crashes with this seg fault at the end. Does anyone know what could be causing this kind of crash?


ROOT Version: 6.06/01
Platform: slc6_amd64_gcc530
Python: 2.7.11
Compiler: linuxx8664gcc


ERROR:ROOT.TUnixSystem.DispatchSignals] segmentation violation
Traceback (most recent call last):
  File "_ctypes/callbacks.c", line 314, in 'calling callback function'
  File "/data/uhussain/ZZTo4l/ZZ2018/UnfoldingAnalysisTools/CMSSW_8_0_26/src/Analysis/VVAnalysis/recipe/vpython/lib/python2.7/site-packages/rootpy/logger/roothandler.py", line 98, in python_logging_error_handler
    log.log(lvl, msg)
  File "/cvmfs/cms.cern.ch/slc6_amd64_gcc530/external/python/2.7.11-ikhhed2/lib/python2.7/logging/__init__.py", line 1223, in log
    self._log(level, msg, args, **kwargs)
  File "/cvmfs/cms.cern.ch/slc6_amd64_gcc530/external/python/2.7.11-ikhhed2/lib/python2.7/logging/__init__.py", line 1278, in _log
    self.handle(record)
  File "/cvmfs/cms.cern.ch/slc6_amd64_gcc530/external/python/2.7.11-ikhhed2/lib/python2.7/logging/__init__.py", line 1288, in handle
    self.callHandlers(record)
  File "/data/uhussain/ZZTo4l/ZZ2018/UnfoldingAnalysisTools/CMSSW_8_0_26/src/Analysis/VVAnalysis/recipe/vpython/lib/python2.7/site-packages/rootpy/logger/extended_logger.py", line 217, in callHandlers
    self.maybeShowStack(record)
  File "/data/uhussain/ZZTo4l/ZZ2018/UnfoldingAnalysisTools/CMSSW_8_0_26/src/Analysis/VVAnalysis/recipe/vpython/lib/python2.7/site-packages/rootpy/logger/extended_logger.py", line 207, in maybeShowStack
    depth = self.show_stack_depth(record, frame)
  File "/data/uhussain/ZZTo4l/ZZ2018/UnfoldingAnalysisTools/CMSSW_8_0_26/src/Analysis/VVAnalysis/recipe/vpython/lib/python2.7/site-packages/rootpy/logger/extended_logger.py", line 191, in show_stack_depth
    unique = regex, self.frame_unique(frame), record.name
  File "/data/uhussain/ZZTo4l/ZZ2018/UnfoldingAnalysisTools/CMSSW_8_0_26/src/Analysis/VVAnalysis/recipe/vpython/lib/python2.7/site-packages/rootpy/logger/extended_logger.py", line 169, in frame_unique
    return f.f_code.co_filename, f.f_code.co_name, f.f_lineno
AttributeError: 'NoneType' object has no attribute 'f_code'



===========================================================
There was a crash.
This is the entire stack trace of all threads:
===========================================================
#0  0x00007fee344f3a89 in waitpid () from /lib64/libc.so.6
#1  0x00007fee34471de2 in do_system () from /lib64/libc.so.6
#2  0x00007fee34472191 in system () from /lib64/libc.so.6
#3  0x00007fee33b35a89 in TUnixSystem::StackTrace() () from /cvmfs/cms.cern.ch/slc6_amd64_gcc530/cms/cmssw/CMSSW_8_0_26/external/slc6_amd64_gcc530/lib/libCore.so
#4  0x00007fee33b3798c in TUnixSystem::DispatchSignals(ESignals) () from /cvmfs/cms.cern.ch/slc6_amd64_gcc530/cms/cmssw/CMSSW_8_0_26/external/slc6_amd64_gcc530/lib/libCore.so
#5  <signal handler called>
#6  0x0000000009b94430 in ?? ()
#7  0x00007fee2497c6f7 in UseSFHists<BranchValueResponseMatrixMaker<float> >::~UseSFHists() () from /data/uhussain/ZZTo4l/ZZ2018/UnfoldingAnalysisTools/CMSSW_8_0_26/src/Analysis/VVAnalysis/Utilities/scripts/ResponseMatrixMaker_cxx.so
#8  0x00007fee24968fae in ROOT::delete_UseSFHistslEBranchValueResponseMatrixMakerlEfloatgRsPgR(void*) () from /data/uhussain/ZZTo4l/ZZ2018/UnfoldingAnalysisTools/CMSSW_8_0_26/src/Analysis/VVAnalysis/Utilities/scripts/ResponseMatrixMaker_cxx.so
#9  0x00007fee33b05891 in TClass::Destructor(void*, bool) () from /cvmfs/cms.cern.ch/slc6_amd64_gcc530/cms/cmssw/CMSSW_8_0_26/external/slc6_amd64_gcc530/lib/libCore.so
#10 0x00007fee343937af in PyROOT::op_dealloc_nofree(PyROOT::ObjectProxy*) () from /cvmfs/cms.cern.ch/slc6_amd64_gcc530/lcg/root/6.06.00-ikhhed6/lib/libPyROOT.so
#11 0x00007fee34393869 in PyROOT::(anonymous namespace)::op_dealloc(PyROOT::ObjectProxy*) () from /cvmfs/cms.cern.ch/slc6_amd64_gcc530/lcg/root/6.06.00-ikhhed6/lib/libPyROOT.so
#12 0x00007fee351da802 in subtype_dealloc (self=0x7fee25ab72f0) at Objects/typeobject.c:1030
#13 0x00007fee351b9dcb in dict_dealloc (mp=0x7fee25b08168) at Objects/dictobject.c:1010
#14 0x00007fee351ba7b7 in insertdict_by_entry (value=0x7fee352f0a80 <_Py_NoneStruct>, ep=0x80907a0, hash=691475477731839136, key=0x7fee34284730, mp=0x7fee354be168) at Objects/dictobject.c:519
#15 insertdict (mp=0x7fee354be168, key=0x7fee34284730, hash=691475477731839136, value=0x7fee352f0a80 <_Py_NoneStruct>) at Objects/dictobject.c:556
#16 0x00007fee351bc147 in dict_set_item_by_hash_or_entry (ep=0x0, value=0x7fee352f0a80 <_Py_NoneStruct>, hash=<optimized out>, key=<optimized out>, op=0x7fee354be168) at Objects/dictobject.c:765
#17 PyDict_SetItem (op=op
entry=0x7fee354be168, key=<optimized out>, value=value
entry=0x7fee352f0a80 <_Py_NoneStruct>) at Objects/dictobject.c:818
#18 0x00007fee351c0324 in _PyModule_Clear (m=<optimized out>) at Objects/moduleobject.c:139
#19 0x00007fee35241263 in PyImport_Cleanup () at Python/import.c:477
#20 0x00007fee35252bfe in Py_Finalize () at Python/pythonrun.c:458
#21 0x00007fee3526901f in Py_Main (argc=<optimized out>, argv=<optimized out>) at Modules/main.c:665
#22 0x00007fee344513d5 in __libc_start_main () from /lib64/libc.so.6
#23 0x00000000004006b1 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.
===========================================================
#6  0x0000000009b94430 in ?? ()
#7  0x00007fee2497c6f7 in UseSFHists<BranchValueResponseMatrixMaker<float> >::~UseSFHists() () from /data/uhussain/ZZTo4l/ZZ2018/UnfoldingAnalysisTools/CMSSW_8_0_26/src/Analysis/VVAnalysis/Utilities/scripts/ResponseMatrixMaker_cxx.so
#8  0x00007fee24968fae in ROOT::delete_UseSFHistslEBranchValueResponseMatrixMakerlEfloatgRsPgR(void*) () from /data/uhussain/ZZTo4l/ZZ2018/UnfoldingAnalysisTools/CMSSW_8_0_26/src/Analysis/VVAnalysis/Utilities/scripts/ResponseMatrixMaker_cxx.so
#9  0x00007fee33b05891 in TClass::Destructor(void*, bool) () from /cvmfs/cms.cern.ch/slc6_amd64_gcc530/cms/cmssw/CMSSW_8_0_26/external/slc6_amd64_gcc530/lib/libCore.so
#10 0x00007fee343937af in PyROOT::op_dealloc_nofree(PyROOT::ObjectProxy*) () from /cvmfs/cms.cern.ch/slc6_amd64_gcc530/lcg/root/6.06.00-ikhhed6/lib/libPyROOT.so
#11 0x00007fee34393869 in PyROOT::(anonymous namespace)::op_dealloc(PyROOT::ObjectProxy*) () from /cvmfs/cms.cern.ch/slc6_amd64_gcc530/lcg/root/6.06.00-ikhhed6/lib/libPyROOT.so
#12 0x00007fee351da802 in subtype_dealloc (self=0x7fee25ab72f0) at Objects/typeobject.c:1030
#13 0x00007fee351b9dcb in dict_dealloc (mp=0x7fee25b08168) at Objects/dictobject.c:1010
#14 0x00007fee351ba7b7 in insertdict_by_entry (value=0x7fee352f0a80 <_Py_NoneStruct>, ep=0x80907a0, hash=691475477731839136, key=0x7fee34284730, mp=0x7fee354be168) at Objects/dictobject.c:519
#15 insertdict (mp=0x7fee354be168, key=0x7fee34284730, hash=691475477731839136, value=0x7fee352f0a80 <_Py_NoneStruct>) at Objects/dictobject.c:556
#16 0x00007fee351bc147 in dict_set_item_by_hash_or_entry (ep=0x0, value=0x7fee352f0a80 <_Py_NoneStruct>, hash=<optimized out>, key=<optimized out>, op=0x7fee354be168) at Objects/dictobject.c:765
#17 PyDict_SetItem (op=op
entry=0x7fee354be168, key=<optimized out>, value=value
entry=0x7fee352f0a80 <_Py_NoneStruct>) at Objects/dictobject.c:818
#18 0x00007fee351c0324 in _PyModule_Clear (m=<optimized out>) at Objects/moduleobject.c:139
#19 0x00007fee35241263 in PyImport_Cleanup () at Python/import.c:477
#20 0x00007fee35252bfe in Py_Finalize () at Python/pythonrun.c:458
#21 0x00007fee3526901f in Py_Main (argc=<optimized out>, argv=<optimized out>) at Modules/main.c:665
#22 0x00007fee344513d5 in __libc_start_main () from /lib64/libc.so.6
#23 0x00000000004006b1 in _start ()
===========================================================

For some reason, f here is None, so that when you try to access f.f_code it complains about not being able to find the attribute. I would try to find out why f is None at this point of the code.

Right, python and ROOT were fighting over who gets to delete the ROOT object so a classic case of setting Ownership to false.

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