-
Notifications
You must be signed in to change notification settings - Fork 1.3k
New issue
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
meta: Disable TClass creation during tear down. #17814
Open
pcanal
wants to merge
3
commits into
root-project:master
Choose a base branch
from
pcanal:TClass-tear-down
base: master
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Test Results 18 files 18 suites 4d 12h 9m 30s ⏱️ For more details on these failures, see this check. Results for commit d2ef677. ♻️ This comment has been updated with latest results. |
1 task
hageboeck
approved these changes
Feb 27, 2025
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
Since code assume that the creation will succeed rather than returning nullptr, we create a trivial/empty TClass instead. This fixes root-project#17757
6c30c41
to
aca1b48
Compare
This fixes part of https://its.cern.ch/jira/browse/ROOT-10621 ``` ==1043887== Invalid write of size 8 ==1043887== at 0x48516D0: memmove (vg_replace_strmem.c:1414) ==1043887== by 0x61D7416: TString::Replace(int, int, char const*, int) (TString.cxx:1073) ==1043887== by 0x61D5997: TString::operator=(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const&) (TString.cxx:334) ==1043887== by 0x9CF27C1: TCling::MethodInfo_GetMangledName(MethodInfo_t*) const (TCling.cxx:9143) ==1043887== by 0x62AEF87: TFunction::TFunction(MethodInfo_t*) (TFunction.cxx:45) ==1043887== by 0x62BE03F: TMethod::TMethod(MethodInfo_t*, TClass*) (TMethod.cxx:41) ==1043887== by 0x62BBA20: TListOfFunctions::Get(void const*) (TListOfFunctions.cxx:297) ==1043887== by 0x628D5A4: TClass::GetClassMethodWithPrototype(char const*, char const*, bool, ROOT::EFunctionMatchMode) (TClass.cxx:4641) ==1043887== by 0x6292A4B: TClass::Property() const (TClass.cxx:6243) ==1043887== by 0x6291D99: TClass::IsForeign() const (TClass.cxx:6058) ==1043887== by 0x59069C8: TBufferFile::WriteVersion(TClass const*, bool) (TBufferFile.cxx:3157) ==1043887== by 0x61AB480: TObject::Streamer(TBuffer&) (TObject.cxx:933) ==1043887== by 0x62390AE: TList::Streamer(TBuffer&) (TList.cxx:1248) ==1043887== by 0x59C4B03: TKey::TKey(TObject const*, char const*, int, TDirectory*) (TKey.cxx:246) ==1043887== by 0x5994C31: TFile::WriteStreamerInfo() (TFile.cxx:3897) ==1043887== by 0x59878C6: TFile::Close(char const*) (TFile.cxx:976) ==1043887== by 0x61CE672: void (anonymous namespace)::R__ListSlowClose<TDirectory>(TList*) (TROOT.cxx:1123) ==1043887== by 0x61C7CE9: TROOT::CloseFiles() (TROOT.cxx:1173) ==1043887== by 0x61C836B: TROOT::EndOfProcessCleanups() (TROOT.cxx:1252) ==1043887== by 0x615DAB5: CallEndOfProcessCleanups() (TApplication.cxx:90) ==1043887== by 0x6906E2C: __run_exit_handlers (in /usr/lib64/libc.so.6) ==1043887== by 0x6906F6F: exit (in /usr/lib64/libc.so.6) ==1043887== by 0x68EF5D6: (below main) (in /usr/lib64/libc.so.6) ==1043887== Address 0x8d5dab0 is 0 bytes inside a block of size 64 free'd ==1043887== at 0x484A547: operator delete[](void*) (vg_replace_malloc.c:1410) ==1043887== by 0x5908D80: TString::UnLink() const (TString.h:263) ==1043887== by 0x61D566B: TString::~TString() (TString.cxx:253) ==1043887== by 0x690755E: __call_tls_dtors (in /usr/lib64/libc.so.6) ==1043887== by 0x6906F25: __run_exit_handlers (in /usr/lib64/libc.so.6) ==1043887== by 0x6906F6F: exit (in /usr/lib64/libc.so.6) ==1043887== by 0x68EF5D6: (below main) (in /usr/lib64/libc.so.6) ==1043887== Block was alloc'd at ==1043887== at 0x4846627: operator new[](unsigned long) (vg_replace_malloc.c:729) ==1043887== by 0x61D7462: TString::Replace(int, int, char const*, int) (TString.cxx:1078) ==1043887== by 0x61D5997: TString::operator=(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const&) (TString.cxx:334) ==1043887== by 0x9CF27C1: TCling::MethodInfo_GetMangledName(MethodInfo_t*) const (TCling.cxx:9143) ==1043887== by 0x62AEF87: TFunction::TFunction(MethodInfo_t*) (TFunction.cxx:45) ==1043887== by 0x62BE03F: TMethod::TMethod(MethodInfo_t*, TClass*) (TMethod.cxx:41) ==1043887== by 0x62BBA20: TListOfFunctions::Get(void const*)(TListOfFunctions.cxx:297) ```
This avoids the need to fill out a TClass at tear down. This addresses part of https://its.cern.ch/jira/browse/ROOT-10621. ``` ==1038957== Invalid write of size 1 ==1038957== at 0xC01AC9E: std::char_traits<char>::assign(char&, char const&) (char_traits.h:357) ==1038957== by 0xC01D470: std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >::_M_set_length(unsigned long) (basic_string.h:225) ==1038957== by 0xC041DD6: std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >::clear() (basic_string.h:1016) ==1038957== by 0xC3BCDC1: TClingClassInfo::FullName(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >&, ROOT::TMetaUtils::TNormalizedCtxt const&) const (TCling ClassInfo.cxx:1379) ==1038957== by 0xC3969CB: TClingBaseClassInfo::FullName(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >&, ROOT::TMetaUtils::TNormalizedCtxt const&) const (TClingBaseClassInfo.cxx:567) ==1038957== by 0xC20D46F: TCling::BaseClassInfo_FullName(BaseClassInfo_t*) const (TCling.cxx:8577) ==1038957== by 0x4D05086: TBaseClass::TBaseClass(BaseClassInfo_t*, TClass*) (TBaseClass.cxx:40) ==1038957== by 0xC1FD03C: TCling::CreateListOfBaseClasses(TClass*) const (TCling.cxx:4406) ==1038957== by 0x4D14308: TClass::GetListOfBases() (TClass.cxx:3760) ==1038957== by 0x4D10FE1: TClass::GetBaseClass(TClass const*) (TClass.cxx:2782) ==1038957== by 0x4D1853F: TClass::InheritsFrom(TClass const*) const (TClass.cxx:5002) ==1038957== by 0x4C34137: TObject::InheritsFrom(TClass const*) const (TObject.cxx:552) ==1038957== by 0x5391BA4: TDirectoryFile::Save() (TDirectoryFile.cxx:1564) ==1038957== by 0x538DB5A: TDirectoryFile::Close(char const*) (TDirectoryFile.cxx:568) ==1038957== by 0x53A9A17: TFile::Close(char const*) (TFile.cxx:994) ==1038957== by 0x4C58672: void (anonymous namespace)::R__ListSlowClose<TDirectory>(TList*) (TROOT.cxx:1123) ==1038957== by 0x4C51CE9: TROOT::CloseFiles() (TROOT.cxx:1173) ==1038957== by 0x4C5236B: TROOT::EndOfProcessCleanups() (TROOT.cxx:1252) ==1038957== by 0x4BE7AB5: CallEndOfProcessCleanups() (TApplication.cxx:90) ==1038957== by 0x7B14E2C: __run_exit_handlers (in /usr/lib64/libc.so.6) ==1038957== by 0x7B14F6F: exit (in /usr/lib64/libc.so.6) ==1038957== by 0x7AFD5D6: (below main) (in /usr/lib64/libc.so.6) ==1038957== Address 0xb1ee930 is 0 bytes inside a block of size 121 free'd ==1038957== at 0x4848A4D: operator delete(void*, unsigned long) (vg_replace_malloc.c:1181) ==1038957== by 0xC01EB76: __gnu_cxx::new_allocator<char>::deallocate(char*, unsigned long) (new_allocator.h:145) ==1038957== by 0xC01E273: std::allocator_traits<std::allocator<char> >::deallocate(std::allocator<char>&, char*, unsigned long) (alloc_traits.h:496) ==1038957== by 0xC01D91B: std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >::_M_destroy(unsigned long) (basic_string.h:245) ==1038957== by 0xC01D341: std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >::_M_dispose() (basic_string.h:240) ==1038957== by 0xC01C803: std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >::~basic_string() (basic_string.h:672) ==1038957== by 0x7B1555E: __call_tls_dtors (in /usr/lib64/libc.so.6) ==1038957== by 0x7B14F25: __run_exit_handlers (in /usr/lib64/libc.so.6) ==1038957== by 0x7B14F6F: exit (in /usr/lib64/libc.so.6) ==1038957== by 0x7AFD5D6: (below main) (in /usr/lib64/libc.so.6) ==1038957== Block was alloc'd at ==1038957== at 0x4844EE1: operator new(unsigned long) (vg_replace_malloc.c:487) ==1038957== by 0x791124D: std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >::_M_mutate(unsigned long, unsigned long, char const*, unsigned long) (basic_string. tcc:307) ==1038957== by 0x7912B82: std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >::_M_append(char const*, unsigned long) (basic_string.tcc:395) ==1038957== by 0x4CEEF7F: TClassEdit::TSplitType::ShortType(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >&, int) (TClassEdit.cxx:500) ==1038957== by 0xC03076F: ROOT::TMetaUtils::GetNormalizedName(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >&, clang::QualType const&, cling::Interpreter co nst&, ROOT::TMetaUtils::TNormalizedCtxt const&) (TClingUtils.cxx:4180) ==1038957== by 0xC3BCE2F: TClingClassInfo::FullName(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >&, ROOT::TMetaUtils::TNormalizedCtxt const&) const (TCling ClassInfo.cxx:1385) ==1038957== by 0xC3969CB: TClingBaseClassInfo::FullName(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >&, ROOT::TMetaUtils::TNormalizedCtxt const&) const (TC lingBaseClassInfo.cxx:567) ==1038957== by 0xC20D46F: TCling::BaseClassInfo_FullName(BaseClassInfo_t*) const (TCling.cxx:8577) ==1038957== by 0x4D05086: TBaseClass::TBaseClass(BaseClassInfo_t*, TClass*) (TBaseClass.cxx:40) ```
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Since code assume that the creation will succeed rather than returning
nullptr
, we create a trivial/emptyTClass
instead.