We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
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
When accessed after the generating RNTupleReader is gone, the RNTupleView segfaults. It should fail more gracefully.
TEST(RNTuple, ViewPastLifetime) { FileRaii fileGuard("test_ntuple_view_pastlifetime.root"); auto model = RNTupleModel::Create(); auto fieldPt = model->MakeField<float>("pt", 42.0); { auto writer = RNTupleWriter::Recreate(std::move(model), "ntpl", fileGuard.GetPath()); writer->Fill(); } auto reader = RNTupleReader::Open("ntpl", fileGuard.GetPath()); EXPECT_EQ(1u, reader->GetNEntries()); auto viewPt = reader->GetView<float>("pt"); reader.reset(); EXPECT_FLOAT_EQ(42.0, viewPt(0)); }
master
n/a
No response
The text was updated successfully, but these errors were encountered:
Reproducer without unknown FileRaii class:
#include <ROOT/RNTupleModel.hxx> #include <ROOT/RNTupleWriter.hxx> #include <ROOT/RNTupleReader.hxx> using RNTupleModel = ROOT::Experimental::RNTupleModel; using RNTupleWriter = ROOT::Experimental::RNTupleWriter; using RNTupleReader = ROOT::Experimental::RNTupleReader; void ntuple() { auto model = RNTupleModel::Create(); auto fieldPt = model->MakeField<float>("pt", 42.0); { auto writer = RNTupleWriter::Recreate(std::move(model), "ntpl", "test_ntuple_view_pastlifetime.root"); writer->Fill(); } auto reader = RNTupleReader::Open("ntpl", "test_ntuple_view_pastlifetime.root"); // EXPECT_EQ(1u, reader->GetNEntries()); auto viewPt = reader->GetView<float>("pt"); reader.reset(); viewPt(0); }
I guess RNTuple should keep a shared_ptr to all GetViews created and invalidate them individually if reader.reset is called.
Sorry, something went wrong.
jblomer
No branches or pull requests
Check duplicate issues.
Description
When accessed after the generating RNTupleReader is gone, the RNTupleView segfaults. It should fail more gracefully.
Reproducer
ROOT version
master
Installation method
n/a
Operating system
n/a
Additional context
No response
The text was updated successfully, but these errors were encountered: