print "Found %d entries"%entries
nb = roides_tree.GetEntry( 6 )
print "End of validate, close files"
#file.Write()
file.Close()
print "End of validate, close files closed"
if name == ‘main’:
validate()
With this function defined, I have a crash in the Tclass dst (from gdb):
#2 0x00007ffff45e8636 in TClass::Destructor(void*, bool) () from /afs/cern.ch/atlas/software/releases/20.2.3/LCGCMT/LCGCMT_71/InstallArea/x86_64-slc6-gcc48-opt/lib/libCore.so #3 0x00007ffff735740b in PyROOT::op_dealloc_nofree(PyROOT::ObjectProxy*) ()
But if everything that is in validate() is moved in the main explicitly, the crash is not happening. I’ve added the file and the code to this entry.
I’m using:
Python 2.7.6 (default, Jul 8 2014, 13:33:49) [GCC 4.8.1] on linux2
ROOT 5.34/24
Please can you help me to understand where the memory corruption is happening?
Cheers
Francesca test.py (1.13 KB) feature.root (18.3 KB)
Traceback (most recent call last):
File "test.py", line 7, in <module>
import rootpy
File "/Users/couet/git/roottrunk-bin/lib/ROOT.py", line 301, in _importhook
return _orig_ihook( name, *args, **kwds )
ImportError: No module named rootpy
Program received signal SIGSEGV, Segmentation fault.
0x0000003b07e788bd in _int_free () from /lib64/libc.so.6
(gdb) where #0 0x0000003b07e788bd in _int_free () from /lib64/libc.so.6 #1 0x0000003b08f77e9a in G__calldtor () from /usr/lib64/root/libCint.so.5.34 #2 0x00007ffff11eba87 in TClass::Destructor(void*, bool) () from /usr/lib64/root/libCore.so.5.34 #3 0x00007ffff19cf66b in PyROOT::op_dealloc_nofree(PyROOT::ObjectProxy*) ()
from /usr/lib64/python2.6/site-packages/libPyROOT.so #4 0x00007ffff19cf6a9 in ?? () from /usr/lib64/python2.6/site-packages/libPyROOT.so #5 0x0000003b09a9a705 in ?? () from /usr/lib64/libpython2.6.so.1.0 #6 0x0000003b09ad278d in PyEval_EvalFrameEx () from /usr/lib64/libpython2.6.so.1.0 #7 0x0000003b09ad6b7f in PyEval_EvalFrameEx () from /usr/lib64/libpython2.6.so.1.0 #8 0x0000003b09ad7647 in PyEval_EvalCodeEx () from /usr/lib64/libpython2.6.so.1.0 #9 0x0000003b09ad7722 in PyEval_EvalCode () from /usr/lib64/libpython2.6.so.1.0 #10 0x0000003b09af1b9c in ?? () from /usr/lib64/libpython2.6.so.1.0 #11 0x0000003b09af1c70 in PyRun_FileExFlags () from /usr/lib64/libpython2.6.so.1.0 #12 0x0000003b09af315c in PyRun_SimpleFileExFlags () from /usr/lib64/libpython2.6.so.1.0 #13 0x0000003b09aff892 in Py_Main () from /usr/lib64/libpython2.6.so.1.0 #14 0x0000003b07e1ed5d in __libc_start_main () from /lib64/libc.so.6 #15 0x0000000000400649 in _start ()
I tried to reproduce your script on lxplus using these instructions to set up root*. The script also needs rootpy, can you give us a recipe to set up an environment equivalent to yours (I know you probably set up the atlas environment)?
Hi,
I’m not sourcing any ATLAS setup, and I commented out all settings in the .bash_profile, then:
-bash-4.1$ which root
/usr/bin/root
(which is ROOT 5.34/32)
-bash-4.1$ python --version
Python 2.6.6
No idea of where the settings are coming from (no ROOTSYS is set), probably the default lxplus bash configuration??
Hi,
no “root” string found in the output of your command.
Anyhow, while doing other make-ups, I discovered that I fill the char[100] variable in the structure with a string that in some cases is shorter than 100, and this is probably the reason of my crash in reading it back (some memory corruption…). Fixed it, I don’t have any problem.
Strange that you don’t see the crash, while I do.
It would be anyhow nice to know which rootpy version I’m using, just for reference in next dev.
Not is problem some case shorter, is problem many case longer. TTree simply return pointer, PyROOT simply eat pointer: but is tell size 100. Not true! Size is 102 most case. Check bytes read return GetEntry().
Because is memory overwrite, some see crash, some no. Is depend hit important bytes or no.