Cppyy issue reading std::map from TFile

Dear experts,

I have encountered an issue with reading certain kinds of std::map objects from a TFile in PyROOT. For example, I have been trying to save a std::map<int, std::vector< int> > to a TFile in one of my ROOT c++ scripts, and it writes correctly, but I am unable to analyze that object using python/cppyy in the normal way – instead the only way I have found to get that object into python successfully is to read it through TBufferJSON::ToJSON and then to use python’s json package to parse that – doing this, it seems that the object is fine in the ROOT file, but something in PyROOT/cppyy is not able to handle it as expected from the documentation.

As a demonstration, I made a couple of minimal scripts to reproduce the problem.
make-map.py (335 Bytes)
This first script creates a std::vector<int, std::vector< int> > using cppyy.gbl.std and saves it to a TFile. The file looks healthy to me. (I have done the same thing in plain ROOT/C++ and it makes no difference.)

The second script opens that file successfully, but the map object inside causes issues.
read-map.py (674 Bytes)

The script prints the map with TBufferJSON as expected, but accessing what’s in the map using basic methods, or the more fancy method demonstrated in the cppyy docs [1], causes segfaults. I have included several lines that don’t work as comments in the script, but as is, it will only try to run (and segfault on) the method referenced in [1].

I paste the output of this test below [2].

Could this be fixed? It would be very useful for me to be able to work with objects like this without going through TBufferJSON.

Thanks,
John

[1] Pythonizations — cppyy 2.0.0 documentation
[2]

johakala@lxplus793 ~/pyroot-test # source /cvmfs/sft.cern.ch/lcg/views/LCG_101/x86_64-centos7-gcc11-dbg/setup.sh
johakala@lxplus793 ~/pyroot-test # root --version
ROOT Version: 6.24/06
Built for linuxx8664gcc on Sep 02 2021, 14:20:23
From tags/v6-24-06@v6-24-06
johakala@lxplus793 ~/pyroot-test # python --version
Python 3.9.6
johakala@lxplus793 ~/pyroot-test # python make-map.py
{ 1000 => { 5, 7, 9 } }
johakala@lxplus793 ~/pyroot-test # python read-map.py
using r.TBufferJSON.ToJSON:
 [{"$pair" : "pair<int,vector<int> >", "first" : 1000, "second" : [5, 7, 9]}]
<cppyy.gbl._Rb_tree_iterator<pair<const int,vector<int> > > object at 0x71655f0>
108562352
 *** Break *** segmentation violation



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

Thread 2 (Thread 0x7f97d125b700 (LWP 19070) "python"):
#0  0x00007f97f48b0de2 in pthread_cond_timedwait

GLIBC_2.3.2 () from /lib64/libpthread.so.0
#1  0x00007f97f4e8c6e7 in PyCOND_TIMEDWAIT (us=<optimized out>, mut=0x7f97f509ff70 <_PyRuntime+432>, cond=0x7f97f509ff40 <_PyRuntime+384>) at /build/jenkins/workspace/lcg_release_pipeline/build/externals/Python-3.9.6/src/Python/3.9.6/Python/condvar.h:73
#2  take_gil (tstate=tstate
entry=0x64b7b00) at /build/jenkins/workspace/lcg_release_pipeline/build/externals/Python-3.9.6/src/Python/3.9.6/Python/ceval_gil.h:247
#3  0x00007f97f4e8cb2e in PyEval_RestoreThread (tstate=tstate
entry=0x64b7b00) at /build/jenkins/workspace/lcg_release_pipeline/build/externals/Python-3.9.6/src/Python/3.9.6/Python/ceval.c:467
#4  0x00007f97f4f333f2 in pysleep (secs=<optimized out>) at /build/jenkins/workspace/lcg_release_pipeline/build/externals/Python-3.9.6/src/Python/3.9.6/Modules/timemodule.c:2037
#5  time_sleep (self=<optimized out>, obj=<optimized out>) at /build/jenkins/workspace/lcg_release_pipeline/build/externals/Python-3.9.6/src/Python/3.9.6/Modules/timemodule.c:365
#6  0x00007f97f4deea73 in cfunction_vectorcall_O (func=0x7f97f5208950, args=0x7f97d1338ec0, nargsf=<optimized out>, kwnames=<optimized out>) at /build/jenkins/workspace/lcg_release_pipeline/build/externals/Python-3.9.6/src/Python/3.9.6/Objects/methodobject.c:512
#7  0x00007f97f4d68892 in _PyObject_VectorcallTstate (kwnames=0x0, nargsf=<optimized out>, args=0x7f97d1338ec0, callable=0x7f97f5208950, tstate=0x64b7b00) at /build/jenkins/workspace/lcg_release_pipeline/build/externals/Python-3.9.6/src/Python/3.9.6/Include/cpython/abstract.h:118
#8  PyObject_Vectorcall (kwnames=0x0, nargsf=<optimized out>, args=0x7f97d1338ec0, callable=0x7f97f5208950) at /build/jenkins/workspace/lcg_release_pipeline/build/externals/Python-3.9.6/src/Python/3.9.6/Include/cpython/abstract.h:127
#9  call_function (kwnames=0x0, oparg=<optimized out>, pp_stack=<synthetic pointer>, tstate=0x64b7b00) at /build/jenkins/workspace/lcg_release_pipeline/build/externals/Python-3.9.6/src/Python/3.9.6/Python/ceval.c:5072
#10 _PyEval_EvalFrameDefault (tstate=<optimized out>, f=<optimized out>, throwflag=<optimized out>) at /build/jenkins/workspace/lcg_release_pipeline/build/externals/Python-3.9.6/src/Python/3.9.6/Python/ceval.c:3487
#11 0x00007f97f4e8d90e in _PyEval_EvalFrame (throwflag=0, f=0x7f97d1338d40, tstate=0x64b7b00) at /build/jenkins/workspace/lcg_release_pipeline/build/externals/Python-3.9.6/src/Python/3.9.6/Include/internal/pycore_ceval.h:40
#12 _PyEval_EvalCode (tstate=tstate
entry=0x64b7b00, _co=_co
entry=0x7f97d1280a80, globals=<optimized out>, locals=locals
entry=0x0, args=<optimized out>, argcount=1, kwnames=0x0, kwargs=0x7f97f512a480, kwcount=0, kwstep=1, defs=0x0, defcount=0, kwdefs=0x0, closure=0x0, name=0x7f97d127cc60, qualname=0x7f97d1281500) at /build/jenkins/workspace/lcg_release_pipeline/build/externals/Python-3.9.6/src/Python/3.9.6/Python/ceval.c:4327
#13 0x00007f97f4daa441 in _PyFunction_Vectorcall (func=<optimized out>, stack=<optimized out>, nargsf=<optimized out>, kwnames=<optimized out>) at /build/jenkins/workspace/lcg_release_pipeline/build/externals/Python-3.9.6/src/Python/3.9.6/Objects/call.c:396
#14 0x00007f97f4d66274 in do_call_core (kwdict=0x7f97d127eb00, callargs=0x7f97f512a460, func=0x7f97ed669a60, tstate=0x64b7b00) at /build/jenkins/workspace/lcg_release_pipeline/build/externals/Python-3.9.6/src/Python/3.9.6/Python/ceval.c:5120
#15 _PyEval_EvalFrameDefault (tstate=<optimized out>, f=<optimized out>, throwflag=<optimized out>) at /build/jenkins/workspace/lcg_release_pipeline/build/externals/Python-3.9.6/src/Python/3.9.6/Python/ceval.c:3580
#16 0x00007f97f4d60bbb in _PyEval_EvalFrame (throwflag=0, f=0x7f97f5112740, tstate=0x64b7b00) at /build/jenkins/workspace/lcg_release_pipeline/build/externals/Python-3.9.6/src/Python/3.9.6/Include/internal/pycore_ceval.h:40
#17 function_code_fastcall (tstate=0x64b7b00, co=<optimized out>, args=<optimized out>, nargs=1, globals=<optimized out>) at /build/jenkins/workspace/lcg_release_pipeline/build/externals/Python-3.9.6/src/Python/3.9.6/Objects/call.c:330
#18 0x00007f97f4d687d0 in _PyObject_VectorcallTstate (kwnames=0x0, nargsf=<optimized out>, args=0x7f97d12dc9b8, callable=0x7f97d34c21f0, tstate=0x64b7b00) at /build/jenkins/workspace/lcg_release_pipeline/build/externals/Python-3.9.6/src/Python/3.9.6/Include/cpython/abstract.h:118
#19 PyObject_Vectorcall (kwnames=0x0, nargsf=<optimized out>, args=0x7f97d12dc9b8, callable=0x7f97d34c21f0) at /build/jenkins/workspace/lcg_release_pipeline/build/externals/Python-3.9.6/src/Python/3.9.6/Include/cpython/abstract.h:127
#20 call_function (kwnames=0x0, oparg=<optimized out>, pp_stack=<synthetic pointer>, tstate=0x64b7b00) at /build/jenkins/workspace/lcg_release_pipeline/build/externals/Python-3.9.6/src/Python/3.9.6/Python/ceval.c:5072
#21 _PyEval_EvalFrameDefault (tstate=<optimized out>, f=<optimized out>, throwflag=<optimized out>) at /build/jenkins/workspace/lcg_release_pipeline/build/externals/Python-3.9.6/src/Python/3.9.6/Python/ceval.c:3504
#22 0x00007f97f4d60bbb in _PyEval_EvalFrame (throwflag=0, f=0x7f97d12dc840, tstate=0x64b7b00) at /build/jenkins/workspace/lcg_release_pipeline/build/externals/Python-3.9.6/src/Python/3.9.6/Include/internal/pycore_ceval.h:40
#23 function_code_fastcall (tstate=0x64b7b00, co=<optimized out>, args=<optimized out>, nargs=1, globals=<optimized out>) at /build/jenkins/workspace/lcg_release_pipeline/build/externals/Python-3.9.6/src/Python/3.9.6/Objects/call.c:330
#24 0x00007f97f4d687d0 in _PyObject_VectorcallTstate (kwnames=0x0, nargsf=<optimized out>, args=0x7f97d34b5a78, callable=0x7f97d34c24c0, tstate=0x64b7b00) at /build/jenkins/workspace/lcg_release_pipeline/build/externals/Python-3.9.6/src/Python/3.9.6/Include/cpython/abstract.h:118
#25 PyObject_Vectorcall (kwnames=0x0, nargsf=<optimized out>, args=0x7f97d34b5a78, callable=0x7f97d34c24c0) at /build/jenkins/workspace/lcg_release_pipeline/build/externals/Python-3.9.6/src/Python/3.9.6/Include/cpython/abstract.h:127
#26 call_function (kwnames=0x0, oparg=<optimized out>, pp_stack=<synthetic pointer>, tstate=0x64b7b00) at /build/jenkins/workspace/lcg_release_pipeline/build/externals/Python-3.9.6/src/Python/3.9.6/Python/ceval.c:5072
#27 _PyEval_EvalFrameDefault (tstate=<optimized out>, f=<optimized out>, throwflag=<optimized out>) at /build/jenkins/workspace/lcg_release_pipeline/build/externals/Python-3.9.6/src/Python/3.9.6/Python/ceval.c:3504
#28 0x00007f97f4d60bbb in _PyEval_EvalFrame (throwflag=0, f=0x7f97d34b5900, tstate=0x64b7b00) at /build/jenkins/workspace/lcg_release_pipeline/build/externals/Python-3.9.6/src/Python/3.9.6/Include/internal/pycore_ceval.h:40
#29 function_code_fastcall (tstate=0x64b7b00, co=<optimized out>, args=<optimized out>, nargs=1, globals=<optimized out>) at /build/jenkins/workspace/lcg_release_pipeline/build/externals/Python-3.9.6/src/Python/3.9.6/Objects/call.c:330
#30 0x00007f97f4dad2ec in _PyObject_VectorcallTstate (kwnames=0x0, nargsf=1, args=0x7f97d125ae68, callable=0x7f97d34c2280, tstate=0x64b7b00) at /build/jenkins/workspace/lcg_release_pipeline/build/externals/Python-3.9.6/src/Python/3.9.6/Include/cpython/abstract.h:118
#31 method_vectorcall (method=<optimized out>, args=0x7f97f5250058, nargsf=<optimized out>, kwnames=0x0) at /build/jenkins/workspace/lcg_release_pipeline/build/externals/Python-3.9.6/src/Python/3.9.6/Objects/classobject.c:61
#32 0x00007f97f4f343a9 in t_bootstrap (boot_raw=0x7f97d1282a80) at /build/jenkins/workspace/lcg_release_pipeline/build/externals/Python-3.9.6/src/Python/3.9.6/Modules/_threadmodule.c:1040
#33 0x00007f97f4edbbd7 in pythread_wrapper (arg=<optimized out>) at /build/jenkins/workspace/lcg_release_pipeline/build/externals/Python-3.9.6/src/Python/3.9.6/Python/thread_pthread.h:236
#34 0x00007f97f48acea5 in start_thread () from /lib64/libpthread.so.0
#35 0x00007f97f3eccb0d in clone () from /lib64/libc.so.6

Thread 1 (Thread 0x7f97f528c740 (LWP 17761) "python"):
#0  0x00007f97f3e93659 in waitpid () from /lib64/libc.so.6
#1  0x00007f97f3e10f62 in do_system () from /lib64/libc.so.6
#2  0x00007f97f3e11311 in system () from /lib64/libc.so.6
#3  0x00007f97ed1167b6 in TUnixSystem::Exec (this=0x1552240, shellcmd=0x72c7380 "/cvmfs/sft.cern.ch/lcg/releases/ROOT/6.24.06-3455f/x86_64-centos7-gcc11-dbg/etc/gdb-backtrace.sh 17761 1>&2") at /build/jenkins/workspace/lcg_release_pipeline/build/projects/ROOT-6.24.06/src/ROOT/6.24.06/core/unix/src/TUnixSystem.cxx:2120
#4  0x00007f97ed117057 in TUnixSystem::StackTrace (this=0x1552240) at /build/jenkins/workspace/lcg_release_pipeline/build/projects/ROOT-6.24.06/src/ROOT/6.24.06/core/unix/src/TUnixSystem.cxx:2411
#5  0x00007f97ed44a2a6 in (anonymous namespace)::do_trace (sig=1) at /build/jenkins/workspace/lcg_release_pipeline/build/projects/ROOT-6.24.06/src/ROOT/6.24.06/bindings/pyroot/cppyy/cppyy-backend/clingwrapper/src/clingwrapper.cxx:182
#6  0x00007f97ed44a322 in (anonymous namespace)::TExceptionHandlerImp::HandleException (this=0x32408d0, sig=1) at /build/jenkins/workspace/lcg_release_pipeline/build/projects/ROOT-6.24.06/src/ROOT/6.24.06/bindings/pyroot/cppyy/cppyy-backend/clingwrapper/src/clingwrapper.cxx:195
#7  0x00007f97ed11a9f3 in TUnixSystem::DispatchSignals (this=0x1552240, sig=kSigSegmentationViolation) at /build/jenkins/workspace/lcg_release_pipeline/build/projects/ROOT-6.24.06/src/ROOT/6.24.06/core/unix/src/TUnixSystem.cxx:3644
#8  0x00007f97ed1129ae in SigHandler (sig=kSigSegmentationViolation) at /build/jenkins/workspace/lcg_release_pipeline/build/projects/ROOT-6.24.06/src/ROOT/6.24.06/core/unix/src/TUnixSystem.cxx:407
#9  0x00007f97ed11a949 in sighandler (sig=11) at /build/jenkins/workspace/lcg_release_pipeline/build/projects/ROOT-6.24.06/src/ROOT/6.24.06/core/unix/src/TUnixSystem.cxx:3620
#10 <signal handler called>
#11 std::local_Rb_tree_increment (__x=0x41) at /build/dkonst/gcc-clang-2/build/contrib/gcc-11.1.0/src/gcc/11.1.0/libstdc++-v3/src/c++98/tree.cc:62
#12 std::_Rb_tree_increment (__x=0x41) at /build/dkonst/gcc-clang-2/build/contrib/gcc-11.1.0/src/gcc/11.1.0/libstdc++-v3/src/c++98/tree.cc:85
#13 0x00007f97d2c7a02d in ?? ()
#14 0x0000000007237630 in ?? ()
#15 0x00000001ed44ccb9 in ?? ()
#16 0x0000000007237630 in ?? ()
#17 0x0000000000000041 in ?? ()
#18 0x00007fff1a6fb5d0 in ?? ()
#19 0x00007f97d2c7a082 in ?? ()
#20 0x00000000072af2d0 in ?? ()
#21 0x00007fff1a6fb610 in ?? ()
#22 0x00000000072af2d0 in ?? ()
#23 0x00007fff1a6fb610 in ?? ()
#24 0x0000000100000001 in ?? ()
#25 0x0000000007237630 in ?? ()
#26 0x00007fff1a6fb6e0 in ?? ()
#27 0x00007f97ed44cf39 in WrapperCall (method=0, nargs=0, args_=0x0, self=0x0, result=0x0) at /build/jenkins/workspace/lcg_release_pipeline/build/projects/ROOT-6.24.06/src/ROOT/6.24.06/bindings/pyroot/cppyy/cppyy-backend/clingwrapper/src/clingwrapper.cxx:778
===========================================================


The lines below might hint at the cause of the crash.
You may get help by asking at the ROOT forum https://root.cern.ch/forum
Only if you are really convinced it is a bug in ROOT then please submit a
report at https://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.
===========================================================
#11 std::local_Rb_tree_increment (__x=0x41) at /build/dkonst/gcc-clang-2/build/contrib/gcc-11.1.0/src/gcc/11.1.0/libstdc++-v3/src/c++98/tree.cc:62
#12 std::_Rb_tree_increment (__x=0x41) at /build/dkonst/gcc-clang-2/build/contrib/gcc-11.1.0/src/gcc/11.1.0/libstdc++-v3/src/c++98/tree.cc:85
#13 0x00007f97d2c7a02d in ?? ()
#14 0x0000000007237630 in ?? ()
#15 0x00000001ed44ccb9 in ?? ()
#16 0x0000000007237630 in ?? ()
#17 0x0000000000000041 in ?? ()
#18 0x00007fff1a6fb5d0 in ?? ()
#19 0x00007f97d2c7a082 in ?? ()
#20 0x00000000072af2d0 in ?? ()
#21 0x00007fff1a6fb610 in ?? ()
#22 0x00000000072af2d0 in ?? ()
#23 0x00007fff1a6fb610 in ?? ()
#24 0x0000000100000001 in ?? ()
#25 0x0000000007237630 in ?? ()
#26 0x00007fff1a6fb6e0 in ?? ()
#27 0x00007f97ed44cf39 in WrapperCall (method=0, nargs=0, args_=0x0, self=0x0, result=0x0) at /build/jenkins/workspace/lcg_release_pipeline/build/projects/ROOT-6.24.06/src/ROOT/6.24.06/bindings/pyroot/cppyy/cppyy-backend/clingwrapper/src/clingwrapper.cxx:778
===========================================================


 *** Break *** segmentation violation



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

Thread 2 (Thread 0x7f97d125b700 (LWP 19070) "python"):
#0  0x00007f97f48b0de2 in pthread_cond_timedwait

GLIBC_2.3.2 () from /lib64/libpthread.so.0
#1  0x00007f97f4e8c6e7 in PyCOND_TIMEDWAIT (us=<optimized out>, mut=0x7f97f509ff70 <_PyRuntime+432>, cond=0x7f97f509ff40 <_PyRuntime+384>) at /build/jenkins/workspace/lcg_release_pipeline/build/externals/Python-3.9.6/src/Python/3.9.6/Python/condvar.h:73
#2  take_gil (tstate=tstate
entry=0x64b7b00) at /build/jenkins/workspace/lcg_release_pipeline/build/externals/Python-3.9.6/src/Python/3.9.6/Python/ceval_gil.h:247
#3  0x00007f97f4e8cb2e in PyEval_RestoreThread (tstate=tstate
entry=0x64b7b00) at /build/jenkins/workspace/lcg_release_pipeline/build/externals/Python-3.9.6/src/Python/3.9.6/Python/ceval.c:467
#4  0x00007f97f4f333f2 in pysleep (secs=<optimized out>) at /build/jenkins/workspace/lcg_release_pipeline/build/externals/Python-3.9.6/src/Python/3.9.6/Modules/timemodule.c:2037
#5  time_sleep (self=<optimized out>, obj=<optimized out>) at /build/jenkins/workspace/lcg_release_pipeline/build/externals/Python-3.9.6/src/Python/3.9.6/Modules/timemodule.c:365
#6  0x00007f97f4deea73 in cfunction_vectorcall_O (func=0x7f97f5208950, args=0x7f97d1338ec0, nargsf=<optimized out>, kwnames=<optimized out>) at /build/jenkins/workspace/lcg_release_pipeline/build/externals/Python-3.9.6/src/Python/3.9.6/Objects/methodobject.c:512
#7  0x00007f97f4d68892 in _PyObject_VectorcallTstate (kwnames=0x0, nargsf=<optimized out>, args=0x7f97d1338ec0, callable=0x7f97f5208950, tstate=0x64b7b00) at /build/jenkins/workspace/lcg_release_pipeline/build/externals/Python-3.9.6/src/Python/3.9.6/Include/cpython/abstract.h:118
#8  PyObject_Vectorcall (kwnames=0x0, nargsf=<optimized out>, args=0x7f97d1338ec0, callable=0x7f97f5208950) at /build/jenkins/workspace/lcg_release_pipeline/build/externals/Python-3.9.6/src/Python/3.9.6/Include/cpython/abstract.h:127
#9  call_function (kwnames=0x0, oparg=<optimized out>, pp_stack=<synthetic pointer>, tstate=0x64b7b00) at /build/jenkins/workspace/lcg_release_pipeline/build/externals/Python-3.9.6/src/Python/3.9.6/Python/ceval.c:5072
#10 _PyEval_EvalFrameDefault (tstate=<optimized out>, f=<optimized out>, throwflag=<optimized out>) at /build/jenkins/workspace/lcg_release_pipeline/build/externals/Python-3.9.6/src/Python/3.9.6/Python/ceval.c:3487
#11 0x00007f97f4e8d90e in _PyEval_EvalFrame (throwflag=0, f=0x7f97d1338d40, tstate=0x64b7b00) at /build/jenkins/workspace/lcg_release_pipeline/build/externals/Python-3.9.6/src/Python/3.9.6/Include/internal/pycore_ceval.h:40
#12 _PyEval_EvalCode (tstate=tstate
entry=0x64b7b00, _co=_co
entry=0x7f97d1280a80, globals=<optimized out>, locals=locals
entry=0x0, args=<optimized out>, argcount=1, kwnames=0x0, kwargs=0x7f97f512a480, kwcount=0, kwstep=1, defs=0x0, defcount=0, kwdefs=0x0, closure=0x0, name=0x7f97d127cc60, qualname=0x7f97d1281500) at /build/jenkins/workspace/lcg_release_pipeline/build/externals/Python-3.9.6/src/Python/3.9.6/Python/ceval.c:4327
#13 0x00007f97f4daa441 in _PyFunction_Vectorcall (func=<optimized out>, stack=<optimized out>, nargsf=<optimized out>, kwnames=<optimized out>) at /build/jenkins/workspace/lcg_release_pipeline/build/externals/Python-3.9.6/src/Python/3.9.6/Objects/call.c:396
#14 0x00007f97f4d66274 in do_call_core (kwdict=0x7f97d127eb00, callargs=0x7f97f512a460, func=0x7f97ed669a60, tstate=0x64b7b00) at /build/jenkins/workspace/lcg_release_pipeline/build/externals/Python-3.9.6/src/Python/3.9.6/Python/ceval.c:5120
#15 _PyEval_EvalFrameDefault (tstate=<optimized out>, f=<optimized out>, throwflag=<optimized out>) at /build/jenkins/workspace/lcg_release_pipeline/build/externals/Python-3.9.6/src/Python/3.9.6/Python/ceval.c:3580
#16 0x00007f97f4d60bbb in _PyEval_EvalFrame (throwflag=0, f=0x7f97f5112740, tstate=0x64b7b00) at /build/jenkins/workspace/lcg_release_pipeline/build/externals/Python-3.9.6/src/Python/3.9.6/Include/internal/pycore_ceval.h:40
#17 function_code_fastcall (tstate=0x64b7b00, co=<optimized out>, args=<optimized out>, nargs=1, globals=<optimized out>) at /build/jenkins/workspace/lcg_release_pipeline/build/externals/Python-3.9.6/src/Python/3.9.6/Objects/call.c:330
#18 0x00007f97f4d687d0 in _PyObject_VectorcallTstate (kwnames=0x0, nargsf=<optimized out>, args=0x7f97d12dc9b8, callable=0x7f97d34c21f0, tstate=0x64b7b00) at /build/jenkins/workspace/lcg_release_pipeline/build/externals/Python-3.9.6/src/Python/3.9.6/Include/cpython/abstract.h:118
#19 PyObject_Vectorcall (kwnames=0x0, nargsf=<optimized out>, args=0x7f97d12dc9b8, callable=0x7f97d34c21f0) at /build/jenkins/workspace/lcg_release_pipeline/build/externals/Python-3.9.6/src/Python/3.9.6/Include/cpython/abstract.h:127
#20 call_function (kwnames=0x0, oparg=<optimized out>, pp_stack=<synthetic pointer>, tstate=0x64b7b00) at /build/jenkins/workspace/lcg_release_pipeline/build/externals/Python-3.9.6/src/Python/3.9.6/Python/ceval.c:5072
#21 _PyEval_EvalFrameDefault (tstate=<optimized out>, f=<optimized out>, throwflag=<optimized out>) at /build/jenkins/workspace/lcg_release_pipeline/build/externals/Python-3.9.6/src/Python/3.9.6/Python/ceval.c:3504
#22 0x00007f97f4d60bbb in _PyEval_EvalFrame (throwflag=0, f=0x7f97d12dc840, tstate=0x64b7b00) at /build/jenkins/workspace/lcg_release_pipeline/build/externals/Python-3.9.6/src/Python/3.9.6/Include/internal/pycore_ceval.h:40
#23 function_code_fastcall (tstate=0x64b7b00, co=<optimized out>, args=<optimized out>, nargs=1, globals=<optimized out>) at /build/jenkins/workspace/lcg_release_pipeline/build/externals/Python-3.9.6/src/Python/3.9.6/Objects/call.c:330
#24 0x00007f97f4d687d0 in _PyObject_VectorcallTstate (kwnames=0x0, nargsf=<optimized out>, args=0x7f97d34b5a78, callable=0x7f97d34c24c0, tstate=0x64b7b00) at /build/jenkins/workspace/lcg_release_pipeline/build/externals/Python-3.9.6/src/Python/3.9.6/Include/cpython/abstract.h:118
#25 PyObject_Vectorcall (kwnames=0x0, nargsf=<optimized out>, args=0x7f97d34b5a78, callable=0x7f97d34c24c0) at /build/jenkins/workspace/lcg_release_pipeline/build/externals/Python-3.9.6/src/Python/3.9.6/Include/cpython/abstract.h:127
#26 call_function (kwnames=0x0, oparg=<optimized out>, pp_stack=<synthetic pointer>, tstate=0x64b7b00) at /build/jenkins/workspace/lcg_release_pipeline/build/externals/Python-3.9.6/src/Python/3.9.6/Python/ceval.c:5072
#27 _PyEval_EvalFrameDefault (tstate=<optimized out>, f=<optimized out>, throwflag=<optimized out>) at /build/jenkins/workspace/lcg_release_pipeline/build/externals/Python-3.9.6/src/Python/3.9.6/Python/ceval.c:3504
#28 0x00007f97f4d60bbb in _PyEval_EvalFrame (throwflag=0, f=0x7f97d34b5900, tstate=0x64b7b00) at /build/jenkins/workspace/lcg_release_pipeline/build/externals/Python-3.9.6/src/Python/3.9.6/Include/internal/pycore_ceval.h:40
#29 function_code_fastcall (tstate=0x64b7b00, co=<optimized out>, args=<optimized out>, nargs=1, globals=<optimized out>) at /build/jenkins/workspace/lcg_release_pipeline/build/externals/Python-3.9.6/src/Python/3.9.6/Objects/call.c:330
#30 0x00007f97f4dad2ec in _PyObject_VectorcallTstate (kwnames=0x0, nargsf=1, args=0x7f97d125ae68, callable=0x7f97d34c2280, tstate=0x64b7b00) at /build/jenkins/workspace/lcg_release_pipeline/build/externals/Python-3.9.6/src/Python/3.9.6/Include/cpython/abstract.h:118
#31 method_vectorcall (method=<optimized out>, args=0x7f97f5250058, nargsf=<optimized out>, kwnames=0x0) at /build/jenkins/workspace/lcg_release_pipeline/build/externals/Python-3.9.6/src/Python/3.9.6/Objects/classobject.c:61
#32 0x00007f97f4f343a9 in t_bootstrap (boot_raw=0x7f97d1282a80) at /build/jenkins/workspace/lcg_release_pipeline/build/externals/Python-3.9.6/src/Python/3.9.6/Modules/_threadmodule.c:1040
#33 0x00007f97f4edbbd7 in pythread_wrapper (arg=<optimized out>) at /build/jenkins/workspace/lcg_release_pipeline/build/externals/Python-3.9.6/src/Python/3.9.6/Python/thread_pthread.h:236
#34 0x00007f97f48acea5 in start_thread () from /lib64/libpthread.so.0
#35 0x00007f97f3eccb0d in clone () from /lib64/libc.so.6

Thread 1 (Thread 0x7f97f528c740 (LWP 17761) "python"):
#0  0x00007f97f3e93659 in waitpid () from /lib64/libc.so.6
#1  0x00007f97f3e10f62 in do_system () from /lib64/libc.so.6
#2  0x00007f97f3e11311 in system () from /lib64/libc.so.6
#3  0x00007f97ed1167b6 in TUnixSystem::Exec (this=0x1552240, shellcmd=0x67f67e0 "/cvmfs/sft.cern.ch/lcg/releases/ROOT/6.24.06-3455f/x86_64-centos7-gcc11-dbg/etc/gdb-backtrace.sh 17761 1>&2") at /build/jenkins/workspace/lcg_release_pipeline/build/projects/ROOT-6.24.06/src/ROOT/6.24.06/core/unix/src/TUnixSystem.cxx:2120
#4  0x00007f97ed117057 in TUnixSystem::StackTrace (this=0x1552240) at /build/jenkins/workspace/lcg_release_pipeline/build/projects/ROOT-6.24.06/src/ROOT/6.24.06/core/unix/src/TUnixSystem.cxx:2411
#5  0x00007f97ed44a2a6 in (anonymous namespace)::do_trace (sig=1) at /build/jenkins/workspace/lcg_release_pipeline/build/projects/ROOT-6.24.06/src/ROOT/6.24.06/bindings/pyroot/cppyy/cppyy-backend/clingwrapper/src/clingwrapper.cxx:182
#6  0x00007f97ed44a322 in (anonymous namespace)::TExceptionHandlerImp::HandleException (this=0x32408d0, sig=1) at /build/jenkins/workspace/lcg_release_pipeline/build/projects/ROOT-6.24.06/src/ROOT/6.24.06/bindings/pyroot/cppyy/cppyy-backend/clingwrapper/src/clingwrapper.cxx:195
#7  0x00007f97ed11a9f3 in TUnixSystem::DispatchSignals (this=0x1552240, sig=kSigSegmentationViolation) at /build/jenkins/workspace/lcg_release_pipeline/build/projects/ROOT-6.24.06/src/ROOT/6.24.06/core/unix/src/TUnixSystem.cxx:3644
#8  0x00007f97ed1129ae in SigHandler (sig=kSigSegmentationViolation) at /build/jenkins/workspace/lcg_release_pipeline/build/projects/ROOT-6.24.06/src/ROOT/6.24.06/core/unix/src/TUnixSystem.cxx:407
#9  0x00007f97ed11a949 in sighandler (sig=11) at /build/jenkins/workspace/lcg_release_pipeline/build/projects/ROOT-6.24.06/src/ROOT/6.24.06/core/unix/src/TUnixSystem.cxx:3620
#10 <signal handler called>
#11 std::local_Rb_tree_increment (__x=0x41) at /build/dkonst/gcc-clang-2/build/contrib/gcc-11.1.0/src/gcc/11.1.0/libstdc++-v3/src/c++98/tree.cc:62
#12 std::_Rb_tree_increment (__x=0x41) at /build/dkonst/gcc-clang-2/build/contrib/gcc-11.1.0/src/gcc/11.1.0/libstdc++-v3/src/c++98/tree.cc:85
#13 0x00007f97d2c78023 in ?? ()
#14 0x0000000007237630 in ?? ()
#15 0x0000000007237630 in ?? ()
#16 0x00007fff1a6fb5d0 in ?? ()
#17 0x00007f97d2c78079 in ?? ()
#18 0xffffffff00000000 in ?? ()
#19 0x00007fff1a6fb718 in ?? ()
#20 0x00007fff1a6fb718 in ?? ()
#21 0x00007fff1a6fb610 in ?? ()
#22 0x000000001a6fb5e0 in ?? ()
#23 0x0000000007237630 in ?? ()
#24 0x00007fff1a6fb6e0 in ?? ()
#25 0x00007f97ed44cf39 in WrapperCall (method=0, nargs=0, args_=0x0, self=0x0, result=0x0) at /build/jenkins/workspace/lcg_release_pipeline/build/projects/ROOT-6.24.06/src/ROOT/6.24.06/bindings/pyroot/cppyy/cppyy-backend/clingwrapper/src/clingwrapper.cxx:778
===========================================================


