-
Notifications
You must be signed in to change notification settings - Fork 1.3k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[I/O] Cannot read RVecs written with v6.24 with TTreeReader in current master #9136
Comments
Need a test for this |
Files required to reproduce (an |
diff --git a/tree/treeplayer/inc/TTreeReaderArray.h b/tree/treeplayer/inc/TTreeReaderArray.h
index 1fdab62afa..564ddcc8d9 100644
--- a/tree/treeplayer/inc/TTreeReaderArray.h
+++ b/tree/treeplayer/inc/TTreeReaderArray.h
@@ -28,9 +28,7 @@ Base class of TTreeReaderArray.
class TTreeReaderArrayBase: public TTreeReaderValueBase {
public:
- TTreeReaderArrayBase(TTreeReader* reader, const char* branchname,
- TDictionary* dict):
- TTreeReaderValueBase(reader, branchname, dict) {}
+ TTreeReaderArrayBase(TTreeReader *reader, const char *branchname, TDictionary *dict);
std::size_t GetSize() const { return fImpl->GetSize(GetProxy()); }
Bool_t IsEmpty() const { return !GetSize(); }
diff --git a/tree/treeplayer/src/TTreeReaderArray.cxx b/tree/treeplayer/src/TTreeReaderArray.cxx
index fdadfcc5f7..7f3b548d5f 100644
--- a/tree/treeplayer/src/TTreeReaderArray.cxx
+++ b/tree/treeplayer/src/TTreeReaderArray.cxx
@@ -21,6 +21,7 @@
#include "TFriendElement.h"
#include "TFriendProxy.h"
#include "TLeaf.h"
+#include "TFile.h"
#include "TList.h"
#include "TROOT.h"
#include "TStreamerInfo.h"
@@ -369,6 +370,17 @@ namespace {
ClassImp(TTreeReaderArrayBase);
+ROOT::Internal::TTreeReaderArrayBase::TTreeReaderArrayBase(TTreeReader *reader, const char *branchname,
+ TDictionary *dict)
+ : TTreeReaderValueBase(reader, branchname, dict)
+{
+ auto *f = reader->GetTree()->GetCurrentFile();
+ const auto v = f->GetVersion();
+ if (v < 62600 && std::string(dict->GetName()).find("RAdoptAllocator") != std::string::npos &&
+ std::string(dict->GetName()).rfind("std::vector<", 0) != 0)
+ R__ASSERT(0);
+}
+
////////////////////////////////////////////////////////////////////////////////
/// Create the proxy object for our branch. |
We decided we must have better diagnostics for v6.26, an actual fix would be nice to have. |
…erInfoActions This fixes root-project#9136.
The solution turned out to be straight-forward: #9750 |
…erInfoActions This fixes root-project#9136. Without this commit, SelectLooper would select the 'GenericLooper' in the case of an emulated proxy for STL collection with (in the name) a custom allocator. However the GenericLooper only usable for collection with a compiled collection proxy. In particular, GenericLooper is calling the 'Next' function which is not defined for vector ... and emulated collection. Using it lead to an assert complaining (right fully so) that an 'undefined' function is being called.
…erInfoActions This fixes root-project#9136. Without this commit, SelectLooper would select the 'GenericLooper' in the case of an emulated proxy for STL collection with (in the name) a custom allocator. However the GenericLooper only usable for collection with a compiled collection proxy. In particular, GenericLooper is calling the 'Next' function which is not defined for vector ... and emulated collection. Using it lead to an assert complaining (right fully so) that an 'undefined' function is being called.
…erInfoActions This fixes #9136. Without this commit, SelectLooper would select the 'GenericLooper' in the case of an emulated proxy for STL collection with (in the name) a custom allocator. However the GenericLooper only usable for collection with a compiled collection proxy. In particular, GenericLooper is calling the 'Next' function which is not defined for vector ... and emulated collection. Using it lead to an assert complaining (right fully so) that an 'undefined' function is being called.
…erInfoActions This fixes #9136. Without this commit, SelectLooper would select the 'GenericLooper' in the case of an emulated proxy for STL collection with (in the name) a custom allocator. However the GenericLooper only usable for collection with a compiled collection proxy. In particular, GenericLooper is calling the 'Next' function which is not defined for vector ... and emulated collection. Using it lead to an assert complaining (right fully so) that an 'undefined' function is being called.
…erInfoActions This fixes #9136. Without this commit, SelectLooper would select the 'GenericLooper' in the case of an emulated proxy for STL collection with (in the name) a custom allocator. However the GenericLooper only usable for collection with a compiled collection proxy. In particular, GenericLooper is calling the 'Next' function which is not defined for vector ... and emulated collection. Using it lead to an assert complaining (right fully so) that an 'undefined' function is being called.
…erInfoActions This fixes #9136. Without this commit, SelectLooper would select the 'GenericLooper' in the case of an emulated proxy for STL collection with (in the name) a custom allocator. However the GenericLooper only usable for collection with a compiled collection proxy. In particular, GenericLooper is calling the 'Next' function which is not defined for vector ... and emulated collection. Using it lead to an assert complaining (right fully so) that an 'undefined' function is being called.
…erInfoActions This fixes #9136. Without this commit, SelectLooper would select the 'GenericLooper' in the case of an emulated proxy for STL collection with (in the name) a custom allocator. However the GenericLooper only usable for collection with a compiled collection proxy. In particular, GenericLooper is calling the 'Next' function which is not defined for vector ... and emulated collection. Using it lead to an assert complaining (right fully so) that an 'undefined' function is being called.
Reopening until the test is ready. |
I shared the test code with an input file above. If it is urgent that I open a PR for it, please let me know and specify where you would like that test (sources, roottest, which subdirectory..). |
Can you please add it to roottest? Thanks. |
We will be testing this case with root-project/roottest#866 |
…erInfoActions This fixes root-project#9136. Without this commit, SelectLooper would select the 'GenericLooper' in the case of an emulated proxy for STL collection with (in the name) a custom allocator. However the GenericLooper only usable for collection with a compiled collection proxy. In particular, GenericLooper is calling the 'Next' function which is not defined for vector ... and emulated collection. Using it lead to an assert complaining (right fully so) that an 'undefined' function is being called.
Reading with TTree works.
This affects RDataFrame critically.
To reproduce at the prompt:
The text was updated successfully, but these errors were encountered: