[ntuple] Crash when using RNTuple at prompt
The crash happens when trying to directly use a RNTuple object that was stored in a file at the prompt rather than going through _file0->Get<ROOT::Experimental::RNTuple>("Events") (which works).
This particular file was produced with RNTupleImporter, but I guess/hope it does not matter.
$ root -l data/Run2012BC_DoubleMuParked_Muons.zstd.ntuple
root [0]
Attaching file data/Run2012BC_DoubleMuParked_Muons.zstd.ntuple as _file0...
(TFile *) 0x55fecfbb7140
root [1] _file0->ls()
TFile** data/Run2012BC_DoubleMuParked_Muons.zstd.ntuple
TFile* data/Run2012BC_DoubleMuParked_Muons.zstd.ntuple
KEY: ROOT::Experimental::RNTuple Events;1 object title
root [2] Events<Enter>
*** Break *** segmentation violation
===========================================================
There was a crash.
This is the entire stack trace of all threads:
===========================================================
#0 0x00007f17510ea707 in __GI___wait4 (pid=109605, stat_loc=stat_loc
entry=0x7ffd9df79db8, options=options
entry=0, usage=usage
entry=0x0) at ../sysdeps/unix/sysv/linux/wait4.c:30
#1 0x00007f17510ea6cb in __GI___waitpid (pid=<optimized out>, stat_loc=stat_loc
entry=0x7ffd9df79db8, options=options
entry=0) at waitpid.c:38
#2 0x00007f17510627fb in do_system (line=<optimized out>) at ../sysdeps/posix/system.c:171
#3 0x00007f1751960d69 in TUnixSystem::Exec (shellcmd=<optimized out>, this=0x55fecde2a420) at ../core/unix/src/TUnixSystem.cxx:2104
#4 TUnixSystem::StackTrace (this=0x55fecde2a420) at ../core/unix/src/TUnixSystem.cxx:2395
#5 0x00007f17519606f4 in TUnixSystem::DispatchSignals (this=0x55fecde2a420, sig=kSigSegmentationViolation) at ../core/unix/src/TUnixSystem.cxx:3615
#6 <signal handler called>
#7 0x00007f174bc8faac in TCling__GetObjectDecl (obj=0x55fed02b7470) at ../core/metacling/src/TCling.cxx:603
#8 0x00007f174bce6d72 in TClingCallbacks::tryFindROOTSpecialInternal (this=this
entry=0x55fece888730, R=..., S=S
entry=0x55fecdea0250) at ../core/metacling/src/TClingCallbacks.cxx:772
#9 0x00007f174bce8e51 in TClingCallbacks::LookupObject (this=0x55fece888730, R=..., S=0x55fecdea0250) at ../core/metacling/src/TClingCallbacks.cxx:402
#10 0x00007f174bd7939f in cling::MultiplexInterpreterCallbacks::LookupObject(clang::LookupResult&, clang::Scope*) () from /home/blue/ROOT/relwithdebinfo-perf/cmake-build-foo/install/lib/libCling.so
#11 0x00007f174c94bf1c in clang::MultiplexExternalSemaSource::LookupUnqualified(clang::LookupResult&, clang::Scope*) () from /home/blue/ROOT/relwithdebinfo-perf/cmake-build-foo/install/lib/libCling.so
#12 0x00007f174cb36a92 in clang::Sema::ClassifyName(clang::Scope*, clang::CXXScopeSpec&, clang::IdentifierInfo*&, clang::SourceLocation, clang::Token const&, clang::CorrectionCandidateCallback*) () from /home/blue/ROOT/relwithdebinfo-perf/cmake-build-foo/install/lib/libCling.so
#13 0x00007f174c7d02fe in clang::Parser::TryAnnotateName(clang::CorrectionCandidateCallback*) () from /home/blue/ROOT/relwithdebinfo-perf/cmake-build-foo/install/lib/libCling.so
#14 0x00007f174c79f729 in clang::Parser::ParseStatementOrDeclarationAfterAttributes(llvm::SmallVector<clang::Stmt*, 32u>&, clang::Parser::ParsedStmtContext, clang::SourceLocation*, clang::ParsedAttributesWithRange&) () from /home/blue/ROOT/relwithdebinfo-perf/cmake-build-foo/install/lib/libCling.so
#15 0x00007f174c79fab4 in clang::Parser::ParseStatementOrDeclaration(llvm::SmallVector<clang::Stmt*, 32u>&, clang::Parser::ParsedStmtContext, clang::SourceLocation*) () from /home/blue/ROOT/relwithdebinfo-perf/cmake-build-foo/install/lib/libCling.so
#16 0x00007f174c7a7902 in clang::Parser::ParseCompoundStatementBody(bool) () from /home/blue/ROOT/relwithdebinfo-perf/cmake-build-foo/install/lib/libCling.so
#17 0x00007f174c7a9bcc in clang::Parser::ParseFunctionStatementBody(clang::Decl*, clang::Parser::ParseScope&) () from /home/blue/ROOT/relwithdebinfo-perf/cmake-build-foo/install/lib/libCling.so
#18 0x00007f174c7d5ac5 in clang::Parser::ParseFunctionDefinition(clang::ParsingDeclarator&, clang::Parser::ParsedTemplateInfo const&, clang::Parser::LateParsedAttrList*) () from /home/blue/ROOT/relwithdebinfo-perf/cmake-build-foo/install/lib/libCling.so
#19 0x00007f174c70dd20 in clang::Parser::ParseDeclGroup(clang::ParsingDeclSpec&, clang::DeclaratorContext, clang::SourceLocation*, clang::Parser::ForRangeInit*) () from /home/blue/ROOT/relwithdebinfo-perf/cmake-build-foo/install/lib/libCling.so
#20 0x00007f174c7d1e54 in clang::Parser::ParseDeclarationOrFunctionDefinition(clang::ParsedAttributesWithRange&, clang::ParsingDeclSpec*, clang::AccessSpecifier) [clone .part.0] () from /home/blue/ROOT/relwithdebinfo-perf/cmake-build-foo/install/lib/libCling.so
#21 0x00007f174c7d8830 in clang::Parser::ParseExternalDeclaration(clang::ParsedAttributesWithRange&, clang::ParsingDeclSpec*) () from /home/blue/ROOT/relwithdebinfo-perf/cmake-build-foo/install/lib/libCling.so
#22 0x00007f174c7d9900 in clang::Parser::ParseTopLevelDecl(clang::OpaquePtr<clang::DeclGroupRef>&, bool) () from /home/blue/ROOT/relwithdebinfo-perf/cmake-build-foo/install/lib/libCling.so
#23 0x00007f174be0d87a in cling::IncrementalParser::ParseInternal(llvm::StringRef) () from /home/blue/ROOT/relwithdebinfo-perf/cmake-build-foo/install/lib/libCling.so
#24 0x00007f174be0e9b0 in cling::IncrementalParser::Compile(llvm::StringRef, cling::CompilationOptions const&) () from /home/blue/ROOT/relwithdebinfo-perf/cmake-build-foo/install/lib/libCling.so
#25 0x00007f174bd71127 in cling::Interpreter::EvaluateInternal(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const&, cling::CompilationOptions, cling::Value*, cling::Transaction**, unsigned long) () from /home/blue/ROOT/relwithdebinfo-perf/cmake-build-foo/install/lib/libCling.so
#26 0x00007f174bd7152d in cling::Interpreter::process(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const&, cling::Value*, cling::Transaction**, bool) () from /home/blue/ROOT/relwithdebinfo-perf/cmake-build-foo/install/lib/libCling.so
#27 0x00007f174be638ab in cling::MetaProcessor::process(llvm::StringRef, cling::Interpreter::CompilationResult&, cling::Value*, bool) () from /home/blue/ROOT/relwithdebinfo-perf/cmake-build-foo/install/lib/libCling.so
#28 0x00007f174bc85e4d in HandleInterpreterException (metaProcessor=0x55fecea7b020, input_line=0x55fecfb58800 "#line 1 \"ROOT_prompt_2\"\nEvents", compRes=
0x7ffd9df7f23c: cling::Interpreter::kSuccess, result=result
entry=0x7ffd9df7f250) at ../core/metacling/src/TCling.cxx:2428
#29 0x00007f174bca2557 in TCling::ProcessLine (this=0x55fecde8e9d0, line=<optimized out>, error=0x7ffd9df7f60c) at /usr/include/c++/12.2.1/bits/unique_ptr.h:191
#30 0x00007f1751c052e5 in TRint::ProcessLineNr (this=this
entry=0x55fecde5ddd0, filestem=filestem
entry=0x7f1751c163f8 "ROOT_prompt_", line=0x7ffd9df7f6c9 "Events", error=0x7ffd9df7f60c, error
entry=0x0) at ../core/rint/src/TRint.cxx:801
#31 0x00007f1751c056ba in TRint::HandleTermInput (this=0x55fecde5ddd0) at ../core/rint/src/TRint.cxx:648
#32 0x00007f175195d0b5 in TUnixSystem::CheckDescriptors (this=this
entry=0x55fecde2a420) at ../core/unix/src/TUnixSystem.cxx:1306
#33 0x00007f17519604b8 in TUnixSystem::DispatchOneEvent (this=0x55fecde2a420, pendingOnly=<optimized out>) at ../core/unix/src/TUnixSystem.cxx:1061
#34 0x00007f175187fa88 in TSystem::InnerLoop (this=0x55fecde2a420) at ../core/base/src/TSystem.cxx:406
#35 TSystem::Run (this=0x55fecde2a420) at ../core/base/src/TSystem.cxx:356
#36 0x00007f17518098cb in TApplication::Run (this=this
entry=0x55fecde5ddd0, retrn=retrn
entry=false) at ../core/base/src/TApplication.cxx:1677
#37 0x00007f1751c07062 in TRint::Run (this=this
entry=0x55fecde5ddd0, retrn=retrn
entry=false) at ../core/rint/src/TRint.cxx:501
#38 0x000055feccf191cf in main (argc=<optimized out>, argv=0x7ffd9df81ae8) at ../main/src/rmain.cxx:84
===========================================================
The lines below might hint at the cause of the crash. If you see question
marks as part of the stack trace, try to recompile with debugging information
enabled and export CLING_DEBUG=1 environment variable before running.
You may get help by asking at the ROOT forum https://root.cern/forum
Only if you are really convinced it is a bug in ROOT then please submit a
report at https://root.cern/bugs Please post the ENTIRE stack trace
from above as an attachment in addition to anything else
that might help us fixing this issue.
===========================================================
#7 0x00007f174bc8faac in TCling__GetObjectDecl (obj=0x55fed02b7470) at ../core/metacling/src/TCling.cxx:603
#8 0x00007f174bce6d72 in TClingCallbacks::tryFindROOTSpecialInternal (this=this
entry=0x55fece888730, R=..., S=S
entry=0x55fecdea0250) at ../core/metacling/src/TClingCallbacks.cxx:772
#9 0x00007f174bce8e51 in TClingCallbacks::LookupObject (this=0x55fece888730, R=..., S=0x55fecdea0250) at ../core/metacling/src/TClingCallbacks.cxx:402
#10 0x00007f174bd7939f in cling::MultiplexInterpreterCallbacks::LookupObject(clang::LookupResult&, clang::Scope*) () from /home/blue/ROOT/relwithdebinfo-perf/cmake-build-foo/install/lib/libCling.so
#11 0x00007f174c94bf1c in clang::MultiplexExternalSemaSource::LookupUnqualified(clang::LookupResult&, clang::Scope*) () from /home/blue/ROOT/relwithdebinfo-perf/cmake-build-foo/install/lib/libCling.so
#12 0x00007f174cb36a92 in clang::Sema::ClassifyName(clang::Scope*, clang::CXXScopeSpec&, clang::IdentifierInfo*&, clang::SourceLocation, clang::Token const&, clang::CorrectionCandidateCallback*) () from /home/blue/ROOT/relwithdebinfo-perf/cmake-build-foo/install/lib/libCling.so
#13 0x00007f174c7d02fe in clang::Parser::TryAnnotateName(clang::CorrectionCandidateCallback*) () from /home/blue/ROOT/relwithdebinfo-perf/cmake-build-foo/install/lib/libCling.so
#14 0x00007f174c79f729 in clang::Parser::ParseStatementOrDeclarationAfterAttributes(llvm::SmallVector<clang::Stmt*, 32u>&, clang::Parser::ParsedStmtContext, clang::SourceLocation*, clang::ParsedAttributesWithRange&) () from /home/blue/ROOT/relwithdebinfo-perf/cmake-build-foo/install/lib/libCling.so
#15 0x00007f174c79fab4 in clang::Parser::ParseStatementOrDeclaration(llvm::SmallVector<clang::Stmt*, 32u>&, clang::Parser::ParsedStmtContext, clang::SourceLocation*) () from /home/blue/ROOT/relwithdebinfo-perf/cmake-build-foo/install/lib/libCling.so
#16 0x00007f174c7a7902 in clang::Parser::ParseCompoundStatementBody(bool) () from /home/blue/ROOT/relwithdebinfo-perf/cmake-build-foo/install/lib/libCling.so
#17 0x00007f174c7a9bcc in clang::Parser::ParseFunctionStatementBody(clang::Decl*, clang::Parser::ParseScope&) () from /home/blue/ROOT/relwithdebinfo-perf/cmake-build-foo/install/lib/libCling.so
#18 0x00007f174c7d5ac5 in clang::Parser::ParseFunctionDefinition(clang::ParsingDeclarator&, clang::Parser::ParsedTemplateInfo const&, clang::Parser::LateParsedAttrList*) () from /home/blue/ROOT/relwithdebinfo-perf/cmake-build-foo/install/lib/libCling.so
#19 0x00007f174c70dd20 in clang::Parser::ParseDeclGroup(clang::ParsingDeclSpec&, clang::DeclaratorContext, clang::SourceLocation*, clang::Parser::ForRangeInit*) () from /home/blue/ROOT/relwithdebinfo-perf/cmake-build-foo/install/lib/libCling.so
#20 0x00007f174c7d1e54 in clang::Parser::ParseDeclarationOrFunctionDefinition(clang::ParsedAttributesWithRange&, clang::ParsingDeclSpec*, clang::AccessSpecifier) [clone .part.0] () from /home/blue/ROOT/relwithdebinfo-perf/cmake-build-foo/install/lib/libCling.so
#21 0x00007f174c7d8830 in clang::Parser::ParseExternalDeclaration(clang::ParsedAttributesWithRange&, clang::ParsingDeclSpec*) () from /home/blue/ROOT/relwithdebinfo-perf/cmake-build-foo/install/lib/libCling.so
#22 0x00007f174c7d9900 in clang::Parser::ParseTopLevelDecl(clang::OpaquePtr<clang::DeclGroupRef>&, bool) () from /home/blue/ROOT/relwithdebinfo-perf/cmake-build-foo/install/lib/libCling.so
#23 0x00007f174be0d87a in cling::IncrementalParser::ParseInternal(llvm::StringRef) () from /home/blue/ROOT/relwithdebinfo-perf/cmake-build-foo/install/lib/libCling.so
#24 0x00007f174be0e9b0 in cling::IncrementalParser::Compile(llvm::StringRef, cling::CompilationOptions const&) () from /home/blue/ROOT/relwithdebinfo-perf/cmake-build-foo/install/lib/libCling.so
#25 0x00007f174bd71127 in cling::Interpreter::EvaluateInternal(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const&, cling::CompilationOptions, cling::Value*, cling::Transaction**, unsigned long) () from /home/blue/ROOT/relwithdebinfo-perf/cmake-build-foo/install/lib/libCling.so
#26 0x00007f174bd7152d in cling::Interpreter::process(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const&, cling::Value*, cling::Transaction**, bool) () from /home/blue/ROOT/relwithdebinfo-perf/cmake-build-foo/install/lib/libCling.so
#27 0x00007f174be638ab in cling::MetaProcessor::process(llvm::StringRef, cling::Interpreter::CompilationResult&, cling::Value*, bool) () from /home/blue/ROOT/relwithdebinfo-perf/cmake-build-foo/install/lib/libCling.so
#28 0x00007f174bc85e4d in HandleInterpreterException (metaProcessor=0x55fecea7b020, input_line=0x55fecfb58800 "#line 1 "ROOT_prompt_2"nEvents", compRes=
0x7ffd9df7f23c: cling::Interpreter::kSuccess, result=result
entry=0x7ffd9df7f250) at ../core/metacling/src/TCling.cxx:2428
===========================================================
This is a missing feature in TClingCallbacks::tryFindROOTSpecialInternal (see core/metacling/src/TClingCallbacks.cxx:733) and/or TCling__GetObjectAddress which assumes that the object retrieved inherits from TObject (as the left most base).
I think I hit this again with a different invocation:
auto ntpl = ROOT::Experimental::RNTupleReader::Open(Events);
where _file0->ls() gives:
root [3] _file0->ls()
TFile** data/AGC/nanoaod-rntuple/zstd/ST_s-channel_4f_InclusiveDecays_13TeV-amcatnlo-pythia8/cmsopendata2015_single_top_s_chan_19394_PU25nsData2015v1_76X_mcRun2_asymptotic_v12-v1_00000_0000.root
TFile* data/AGC/nanoaod-rntuple/zstd/ST_s-channel_4f_InclusiveDecays_13TeV-amcatnlo-pythia8/cmsopendata2015_single_top_s_chan_19394_PU25nsData2015v1_76X_mcRun2_asymptotic_v12-v1_00000_0000.root
KEY: ROOT::Experimental::RNTuple Events;1 object title
Yes, it's still there in master.
#17362 fixes the crash; if we want to actually support using non-TObject names like that, that'll need some extra work. Do we, though? I personally don't like this feature very much and I'd rather not have it for non-TObjects.