The lines below might hint at the cause of the crash.
You may get help by asking at the ROOT forum https://root.cern.ch/forum
Only if you are really convinced it is a bug in ROOT then please submit a
report at https://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.
===========================================================
#11 std::local_Rb_tree_increment (__x=0x41) at /build/dkonst/gcc-clang-2/build/contrib/gcc-11.1.0/src/gcc/11.1.0/libstdc++-v3/src/c++98/tree.cc:62
#12 std::_Rb_tree_increment (__x=0x41) at /build/dkonst/gcc-clang-2/build/contrib/gcc-11.1.0/src/gcc/11.1.0/libstdc++-v3/src/c++98/tree.cc:85
#13 0x00007f97d2c78023 in ?? ()
#14 0x0000000007237630 in ?? ()
#15 0x0000000007237630 in ?? ()
#16 0x00007fff1a6fb5d0 in ?? ()
#17 0x00007f97d2c78079 in ?? ()
#18 0xffffffff00000000 in ?? ()
#19 0x00007fff1a6fb718 in ?? ()
#20 0x00007fff1a6fb718 in ?? ()
#21 0x00007fff1a6fb610 in ?? ()
#22 0x000000001a6fb5e0 in ?? ()
#23 0x0000000007237630 in ?? ()
#24 0x00007fff1a6fb6e0 in ?? ()
#25 0x00007f97ed44cf39 in WrapperCall (method=0, nargs=0, args_=0x0, self=0x0, result=0x0) at /build/jenkins/workspace/lcg_release_pipeline/build/projects/ROOT-6.24.06/src/ROOT/6.24.06/bindings/pyroot/cppyy/cppyy-backend/clingwrapper/src/clingwrapper.cxx:778
===========================================================


johakala@lxplus793 ~/pyroot-test #

ROOT Version: 6.24/06
Platform: CentOS 7
Compiler: gcc11


@linev can help about TBufferJSON

As I can see, TBufferJSON works correctly.
It is rather question to @etejedor that is proper way to work with std::map in cppyy

Hello,

The way you write and read the map looks ok to me, I’ll check what’s wrong and report back.

Hello,

If you add to the reader code the generation of the dictionary all is fine:

import ROOT as r

r.gInterpreter.GenerateDictionary("map<int,vector<int> >", "map;vector")

f = r.TFile.Open("test.root")
m = f.map
...

Thanks very much @etejedor, that works!

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