Skip to content

[ntuple] Throw informative error when collection proxy dictionary is missing (#21274) - #23766

Open
ishaaaan17 wants to merge 1 commit into
root-project:masterfrom
ishaaaan17:fix/rntuple-missing-dict-error
Open

ishaaaan17 wants to merge 1 commit into
root-project:masterfrom
ishaaaan17:fix/rntuple-missing-dict-error

Conversation

@ishaaaan17

Copy link
Copy Markdown
Contributor

summary of changes

fixes #21274.

when an RNTuple collection proxy field (for example std::set or std::map) was created for a type that has no dictionary, ROOT hit an assertion failure in TGenCollectionProxy.cxx:401 (R__ASSERT(e->IsValid())), or failed while inspecting the collection proxy.

this change:

  1. checks classp->HasDictionary() in the constructor of RProxiedCollectionField, before the collection proxy is generated, and throws a ROOT::RException with the name of the missing type ("<type> has no dictionary entry available").
  2. adds a unit test in tree/ntuple/test/ntuple_types.cxx under TEST(RNTuple, TVirtualCollectionProxy). it checks that a collection type without a loaded dictionary (std::map<double, double>) throws a ROOT::RException with this error message.

checklist

  • code style checked with .clang-format
  • unit test added
  • follows the minimal diff guidelines (12 lines added, 0 deleted)

ai disclosure

Assisted-by: antigravity:gemini. i used an ai assistant to follow the collection proxy generation call stack in RProxiedCollectionField and TGenCollectionProxy. i checked the dictionary lookup against TClass::HasDictionary(), wrote the unit test and the exception check, and checked the formatting with .clang-format.

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[ntuple] ROOT crashes when type info of collection proxy-based fields is not available

3 participants