Skip to content

[ntuple] TKey with the same name as requested RNTuple causes internal RNTupleReader errors #8284

@mxxo

Description

@mxxo
  • Checked for duplicates

Describe the bug

TKeys in a TFile with the same name as the requested RNTuple will be attempted to be parsed as an RNTuple, leading to internal parser errors later on.

Expected behavior

The RNTupleReader should check the type of the TKey before parsing (and throw an exception if there's no RNTuple with the requested name).

To Reproduce

Create a TFile with a TKey with a certain name, then try to open that file as an RNTuple.

std::string filename = "some_file.root";
{
   auto file = std::make_unique<TFile>(filename.c_str(), "RECREATE", "", 209);
   auto tree = std::make_unique<TTree>("Events", "");
   file->Write();
   file->Close();
   tree.release();
}

auto ntuple = RNTupleReader::Open("Events", filename);
Fatal: nread == nbytes violated at line 1011 of `~/root/tree/ntuple/v7/src/RMiniFile.cxx'
aborting

Setup

Root master

Metadata

Metadata

Assignees

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions