wlav / cppyy

Other
391 stars 40 forks source link

Segfaults loading classes and interacting with them #114

Closed marc1uk closed 1 year ago

marc1uk commented 1 year ago

OS: centos stream 8 python: 3.8.13 g++: 8.5.0 cppyy: built-into root 6.24.06

Unfortunately I'm having a lot of difficulty getting cppyy to work, and while I realise this isn't a support forum, and apologise in advance, I'm really tearing my hair out here.

I have worked my way down to a minimal reproducer, which defines a very simple class, builds it into a library, and loads it into python. At this point it segfaults. I attach the offending files. In the python script I have two commented out lines:

#DataModel = cppyy.gbl.DataModel
#from cppyy.gbl import DataModel

either causes python to crash with the following error:

[root@build-01 try1]# python3 test2.py                                                                                        
/ToolAnalysis/ToolDAQ/root-6.24.06/install/lib/libCling.so(+0x3364f8a)[0x7fbda68abf8a]
/ToolAnalysis/ToolDAQ/root-6.24.06/install/lib/libCling.so(+0x7dadc1)[0x7fbda3d21dc1]
/ToolAnalysis/ToolDAQ/root-6.24.06/install/lib/libCling.so(+0x7db76d)[0x7fbda3d2276d]
/ToolAnalysis/ToolDAQ/root-6.24.06/install/lib/libCling.so(+0xf30209)[0x7fbda4477209]
/ToolAnalysis/ToolDAQ/root-6.24.06/install/lib/libCling.so(+0xef58fb)[0x7fbda443c8fb]
/ToolAnalysis/ToolDAQ/root-6.24.06/install/lib/libCling.so(+0xf1581c)[0x7fbda445c81c]
/ToolAnalysis/ToolDAQ/root-6.24.06/install/lib/libCling.so(+0xf18059)[0x7fbda445f059]
/ToolAnalysis/ToolDAQ/root-6.24.06/install/lib/libCling.so(+0xf1e65b)[0x7fbda446565b]
/ToolAnalysis/ToolDAQ/root-6.24.06/install/lib/libCling.so(+0xf23b46)[0x7fbda446ab46]
/ToolAnalysis/ToolDAQ/root-6.24.06/install/lib/libCling.so(+0x1009915)[0x7fbda4550915]
/ToolAnalysis/ToolDAQ/root-6.24.06/install/lib/libCling.so(+0x2cfce36)[0x7fbda6243e36]
/ToolAnalysis/ToolDAQ/root-6.24.06/install/lib/libCling.so(+0x9db258)[0x7fbda3f22258]
/ToolAnalysis/ToolDAQ/root-6.24.06/install/lib/libCling.so(+0x2e315bf)[0x7fbda63785bf]
/ToolAnalysis/ToolDAQ/root-6.24.06/install/lib/libCling.so(+0x2e2e5e5)[0x7fbda63755e5]
/ToolAnalysis/ToolDAQ/root-6.24.06/install/lib/libCling.so(+0x2e316bc)[0x7fbda63786bc]
/ToolAnalysis/ToolDAQ/root-6.24.06/install/lib/libCling.so(+0x2e2e5e5)[0x7fbda63755e5]
/ToolAnalysis/ToolDAQ/root-6.24.06/install/lib/libCling.so(+0x2e3161a)[0x7fbda637861a]
/ToolAnalysis/ToolDAQ/root-6.24.06/install/lib/libCling.so(+0x2e2e5e5)[0x7fbda63755e5]
/ToolAnalysis/ToolDAQ/root-6.24.06/install/lib/libCling.so(+0x2e316bc)[0x7fbda63786bc]
/ToolAnalysis/ToolDAQ/root-6.24.06/install/lib/libCling.so(+0x2e2e5e5)[0x7fbda63755e5]
/ToolAnalysis/ToolDAQ/root-6.24.06/install/lib/libCling.so(+0x2e316bc)[0x7fbda63786bc]
/ToolAnalysis/ToolDAQ/root-6.24.06/install/lib/libCling.so(+0x2e2e5e5)[0x7fbda63755e5]
/ToolAnalysis/ToolDAQ/root-6.24.06/install/lib/libCling.so(+0x2e316bc)[0x7fbda63786bc]
/ToolAnalysis/ToolDAQ/root-6.24.06/install/lib/libCling.so(+0x2e2e5e5)[0x7fbda63755e5]
/ToolAnalysis/ToolDAQ/root-6.24.06/install/lib/libCling.so(_ZN20TClingDataMemberInfo6OffsetEv+0x65)[0x7fbda3bef5f5]
/ToolAnalysis/ToolDAQ/root-6.24.06/install/lib/libCore.so(_ZNK11TDataMember13GetOffsetCintEv+0xbe)[0x7fbdaa3a5b1e]
/ToolAnalysis/ToolDAQ/root-6.24.06/install/lib/libcppyy_backend3_8.so(_ZN5Cppyy19GetDatamemberOffsetEmm+0x236)[0x7fbdaa8558b6]/ToolAnalysis/ToolDAQ/root-6.24.06/install/lib/libcppyy3_8.so(_ZN8CPyCppyy13CPPDataMember3SetEmm+0x63)[0x7fbdaaab7d23]
/ToolAnalysis/ToolDAQ/root-6.24.06/install/lib/libcppyy3_8.so(+0x792ee)[0x7fbdaaae02ee]
/ToolAnalysis/ToolDAQ/root-6.24.06/install/lib/libcppyy3_8.so(_ZN8CPyCppyy16CreateScopeProxyERKNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEEP7_object+0xe91)[0x7fbdaaae2d91]
/ToolAnalysis/ToolDAQ/root-6.24.06/install/lib/libcppyy3_8.so(+0x5fe4a)[0x7fbdaaac6e4a]
/lib64/libpython3.8.so.1.0(_PyObject_LookupAttr+0x8b)[0x7fbdac30238b]
/lib64/libpython3.8.so.1.0(_PyEval_EvalFrameDefault+0x48f7)[0x7fbdac3811c7]
/lib64/libpython3.8.so.1.0(_PyEval_EvalCodeWithName+0x3c6)[0x7fbdac339c46]
/lib64/libpython3.8.so.1.0(PyEval_EvalCode+0x23)[0x7fbdac33ae23]
/lib64/libpython3.8.so.1.0(+0x22af0a)[0x7fbdac3c6f0a]
/lib64/libpython3.8.so.1.0(+0x250e52)[0x7fbdac3ece52]
/lib64/libpython3.8.so.1.0(+0x102f11)[0x7fbdac29ef11]
/lib64/libpython3.8.so.1.0(PyRun_SimpleFileExFlags+0x369)[0x7fbdac2a5de8]
/lib64/libpython3.8.so.1.0(Py_RunMain+0x2ef)[0x7fbdac3eea1f]
/lib64/libpython3.8.so.1.0(Py_BytesMain+0x39)[0x7fbdac3eeba9]
/lib64/libc.so.6(__libc_start_main+0xe5)[0x7fbdab23dd85]
python3(_start+0x2e)[0x560123d3178e]
Missing transaction during deserialization!
UNREACHABLE executed at /ToolAnalysis/ToolDAQ/root-6.24.06/interpreter/cling/lib/Interpreter/DeclCollector.cpp:68!
 *** Break *** abort
 *** Break *** abort

This means really nothing to me, so I would greatly appreciate any suggestions here.

pydebug.zip

wlav commented 1 year ago

That's a ROOT install of cppyy. ROOT uses an ancient fork of cppyy which has no bearing to cppyy proper anymore. Please ask on the ROOT forum.

marc1uk commented 1 year ago

ok, i'll try there. Unfortunately as we discussed before, given that I'm using ROOT I don't have a choice in that. Let's hope they can provide support.