uproot5
uproot5 copied to clipboard
test_0927_dont_assume_uproot_in_global_scope_in_TPython_Eval now raises an exception
It was introduced in #927 to fix a segfault, and now it's producing segfaults again, but probably for a different reason. pytest hides the ROOT error messages, but they are:
*** Break *** segmentation violation
Generating stack trace...
0x00005d42557bf44a in PyUnicode_FromFormatV + 0x88a from python
0x00005d42557edc81 in PyErr_Format + 0xf1 from python
0x00005d42556d6851 in <unknown> from python
0x00005d42557c7c9c in _PyEval_EvalFrameDefault + 0xffc from python
0x00005d425587ea8d in <unknown> from python
0x00005d425587e11f in PyEval_EvalCode + 0x9f from python
0x00005d425589d08a in <unknown> from python
0x00005d4255898c13 in <unknown> from python
0x00005d425588d3c2 in PyRun_StringFlags + 0x62 from python
0x0000724653f49dcd in TPython::Exec(char const*) + 0x3d from /home/jpivarski/miniforge3/lib/libROOTTPython.so.6.32.00
0x0000724653f5609b in <unknown function>
0x0000724665957266 in TBuffer::Expand(int, bool) + 0x76 from /home/jpivarski/miniforge3/lib/python3.11/lib-dynload/../.././libCore.so.6.32
0x000072466526403e in TBufferFile::WriteFastArray(double const*, long long) + 0xbe from /home/jpivarski/miniforge3/lib/libRIO.so
0x0000724665a9496b in TStreamerBase::WriteBuffer(TBuffer&, char*) + 0x2b from /home/jpivarski/miniforge3/lib/python3.11/lib-dynload/../.././libCore.so.6.32
0x00007246654ffb84 in int TStreamerInfo::WriteBufferAux<char**>(TBuffer&, char** const&, TStreamerInfo::TCompInfo* const*, int, int, int, int, int) + 0x6504 from /home/jpivarski/miniforge3/lib/libRIO.so
0x00007246653477e1 in TStreamerInfoActions::GenericWriteAction(TBuffer&, void*, TStreamerInfoActions::TConfiguration const*) + 0x51 from /home/jpivarski/miniforge3/lib/libRIO.so
0x000072466526bf9e in TBufferFile::WriteClassBuffer(TClass const*, void*) + 0x2ae from /home/jpivarski/miniforge3/lib/libRIO.so
0x0000724665a9496b in TStreamerBase::WriteBuffer(TBuffer&, char*) + 0x2b from /home/jpivarski/miniforge3/lib/python3.11/lib-dynload/../.././libCore.so.6.32
0x00007246654ffb84 in int TStreamerInfo::WriteBufferAux<char**>(TBuffer&, char** const&, TStreamerInfo::TCompInfo* const*, int, int, int, int, int) + 0x6504 from /home/jpivarski/miniforge3/lib/libRIO.so
0x00007246653477e1 in TStreamerInfoActions::GenericWriteAction(TBuffer&, void*, TStreamerInfoActions::TConfiguration const*) + 0x51 from /home/jpivarski/miniforge3/lib/libRIO.so
0x000072466526bf9e in TBufferFile::WriteClassBuffer(TClass const*, void*) + 0x2ae from /home/jpivarski/miniforge3/lib/libRIO.so
0x000072466526a69b in TBufferFile::WriteObjectClass(void const*, TClass const*, bool) + 0x1ab from /home/jpivarski/miniforge3/lib/libRIO.so
0x0000724665d32bfe in <unknown> from /home/jpivarski/miniforge3/lib/python3.11/lib-dynload/../../libcppyy_backend.so
0x0000724644f7a356 in <unknown> from /home/jpivarski/miniforge3/lib/python3.11/site-packages/libcppyy.so
0x0000724644f6061a in <unknown> from /home/jpivarski/miniforge3/lib/python3.11/site-packages/libcppyy.so
0x0000724644f607c8 in <unknown> from /home/jpivarski/miniforge3/lib/python3.11/site-packages/libcppyy.so
0x0000724644f60956 in CPyCppyy::CPPMethod::Execute(void*, long, CPyCppyy::CallContext*) + 0x26 from /home/jpivarski/miniforge3/lib/python3.11/site-packages/libcppyy.so
0x0000724644f60ac6 in CPyCppyy::CPPMethod::Call(CPyCppyy::CPPInstance*&, _object* const*, unsigned long, _object*, CPyCppyy::CallContext*) + 0x116 from /home/jpivarski/miniforge3/lib/python3.11/site-packages/libcppyy.so
0x0000724644f689d3 in <unknown> from /home/jpivarski/miniforge3/lib/python3.11/site-packages/libcppyy.so
0x00005d42557d3eac in PyObject_Vectorcall + 0x2c from python
0x00005d42557c73b6 in _PyEval_EvalFrameDefault + 0x716 from python
0x00005d425587ea8d in <unknown> from python
0x00005d425587e11f in PyEval_EvalCode + 0x9f from python
0x00005d425589d08a in <unknown> from python
0x00005d4255898c13 in <unknown> from python
0x00005d425588d3c2 in PyRun_StringFlags + 0x62 from python
0x00005d425588d17c in PyRun_SimpleStringFlags + 0x3c from python
0x00005d42558a7bdf in Py_RunMain + 0x23f from python
0x00005d425586e027 in Py_BytesMain + 0x37 from python
0x0000724667c29d90 in <unknown> from /lib/x86_64-linux-gnu/libc.so.6
0x0000724667c29e40 in __libc_start_main + 0x80 from /lib/x86_64-linux-gnu/libc.so.6
0x00005d425586decd in <unknown> from python
Traceback (most recent call last):
File "<string>", line 1, in <module>
File "/home/jpivarski/irishep/uproot5/tests/test_0927_dont_assume_uproot_in_global_scope_in_TPython_Eval.py", line 14, in test
assert __import__("uproot").from_pyroot(h).values().shape == (1, 1, 1)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/home/jpivarski/irishep/uproot5/src/uproot/pyroot.py", line 258, in from_pyroot
buffer = pyroot_to_buffer(obj)
^^^^^^^^^^^^^^^^^^^^^
File "/home/jpivarski/irishep/uproot5/src/uproot/pyroot.py", line 136, in pyroot_to_buffer
message.WriteObject(obj)
cppyy.ll.SegmentationViolation: void TBufferIO::WriteObject(const TObject* obj, Bool_t cacheReuse = kTRUE) =>
SegmentationViolation: segfault in C++; program state was reset
*** Break *** segmentation violation
Generating stack trace...
0x00005d42557aef74 in <unknown> from python
0x00005d42557ae513 in <unknown> from python
0x00005d425587a6fb in <unknown> from python
0x00005d42558ac481 in PyGC_Collect + 0x61 from python
0x00005d425589c01e in Py_FinalizeEx + 0x13e from python
0x00005d42558a7b20 in Py_RunMain + 0x180 from python
0x00005d425586e027 in Py_BytesMain + 0x37 from python
0x0000724667c29d90 in <unknown> from /lib/x86_64-linux-gnu/libc.so.6
0x0000724667c29e40 in __libc_start_main + 0x80 from /lib/x86_64-linux-gnu/libc.so.6
0x00005d425586decd in <unknown> from python
*** Break *** segmentation violation
Generating stack trace...
0x00005d42557aef74 in <unknown> from python
0x00005d42557ae513 in <unknown> from python
0x00005d425587a6fb in <unknown> from python
0x00005d42558ac481 in PyGC_Collect + 0x61 from python
0x00005d425589c01e in Py_FinalizeEx + 0x13e from python
0x00005d42558a7b20 in Py_RunMain + 0x180 from python
0x00005d425586e027 in Py_BytesMain + 0x37 from python
0x0000724667c29d90 in <unknown> from /lib/x86_64-linux-gnu/libc.so.6
0x0000724667c29e40 in __libc_start_main + 0x80 from /lib/x86_64-linux-gnu/libc.so.6
0x00005d425586decd in <unknown> from python
The segfault is somewhere in the TBufferIO::WriteObject call.
This is a blocker: our one test that imports ROOT always fails because of this.
Both tests/test_0927_dont_assume_uproot_in_global_scope_in_TPython_Eval.py (above) and tests/test_0965_inverted_axes_variances_hist_888.py::test_axes_variances_to_hist_3D_weighted have segfaults, and both of them involve conversions between PyROOT and Uproot objects (probably the same error).
Here's the ROOT error output for the second one:
*** Break *** segmentation violation
Generating stack trace...
0x0000646d3a91244a in PyUnicode_FromFormatV + 0x88a from python
0x0000646d3a940c81 in PyErr_Format + 0xf1 from python
0x0000646d3a829851 in <unknown> from python
0x0000646d3a91ac9c in _PyEval_EvalFrameDefault + 0xffc from python
0x0000646d3a9d1a8d in <unknown> from python
0x0000646d3a9d111f in PyEval_EvalCode + 0x9f from python
0x0000646d3a9f008a in <unknown> from python
0x0000646d3a9ebc13 in <unknown> from python
0x0000646d3a9e03c2 in PyRun_StringFlags + 0x62 from python
0x00007c9865a1adcd in TPython::Exec(char const*) + 0x3d from /home/jpivarski/miniforge3/lib/libROOTTPython.so.6.32.00
0x00007c9865a2709b in <unknown function>
0x00007c986fb57266 in TBuffer::Expand(int, bool) + 0x76 from /home/jpivarski/miniforge3/lib/python3.11/lib-dynload/../.././libCore.so.6.32
0x00007c986f66403e in TBufferFile::WriteFastArray(double const*, long long) + 0xbe from /home/jpivarski/miniforge3/lib/libRIO.so
0x00007c986f665379 in TBufferFile::WriteFastArray(void*, TClass const*, long long, TMemberStreamer*) + 0x99 from /home/jpivarski/miniforge3/lib/libRIO.so
0x00007c986f8fd220 in int TStreamerInfo::WriteBufferAux<char**>(TBuffer&, char** const&, TStreamerInfo::TCompInfo* const*, int, int, int, int, int) + 0x3ba0 from /home/jpivarski/miniforge3/lib/libRIO.so
0x00007c986f7477e1 in TStreamerInfoActions::GenericWriteAction(TBuffer&, void*, TStreamerInfoActions::TConfiguration const*) + 0x51 from /home/jpivarski/miniforge3/lib/libRIO.so
0x00007c986f66bf9e in TBufferFile::WriteClassBuffer(TClass const*, void*) + 0x2ae from /home/jpivarski/miniforge3/lib/libRIO.so
0x00007c986fc9496b in TStreamerBase::WriteBuffer(TBuffer&, char*) + 0x2b from /home/jpivarski/miniforge3/lib/python3.11/lib-dynload/../.././libCore.so.6.32
0x00007c986f8ffb84 in int TStreamerInfo::WriteBufferAux<char**>(TBuffer&, char** const&, TStreamerInfo::TCompInfo* const*, int, int, int, int, int) + 0x6504 from /home/jpivarski/miniforge3/lib/libRIO.so
0x00007c986f7477e1 in TStreamerInfoActions::GenericWriteAction(TBuffer&, void*, TStreamerInfoActions::TConfiguration const*) + 0x51 from /home/jpivarski/miniforge3/lib/libRIO.so
0x00007c986f66bf9e in TBufferFile::WriteClassBuffer(TClass const*, void*) + 0x2ae from /home/jpivarski/miniforge3/lib/libRIO.so
0x00007c986fc9496b in TStreamerBase::WriteBuffer(TBuffer&, char*) + 0x2b from /home/jpivarski/miniforge3/lib/python3.11/lib-dynload/../.././libCore.so.6.32
0x00007c986f8ffb84 in int TStreamerInfo::WriteBufferAux<char**>(TBuffer&, char** const&, TStreamerInfo::TCompInfo* const*, int, int, int, int, int) + 0x6504 from /home/jpivarski/miniforge3/lib/libRIO.so
0x00007c986f7477e1 in TStreamerInfoActions::GenericWriteAction(TBuffer&, void*, TStreamerInfoActions::TConfiguration const*) + 0x51 from /home/jpivarski/miniforge3/lib/libRIO.so
0x00007c986f66bf9e in TBufferFile::WriteClassBuffer(TClass const*, void*) + 0x2ae from /home/jpivarski/miniforge3/lib/libRIO.so
0x00007c986f66a69b in TBufferFile::WriteObjectClass(void const*, TClass const*, bool) + 0x1ab from /home/jpivarski/miniforge3/lib/libRIO.so
0x00007c98f26b8bfe in <unknown> from /home/jpivarski/miniforge3/lib/python3.11/lib-dynload/../../libcppyy_backend.so
0x00007c984fbec356 in <unknown> from /home/jpivarski/miniforge3/lib/python3.11/site-packages/libcppyy.so
0x00007c984fbd261a in <unknown> from /home/jpivarski/miniforge3/lib/python3.11/site-packages/libcppyy.so
0x00007c984fbd27c8 in <unknown> from /home/jpivarski/miniforge3/lib/python3.11/site-packages/libcppyy.so
0x00007c984fbd2956 in CPyCppyy::CPPMethod::Execute(void*, long, CPyCppyy::CallContext*) + 0x26 from /home/jpivarski/miniforge3/lib/python3.11/site-packages/libcppyy.so
0x00007c984fbd2ac6 in CPyCppyy::CPPMethod::Call(CPyCppyy::CPPInstance*&, _object* const*, unsigned long, _object*, CPyCppyy::CallContext*) + 0x116 from /home/jpivarski/miniforge3/lib/python3.11/site-packages/libcppyy.so
0x00007c984fbda9d3 in <unknown> from /home/jpivarski/miniforge3/lib/python3.11/site-packages/libcppyy.so
0x0000646d3a926eac in PyObject_Vectorcall + 0x2c from python
0x0000646d3a91a3b6 in _PyEval_EvalFrameDefault + 0x716 from python
0x0000646d3a9d1a8d in <unknown> from python
0x0000646d3a9d111f in PyEval_EvalCode + 0x9f from python
0x0000646d3a9f008a in <unknown> from python
0x0000646d3a9ebc13 in <unknown> from python
0x0000646d3a9e03c2 in PyRun_StringFlags + 0x62 from python
0x0000646d3a9e017c in PyRun_SimpleStringFlags + 0x3c from python
0x0000646d3a9fabdf in Py_RunMain + 0x23f from python
0x0000646d3a9c1027 in Py_BytesMain + 0x37 from python
0x00007c9901629d90 in <unknown> from /lib/x86_64-linux-gnu/libc.so.6
0x00007c9901629e40 in __libc_start_main + 0x80 from /lib/x86_64-linux-gnu/libc.so.6
0x0000646d3a9c0ecd in <unknown> from python
Traceback (most recent call last):
File "<string>", line 1, in <module>
File "/home/jpivarski/irishep/uproot5/tests/test_0965_inverted_axes_variances_hist_888.py", line 44, in test_axes_variances_to_hist_3D_weighted
huproot3 = uproot.from_pyroot(hroot3)
^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/home/jpivarski/irishep/uproot5/src/uproot/pyroot.py", line 258, in from_pyroot
buffer = pyroot_to_buffer(obj)
^^^^^^^^^^^^^^^^^^^^^
File "/home/jpivarski/irishep/uproot5/src/uproot/pyroot.py", line 136, in pyroot_to_buffer
message.WriteObject(obj)
cppyy.ll.SegmentationViolation: void TBufferIO::WriteObject(const TObject* obj, Bool_t cacheReuse = kTRUE) =>
SegmentationViolation: segfault in C++; program state was reset
*** Break *** segmentation violation
Generating stack trace...
0x0000646d3a901f74 in <unknown> from python
0x0000646d3a901513 in <unknown> from python
0x0000646d3a9cd6fb in <unknown> from python
0x0000646d3a9ff481 in PyGC_Collect + 0x61 from python
0x0000646d3a9ef01e in Py_FinalizeEx + 0x13e from python
0x0000646d3a9fab20 in Py_RunMain + 0x180 from python
0x0000646d3a9c1027 in Py_BytesMain + 0x37 from python
0x00007c9901629d90 in <unknown> from /lib/x86_64-linux-gnu/libc.so.6
0x00007c9901629e40 in __libc_start_main + 0x80 from /lib/x86_64-linux-gnu/libc.so.6
0x0000646d3a9c0ecd in <unknown> from python
*** Break *** segmentation violation
Generating stack trace...
0x0000646d3a901f74 in <unknown> from python
0x0000646d3a901513 in <unknown> from python
0x0000646d3a9cd6fb in <unknown> from python
0x0000646d3a9ff481 in PyGC_Collect + 0x61 from python
0x0000646d3a9ef01e in Py_FinalizeEx + 0x13e from python
0x0000646d3a9fab20 in Py_RunMain + 0x180 from python
0x0000646d3a9c1027 in Py_BytesMain + 0x37 from python
0x00007c9901629d90 in <unknown> from /lib/x86_64-linux-gnu/libc.so.6
0x00007c9901629e40 in __libc_start_main + 0x80 from /lib/x86_64-linux-gnu/libc.so.6
0x0000646d3a9c0ecd in <unknown> from python
How do we build ROOT in the tests? I'm trying to understand if the test was working and then all of a sudden started failing when a certain change was introduced in ROOT. I wanted to do a bisect, so I built a version of ROOT prior to when this issue was opened (early June 2024), but I still see the segfault.
To summarize the most recent findings:
- I tested different ROOT versions available on conda and the change that cause the crash was introduced between v6.30.4 (where it was still working) and v6.32.0 (crash)
- the crash happens here - when the
reallocatefunction is invoked viaTPython, any way to accesspyroot_to_buffer.sizerleads to a crash - by changing the
TStreamerInfoinside uproot I wasn't able to solve the issue v6.32.0 (or to reproduce the crash in v6.30.4)
Following is a minimal reproducer of which classes lead to the crash
import ROOT
import numpy
import uproot
#ROOT.gDebug = 3
import faulthandler
faulthandler.enable()
import ROOT
ROOT.gInterpreter.Declare('''
#include "TPython.h"
''')
# segfault
#h = ROOT.TProfile3D()
#__import__("uproot").from_pyroot(h)
# does not segfault
#h = ROOT.TProfile()
#__import__("uproot").from_pyroot(h)
# does not segfault
#h = ROOT.TProfile2D()
#__import__("uproot").from_pyroot(h)
# segfault
#import ipdb; ipdb.set_trace()
h = ROOT.TH3D("hroot3", "", 3, 0, 1, 2, 0, 1, 5, 0, 1)
__import__("uproot").from_pyroot(h)
# does not segfault
#h = ROOT.TH3F()
#__import__("uproot").from_pyroot(h)
# does not segfault
#h = ROOT.TH2F("hroot2", "", 2, 0, 1, 3, 0, 1)
#__import__("uproot").from_pyroot(h)
# does not segfault
#h = ROOT.TH1F("hroot1", "", 10, 0, 1)
#__import__("uproot").from_pyroot(h)
Summarizing the most recent findings.
@aaronj0 kindly pointed out that, in case of TStreamerInfo being the same for the ROOT object on both versions, then the problem might be related to a change happened on the TPython side. The most relevant change occured between the two versions is here https://github.com/root-project/root/pull/14494/commits/024580db0f1009a3a6560ca75924be8d34d89c66.
After building ROOT v6.32.0 with debugging symbols, this is a stack from the above reproducer obtained with gdb:
#0 0x00002aaaab6756ad in _int_free () from /lib64/libc.so.6
#1 0x00002aaaac0f62b8 in __gnu_cxx::new_allocator<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > >::deallocate(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >*, unsigned long) ()
from /work/gallim/Postdoc/uproot_playground/root_build/lib/libcppyy_backend.so
#2 0x00002aaaac0f3353 in std::allocator_traits<std::allocator<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > > >::deallocate(std::allocator<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > >&, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >*, unsigned long) () from /work/gallim/Postdoc/uproot_playground/root_build/lib/libcppyy_backend.so
#3 0x00002aaaac0f0e6c in std::_Vector_base<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >, std::allocator<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > > >::_M_deallocate(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >*, unsigned long) () from /work/gallim/Postdoc/uproot_playground/root_build/lib/libcppyy_backend.so
#4 0x00002aaaac0ef2e0 in std::_Vector_base<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >, std::allocator<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > > >::~_Vector_base() ()
from /work/gallim/Postdoc/uproot_playground/root_build/lib/libcppyy_backend.so
#5 0x00002aaaac0ef331 in std::vector<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >, std::allocator<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > > >::~vector() ()
from /work/gallim/Postdoc/uproot_playground/root_build/lib/libcppyy_backend.so
#6 0x00002aaaac4e9ee0 in TClassEdit::TSplitType::~TSplitType() () from /work/gallim/Postdoc/uproot_playground/root_build/lib/libCore.so
#7 0x00002aaaac4e56ef in TClassEdit::ShortType[abi:cxx11](char const*, int) () from /work/gallim/Postdoc/uproot_playground/root_build/lib/libCore.so
#8 0x00002aaaac50093f in TClass::Init(char const*, short, std::type_info const*, TVirtualIsAProxy*, char const*, char const*, int, int, ClassInfo_t*, bool) () from /work/gallim/Postdoc/uproot_playground/root_build/lib/libCore.so
#9 0x00002aaaac50059c in TClass::TClass(char const*, short, std::type_info const&, TVirtualIsAProxy*, char const*, char const*, int, int, bool) () from /work/gallim/Postdoc/uproot_playground/root_build/lib/libCore.so
#10 0x00002aaaac5104b7 in ROOT::CreateClass(char const*, short, std::type_info const&, TVirtualIsAProxy*, char const*, char const*, int, int) () from /work/gallim/Postdoc/uproot_playground/root_build/lib/libCore.so
#11 0x00002aaaac52df5a in ROOT::Internal::TDefaultInitBehavior::CreateClass(char const*, short, std::type_info const&, TVirtualIsAProxy*, char const*, char const*, int, int) const () from /work/gallim/Postdoc/uproot_playground/root_build/lib/libCore.so
#12 0x00002aaaac52cc24 in ROOT::TGenericClassInfo::GetClass() () from /work/gallim/Postdoc/uproot_playground/root_build/lib/libCore.so
#13 0x00002aaaac5c8170 in TStreamerElement::Class() () from /work/gallim/Postdoc/uproot_playground/root_build/lib/libCore.so
#14 0x00002aaaada8cd72 in TStreamerInfo::Build(bool) () from /work/gallim/Postdoc/uproot_playground/root_build/lib/libRIO.so
#15 0x00002aaaac50c2e2 in TClass::GetStreamerInfoImpl(int, bool) const () from /work/gallim/Postdoc/uproot_playground/root_build/lib/libCore.so
#16 0x00002aaaac50c06b in TClass::GetStreamerInfo(int, bool) const () from /work/gallim/Postdoc/uproot_playground/root_build/lib/libCore.so
#17 0x00002aaaad9c21c0 in TBufferFile::WriteClassBuffer(TClass const*, void*) () from /work/gallim/Postdoc/uproot_playground/root_build/lib/libRIO.so
#18 0x00002aad0b55174d in TH3D::Streamer(TBuffer&) () from /work/gallim/Postdoc/uproot_playground/root_build/lib/libHist.so
#19 0x00002aaaac512c85 in TClass::StreamerTObject(TClass const*, void*, TBuffer&, TClass const*) () from /work/gallim/Postdoc/uproot_playground/root_build/lib/libCore.so
#20 0x00002aaaad9c2ec9 in TClass::Streamer(void*, TBuffer&, TClass const*) const () from /work/gallim/Postdoc/uproot_playground/root_build/lib/libRIO.so
#21 0x00002aaaad9bf2e1 in TBufferFile::WriteObjectClass(void const*, TClass const*, bool) () from /work/gallim/Postdoc/uproot_playground/root_build/lib/libRIO.so
#22 0x00002aaaad9c9bfe in TBufferIO::WriteObjectAny(void const*, TClass const*, bool) () from /work/gallim/Postdoc/uproot_playground/root_build/lib/libRIO.so
#23 0x00002aaaad9c9c80 in TBufferIO::WriteObject(TObject const*, bool) () from /work/gallim/Postdoc/uproot_playground/root_build/lib/libRIO.so
#24 0x00002aaaac0df39f in WrapperCall(long, unsigned long, void*, void*, void*) () from /work/gallim/Postdoc/uproot_playground/root_build/lib/libcppyy_backend.so
#25 0x00002aaaac0df68d in Cppyy::CallV(long, void*, unsigned long, void*) () from /work/gallim/Postdoc/uproot_playground/root_build/lib/libcppyy_backend.so
#26 0x00002aaac62a25f7 in GILCallV(long, void*, CPyCppyy::CallContext*) () from /work/gallim/Postdoc/uproot_playground/root_build/lib/libcppyy.so
#27 0x00002aaac62a51ab in CPyCppyy::(anonymous namespace)::VoidExecutor::Execute(long, void*, CPyCppyy::CallContext*) () from /work/gallim/Postdoc/uproot_playground/root_build/lib/libcppyy.so
#28 0x00002aaac62800c8 in CPyCppyy::CPPMethod::ExecuteFast(void*, long, CPyCppyy::CallContext*) () from /work/gallim/Postdoc/uproot_playground/root_build/lib/libcppyy.so
#29 0x00002aaac628080e in CPyCppyy::CPPMethod::ExecuteProtected(void*, long, CPyCppyy::CallContext*) () from /work/gallim/Postdoc/uproot_playground/root_build/lib/libcppyy.so
#30 0x00002aaac627f73c in CPyCppyy::CPPMethod::Execute(void*, long, CPyCppyy::CallContext*) () from /work/gallim/Postdoc/uproot_playground/root_build/lib/libcppyy.so
#31 0x00002aaac627f9ac in CPyCppyy::CPPMethod::Call(CPyCppyy::CPPInstance*&, _object* const*, unsigned long, _object*, CPyCppyy::CallContext*) () from /work/gallim/Postdoc/uproot_playground/root_build/lib/libcppyy.so
#32 0x00002aaac628519a in CPyCppyy::(anonymous namespace)::mp_vectorcall(CPyCppyy::CPPOverload*, _object* const*, unsigned long, _object*) () from /work/gallim/Postdoc/uproot_playground/root_build/lib/libcppyy.so
#33 0x000055555570b3de in PyObject_Vectorcall ()
#34 0x00005555555f2938 in _PyEval_EvalFrameDefault.cold ()
#35 0x00005555557c5261 in PyEval_EvalCode ()
#36 0x00005555557e9ef0 in run_eval_code_obj ()
#37 0x00005555557e4ecc in run_mod ()
#38 0x00005555558048a6 in pyrun_file ()
#39 0x00005555558032f8 in _PyRun_SimpleFileObject ()
#40 0x0000555555802fcc in _PyRun_AnyFileObject ()
#41 0x00005555557fbf7e in Py_RunMain.localalias ()
#42 0x00005555557b5027 in Py_BytesMain ()
#43 0x00002aaaab616555 in __libc_start_main () from /lib64/libc.so.6
#44 0x00005555557b441e in _start ()
Dear Experts, I found this issue still happening with ROOT 6.32+.
I do not get segfaults, but these errors instead:
input_line_208:11:25: error: no member named 'Eval' in 'TPython'
(void*)TPython::Eval("__import__('uproot').pyroot.pyroot_to_buffer.sizer")
~~~~~~~~~^
input_line_208:19:30: error: no member named 'Eval' in 'TPython'
TPyReturn out = TPython::Eval("__import__('uproot').pyroot.pyroot_to_buffer.buffer.ctypes.data");
My code is very similar to those already shown in the thread. I am using from_pyroot(hist) to then get the histogram as a Numpy histogram with the to_numpy() method.
Is there a way to go around this? Cheers, Fran
Dear @franciscosili .
Thanks for reporting it! Please let me know which version of uproot do you use? Thanks!
@franciscosili could you try using the latest version of Uproot? This was fixed in https://github.com/scikit-hep/uproot5/pull/1463