Reading old tree returns error

Dear rooters,

I am trying to analyze an old TTree (the root file was produced with ROOT version 5.32, I guess the TTree also) using ROOT version 6.32.10

Describe the bug

I have the following error (even if I simply do a Print()) :

Error in <TBufferFile::ReadClassBuffer>: Could not find the StreamerInfo for version 9 of the class TBranchElement, object skipped at offset 24519
Error in <TBufferFile::CheckByteCount>: object of class TBranchElement read too few bytes: 2 instead of 545

 *** Break *** segmentation violation



===========================================================
There was a crash.
This is the entire stack trace of all threads:
===========================================================
#0  0x000076e196aea3ea in __GI___wait4 (pid=2834837, stat_loc=stat_loc
entry=0x7ffc4e35ed18, options=options
entry=0, usage=usage
entry=0x0) at ../sysdeps/unix/sysv/linux/wait4.c:30
#1  0x000076e196aea3ab in __GI___waitpid (pid=<optimized out>, stat_loc=stat_loc
entry=0x7ffc4e35ed18, options=options
entry=0) at ./posix/waitpid.c:38
#2  0x000076e196a50bdb in do_system (line=<optimized out>) at ../sysdeps/posix/system.c:171
#3  0x000076e197515a96 in TUnixSystem::StackTrace() () from /opt/cern/root/root_v6.32.10/lib/libCore.so
#4  0x000076e197512d75 in TUnixSystem::DispatchSignals(ESignals) () from /opt/cern/root/root_v6.32.10/lib/libCore.so
#5  <signal handler called>
#6  0x000076e1779b30c0 in TBranchElement::Streamer(TBuffer&) () from /opt/cern/root/root_v6.32.10/lib/libTree.so
#7  0x000076e195cdcc56 in TBufferFile::ReadObjectAny(TClass const*) () from /opt/cern/root/root_v6.32.10/lib/libRIO.so
#8  0x000076e1974716c9 in TObjArray::Streamer(TBuffer&) () from /opt/cern/root/root_v6.32.10/lib/libCore.so
#9  0x000076e195f4af04 in int TStreamerInfo::ReadBuffer<char**>(TBuffer&, char** const&, TStreamerInfo::TCompInfo* const*, int, int, int, int, int) () from /opt/cern/root/root_v6.32.10/lib/libRIO.so
#10 0x000076e195db1b84 in TStreamerInfoActions::GenericReadAction(TBuffer&, void*, TStreamerInfoActions::TConfiguration const*) () from /opt/cern/root/root_v6.32.10/lib/libRIO.so
#11 0x000076e195cdb846 in TBufferFile::ReadClassBuffer(TClass const*, void*, int, unsigned int, unsigned int, TClass const*) () from /opt/cern/root/root_v6.32.10/lib/libRIO.so
#12 0x000076e177a18fb4 in TTree::Streamer(TBuffer&) () from /opt/cern/root/root_v6.32.10/lib/libTree.so
#13 0x000076e195d87386 in TKey::ReadObj() () from /opt/cern/root/root_v6.32.10/lib/libRIO.so
#14 0x000076e195d35317 in TDirectoryFile::Get(char const*) () from /opt/cern/root/root_v6.32.10/lib/libRIO.so
#15 0x000076e197401e17 in TROOT::FindSpecialObject(char const*, void*&) () from /opt/cern/root/root_v6.32.10/lib/libCore.so
#16 0x000076e18fe29bc6 in TCling::GetObjectAddress(char const*, void*&) () from /opt/cern/root/root_v6.32.10/lib/libCling.so
#17 0x000076e18fe800c5 in TClingCallbacks::tryFindROOTSpecialInternal(clang::LookupResult&, clang::Scope*) () from /opt/cern/root/root_v6.32.10/lib/libCling.so
#18 0x000076e18fe84658 in TClingCallbacks::LookupObject(clang::LookupResult&, clang::Scope*) () from /opt/cern/root/root_v6.32.10/lib/libCling.so
#19 0x000076e18ff15f2b in cling::MultiplexInterpreterCallbacks::LookupObject(clang::LookupResult&, clang::Scope*) () from /opt/cern/root/root_v6.32.10/lib/libCling.so
#20 0x000076e190c177db in clang::MultiplexExternalSemaSource::LookupUnqualified(clang::LookupResult&, clang::Scope*) () from /opt/cern/root/root_v6.32.10/lib/libCling.so
#21 0x000076e190e4317c in clang::Sema::ClassifyName(clang::Scope*, clang::CXXScopeSpec&, clang::IdentifierInfo*&, clang::SourceLocation, clang::Token const&, clang::CorrectionCandidateCallback*) () from /opt/cern/root/root_v6.32.10/lib/libCling.so
#22 0x000076e190a920df in clang::Parser::TryAnnotateName(clang::CorrectionCandidateCallback*, clang::ImplicitTypenameContext) () from /opt/cern/root/root_v6.32.10/lib/libCling.so
#23 0x000076e190a5fe45 in clang::Parser::ParseStatementOrDeclarationAfterAttributes(llvm::SmallVector<clang::Stmt*, 32u>&, clang::Parser::ParsedStmtContext, clang::SourceLocation*, clang::ParsedAttributes&, clang::ParsedAttributes&) () from /opt/cern/root/root_v6.32.10/lib/libCling.so
#24 0x000076e190a60e9c in clang::Parser::ParseStatementOrDeclaration(llvm::SmallVector<clang::Stmt*, 32u>&, clang::Parser::ParsedStmtContext, clang::SourceLocation*) () from /opt/cern/root/root_v6.32.10/lib/libCling.so
#25 0x000076e190a687e9 in clang::Parser::ParseCompoundStatementBody(bool) () from /opt/cern/root/root_v6.32.10/lib/libCling.so
#26 0x000076e190a6a5ca in clang::Parser::ParseFunctionStatementBody(clang::Decl*, clang::Parser::ParseScope&) () from /opt/cern/root/root_v6.32.10/lib/libCling.so
#27 0x000076e190a987e3 in clang::Parser::ParseFunctionDefinition(clang::ParsingDeclarator&, clang::Parser::ParsedTemplateInfo const&, clang::Parser::LateParsedAttrList*) () from /opt/cern/root/root_v6.32.10/lib/libCling.so
#28 0x000076e1909bb44f in clang::Parser::ParseDeclGroup(clang::ParsingDeclSpec&, clang::DeclaratorContext, clang::ParsedAttributes&, clang::SourceLocation*, clang::Parser::ForRangeInit*) () from /opt/cern/root/root_v6.32.10/lib/libCling.so
#29 0x000076e190a93dff in clang::Parser::ParseDeclarationOrFunctionDefinition(clang::ParsedAttributes&, clang::ParsedAttributes&, clang::ParsingDeclSpec*, clang::AccessSpecifier) [clone .part.0] () from /opt/cern/root/root_v6.32.10/lib/libCling.so
#30 0x000076e190a9baa6 in clang::Parser::ParseExternalDeclaration(clang::ParsedAttributes&, clang::ParsedAttributes&, clang::ParsingDeclSpec*) () from /opt/cern/root/root_v6.32.10/lib/libCling.so
#31 0x000076e190a9ce06 in clang::Parser::ParseTopLevelDecl(clang::OpaquePtr<clang::DeclGroupRef>&, clang::Sema::ModuleImportState&) () from /opt/cern/root/root_v6.32.10/lib/libCling.so
#32 0x000076e18ff9d259 in cling::IncrementalParser::ParseInternal(llvm::StringRef) () from /opt/cern/root/root_v6.32.10/lib/libCling.so
#33 0x000076e18ff9e3e1 in cling::IncrementalParser::Compile(llvm::StringRef, cling::CompilationOptions const&) () from /opt/cern/root/root_v6.32.10/lib/libCling.so
#34 0x000076e18ff0d89f 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 /opt/cern/root/root_v6.32.10/lib/libCling.so
#35 0x000076e18ff0dc48 in cling::Interpreter::process(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const&, cling::Value*, cling::Transaction**, bool) () from /opt/cern/root/root_v6.32.10/lib/libCling.so
#36 0x000076e18fff4697 in cling::MetaProcessor::process(llvm::StringRef, cling::Interpreter::CompilationResult&, cling::Value*, bool) () from /opt/cern/root/root_v6.32.10/lib/libCling.so
#37 0x000076e18fe063dc in HandleInterpreterException(cling::MetaProcessor*, char const*, cling::Interpreter::CompilationResult&, cling::Value*) () from /opt/cern/root/root_v6.32.10/lib/libCling.so
#38 0x000076e18fe1b0e8 in TCling::ProcessLine(char const*, TInterpreter::EErrorCode*) () from /opt/cern/root/root_v6.32.10/lib/libCling.so
#39 0x000076e19789b3db in TRint::ProcessLineNr(char const*, char const*, int*) () from /opt/cern/root/root_v6.32.10/lib/libRint.so
#40 0x000076e19789b7dc in TRint::HandleTermInput() () from /opt/cern/root/root_v6.32.10/lib/libRint.so
#41 0x000076e197511cdc in TUnixSystem::CheckDescriptors() () from /opt/cern/root/root_v6.32.10/lib/libCore.so
#42 0x000076e197513aa8 in TUnixSystem::DispatchOneEvent(bool) () from /opt/cern/root/root_v6.32.10/lib/libCore.so
#43 0x000076e197421107 in TSystem::Run() () from /opt/cern/root/root_v6.32.10/lib/libCore.so
#44 0x000076e1973a8da7 in TApplication::Run(bool) () from /opt/cern/root/root_v6.32.10/lib/libCore.so
#45 0x000076e19789d39b in TRint::Run(bool) () from /opt/cern/root/root_v6.32.10/lib/libRint.so
#46 0x00005f759e9fc2f3 in main ()
===========================================================


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
preferably using the command (.forum bug) in the ROOT prompt.
Only if you are really convinced it is a bug in ROOT then please submit a
report at https://root.cern/bugs or (preferably) using the command (.gh bug) in
the ROOT prompt. Please post the ENTIRE stack trace
from above as an attachment in addition to anything else
that might help us fixing this issue.
===========================================================
#6  0x000076e1779b30c0 in TBranchElement::Streamer(TBuffer&) () from /opt/cern/root/root_v6.32.10/lib/libTree.so
#7  0x000076e195cdcc56 in TBufferFile::ReadObjectAny(TClass const*) () from /opt/cern/root/root_v6.32.10/lib/libRIO.so
#8  0x000076e1974716c9 in TObjArray::Streamer(TBuffer&) () from /opt/cern/root/root_v6.32.10/lib/libCore.so
#9  0x000076e195f4af04 in int TStreamerInfo::ReadBuffer<char**>(TBuffer&, char** const&, TStreamerInfo::TCompInfo* const*, int, int, int, int, int) () from /opt/cern/root/root_v6.32.10/lib/libRIO.so
#10 0x000076e195db1b84 in TStreamerInfoActions::GenericReadAction(TBuffer&, void*, TStreamerInfoActions::TConfiguration const*) () from /opt/cern/root/root_v6.32.10/lib/libRIO.so
#11 0x000076e195cdb846 in TBufferFile::ReadClassBuffer(TClass const*, void*, int, unsigned int, unsigned int, TClass const*) () from /opt/cern/root/root_v6.32.10/lib/libRIO.so
#12 0x000076e177a18fb4 in TTree::Streamer(TBuffer&) () from /opt/cern/root/root_v6.32.10/lib/libTree.so
#13 0x000076e195d87386 in TKey::ReadObj() () from /opt/cern/root/root_v6.32.10/lib/libRIO.so
#14 0x000076e195d35317 in TDirectoryFile::Get(char const*) () from /opt/cern/root/root_v6.32.10/lib/libRIO.so
#15 0x000076e197401e17 in TROOT::FindSpecialObject(char const*, void*&) () from /opt/cern/root/root_v6.32.10/lib/libCore.so
#16 0x000076e18fe29bc6 in TCling::GetObjectAddress(char const*, void*&) () from /opt/cern/root/root_v6.32.10/lib/libCling.so
#17 0x000076e18fe800c5 in TClingCallbacks::tryFindROOTSpecialInternal(clang::LookupResult&, clang::Scope*) () from /opt/cern/root/root_v6.32.10/lib/libCling.so
#18 0x000076e18fe84658 in TClingCallbacks::LookupObject(clang::LookupResult&, clang::Scope*) () from /opt/cern/root/root_v6.32.10/lib/libCling.so
#19 0x000076e18ff15f2b in cling::MultiplexInterpreterCallbacks::LookupObject(clang::LookupResult&, clang::Scope*) () from /opt/cern/root/root_v6.32.10/lib/libCling.so
#20 0x000076e190c177db in clang::MultiplexExternalSemaSource::LookupUnqualified(clang::LookupResult&, clang::Scope*) () from /opt/cern/root/root_v6.32.10/lib/libCling.so
#21 0x000076e190e4317c in clang::Sema::ClassifyName(clang::Scope*, clang::CXXScopeSpec&, clang::IdentifierInfo*&, clang::SourceLocation, clang::Token const&, clang::CorrectionCandidateCallback*) () from /opt/cern/root/root_v6.32.10/lib/libCling.so
#22 0x000076e190a920df in clang::Parser::TryAnnotateName(clang::CorrectionCandidateCallback*, clang::ImplicitTypenameContext) () from /opt/cern/root/root_v6.32.10/lib/libCling.so
#23 0x000076e190a5fe45 in clang::Parser::ParseStatementOrDeclarationAfterAttributes(llvm::SmallVector<clang::Stmt*, 32u>&, clang::Parser::ParsedStmtContext, clang::SourceLocation*, clang::ParsedAttributes&, clang::ParsedAttributes&) () from /opt/cern/root/root_v6.32.10/lib/libCling.so
#24 0x000076e190a60e9c in clang::Parser::ParseStatementOrDeclaration(llvm::SmallVector<clang::Stmt*, 32u>&, clang::Parser::ParsedStmtContext, clang::SourceLocation*) () from /opt/cern/root/root_v6.32.10/lib/libCling.so
#25 0x000076e190a687e9 in clang::Parser::ParseCompoundStatementBody(bool) () from /opt/cern/root/root_v6.32.10/lib/libCling.so
#26 0x000076e190a6a5ca in clang::Parser::ParseFunctionStatementBody(clang::Decl*, clang::Parser::ParseScope&) () from /opt/cern/root/root_v6.32.10/lib/libCling.so
#27 0x000076e190a987e3 in clang::Parser::ParseFunctionDefinition(clang::ParsingDeclarator&, clang::Parser::ParsedTemplateInfo const&, clang::Parser::LateParsedAttrList*) () from /opt/cern/root/root_v6.32.10/lib/libCling.so
#28 0x000076e1909bb44f in clang::Parser::ParseDeclGroup(clang::ParsingDeclSpec&, clang::DeclaratorContext, clang::ParsedAttributes&, clang::SourceLocation*, clang::Parser::ForRangeInit*) () from /opt/cern/root/root_v6.32.10/lib/libCling.so
#29 0x000076e190a93dff in clang::Parser::ParseDeclarationOrFunctionDefinition(clang::ParsedAttributes&, clang::ParsedAttributes&, clang::ParsingDeclSpec*, clang::AccessSpecifier) [clone .part.0] () from /opt/cern/root/root_v6.32.10/lib/libCling.so
#30 0x000076e190a9baa6 in clang::Parser::ParseExternalDeclaration(clang::ParsedAttributes&, clang::ParsedAttributes&, clang::ParsingDeclSpec*) () from /opt/cern/root/root_v6.32.10/lib/libCling.so
#31 0x000076e190a9ce06 in clang::Parser::ParseTopLevelDecl(clang::OpaquePtr<clang::DeclGroupRef>&, clang::Sema::ModuleImportState&) () from /opt/cern/root/root_v6.32.10/lib/libCling.so
#32 0x000076e18ff9d259 in cling::IncrementalParser::ParseInternal(llvm::StringRef) () from /opt/cern/root/root_v6.32.10/lib/libCling.so
#33 0x000076e18ff9e3e1 in cling::IncrementalParser::Compile(llvm::StringRef, cling::CompilationOptions const&) () from /opt/cern/root/root_v6.32.10/lib/libCling.so
#34 0x000076e18ff0d89f 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 /opt/cern/root/root_v6.32.10/lib/libCling.so
#35 0x000076e18ff0dc48 in cling::Interpreter::process(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const&, cling::Value*, cling::Transaction**, bool) () from /opt/cern/root/root_v6.32.10/lib/libCling.so
#36 0x000076e18fff4697 in cling::MetaProcessor::process(llvm::StringRef, cling::Interpreter::CompilationResult&, cling::Value*, bool) () from /opt/cern/root/root_v6.32.10/lib/libCling.so
#37 0x000076e18fe063dc in HandleInterpreterException(cling::MetaProcessor*, char const*, cling::Interpreter::CompilationResult&, cling::Value*) () from /opt/cern/root/root_v6.32.10/lib/libCling.so
===========================================================

I interpret this as a version issue but maybe I am wrong?
I read the forum to find similar errors and I try to recompile all my libraries with a new ClassDef value, but this tree hold simple classes (array, etc…). This does work.

I am also suspecting some kind of corruption as other files probably generated with the same code/version do work.

I would like some help to start looking somewhere…

Thank you in advance

Setup

ROOT v6.32.10
Built for linuxx8664gcc on Mar 26 2025, 08:51:43 
From tags/6-32-10@6-32-10    
With c++ (Ubuntu 11.4.0-1ubuntu1~22.04) 11.4.0     

Hi,

Did you already try what this post suggest Decoding StreamerInfo error message ?

Cheers,
D

Danilo

thank you for your answer, yes I saw this post but I must admit I did not fully understood it (I deduced that I had to load old libraries but this it not what is written).

So what I understand now is to first open a file containing a TTree that works and then the failing one.

I did this and at least a simple Print() method does not crash anymore.

So I went on and started an analysis process (using the Process method on a compiled TSelector) and this is now the new crash:

===========================================================
#6  0x000073f66ce91988 in vtable for TObjLink () from /opt/cern/root/root_v6.32.10/lib/libCore.so
#7  0x000073f66b4e0e38 in TBufferIO::MapObject(TObject const*, unsigned int) () from /opt/cern/root/root_v6.32.10/lib/libRIO.so
#8  0x000073f64cf9d2f3 in TBranchElement::ReadLeavesMember(TBuffer&) () from /opt/cern/root/root_v6.32.10/lib/libTree.so
#9  0x000073f64cf95540 in TBranch::GetEntry(long long, int) () from /opt/cern/root/root_v6.32.10/lib/libTree.so
#10 0x000073f64cfa8405 in TBranchElement::GetEntry(long long, int) () from /opt/cern/root/root_v6.32.10/lib/libTree.so
#11 0x000073f65a7269a5 in ttree_analysis::ReadInitData(long long, long long) () from /data/RIKEN/DayOne/users/gib/macros/ttree_analysis_C.so
#12 0x000073f65a7287d1 in ttree_analysis::ProcessAnalysis(long long, bool) () from /data/RIKEN/DayOne/users/gib/macros/ttree_analysis_C.so
#13 0x000073f64c76af8f in TTreePlayer::Process(TSelector*, char const*, long long, long long) () from /opt/cern/root/root_v6.32.10/lib/libTreePlayer.so
#14 0x000073f64c76e4bb in TTreePlayer::Process(char const*, char const*, long long, long long) () from /opt/cern/root/root_v6.32.10/lib/libTreePlayer.so
#15 0x000073f662f8f07e in ?? ()
#16 0x0000000000000000 in ?? ()
===========================================================

I feel like TBranchElement is still a problem

Can you share your failing file?

Dear Philippe,

the file is rather big and contains data so I sent a link to you directly,

Julien

Je l’ai bien recu.

I can reproduce the problem.

How was the file produced (eg. by merging other files)? The error message is ‘accurate’ and the StreamerInfo v9 for the TBranchElement is missing from the file.

Philippe,

thank you for checking.

The file was not exactly merge, but I edited it to add trees generated by the same code, with different conditions. I guess it could be similar than a merge.

If I follow you correctly, is there a way to add the “StreamerInfo v9 for the TBranchElement” a posteriori (or to regenerate it)?

Regards

Dear Philippe, dear all,

I would like to reactivate this conversation.

Is there anything you can suggest to solve the problem ? Other that loading another tree before ?

Thank you in advance,
Best

Maybe related: https://its.cern.ch/jira/browse/ROOT-4833