Skip to content

[root6] Eliminate crash when creating the MuDst#442

Merged
plexoos merged 3 commits intostar-bnl:mainfrom
klendathu2k:star-fix-strange-mudst-assoc-array
Nov 19, 2022
Merged

[root6] Eliminate crash when creating the MuDst#442
plexoos merged 3 commits intostar-bnl:mainfrom
klendathu2k:star-fix-strange-mudst-assoc-array

Conversation

@klendathu2k
Copy link
Copy Markdown
Contributor

When creating the MuDst, ROOT6 has a problem with creating the TClonesArray
of StStrangeAssoc objects. Running under GDB shows that TClass::GetClass enters
an infinite recursion... almost as if the system is confused, and believes the class is it's
own base class.

Disabling the call to initializeForWriting() on loading the share library resolves the issue.
Though I don't know what side effects this may cause.

…Array

of StStrangeAssoc objects.   Looking up the TClass information to instantiate
the object results in an infinite recursion for an unknown reason.

Disabling the call to initializeForWriting() on loading the share library
resolves the issue.  Thouigh I don't know what side effects this may cause.
@veprbl
Copy link
Copy Markdown
Member

veprbl commented Nov 17, 2022

The original code was introduced over two decades ago: a20c9a8#diff-9b5c84904f9c5ac927afddab6e4379e15fe6fa757afa4130bde3883f5ec15a3a

It is a bit suspicious that the modification to the global StObject streamer configuration is made conditional on loading of StStrangeMuDstMaker (which, IIRC, is itself loaded unconditionally in most of our BFC configurations).

I think, it would be nice to aim at removing this option for ROOT 5 as well. There may be some file size implications for MuDsts, but those can be addressed on a class-by-class basis.

@veprbl veprbl added the ROOT6 Issues and changes related to transition from ROOT5 to ROOT6 label Nov 17, 2022
Copy link
Copy Markdown
Member

@veprbl veprbl left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This advances the ROOT6 tests in CI to the fCurrentRow woes. Very exciting.

@plexoos
Copy link
Copy Markdown
Member

plexoos commented Nov 17, 2022

This is a great finding indeed. The function calls which seem to disturb ROOT6 can be moved to StStrangeMuDstMaker. That is how it is done in MuDst and PicoDst for the persistent objects:

void StMuDstMaker::streamerOff() {
StMuEvent::Class()->IgnoreTObjectStreamer();
StMuL3EventSummary::Class()->IgnoreTObjectStreamer();
#ifndef __NO_STRANGE_MUDST__
StStrangeMuDst::Class()->IgnoreTObjectStreamer();
StV0MuDst::Class()->IgnoreTObjectStreamer();
StXiMuDst::Class()->IgnoreTObjectStreamer();
StKinkMuDst::Class()->IgnoreTObjectStreamer();
StV0Mc::Class()->IgnoreTObjectStreamer();
StXiMc::Class()->IgnoreTObjectStreamer();
StKinkMc::Class()->IgnoreTObjectStreamer();
#endif
StMuMcVertex::Class()->IgnoreTObjectStreamer();
StMuMcTrack::Class()->IgnoreTObjectStreamer();
StMuTrack::Class()->IgnoreTObjectStreamer();
StMuPrimaryVertex::Class()->IgnoreTObjectStreamer();
// StDcaGeometry::Class()->IgnoreTObjectStreamer();
StMuPrimaryTrackCovariance::Class()->IgnoreTObjectStreamer();
StMuHelix::Class()->IgnoreTObjectStreamer();
StMuEmcHit::Class()->IgnoreTObjectStreamer();
StMuEmcTowerData::Class()->IgnoreTObjectStreamer();
StMuPmdHit::Class()->IgnoreTObjectStreamer();
StMuPmdCluster::Class()->IgnoreTObjectStreamer();
EztEventHeader::Class()->IgnoreTObjectStreamer();
EztTrigBlob::Class()->IgnoreTObjectStreamer();
EztFpdBlob::Class()->IgnoreTObjectStreamer();
EztEmcRawData::Class()->IgnoreTObjectStreamer();
StMuFgtStrip::Class()->IgnoreTObjectStreamer();
StMuFgtCluster::Class()->IgnoreTObjectStreamer();
StMuFgtStripAssociation::Class()->IgnoreTObjectStreamer();
StMuFgtAdc::Class()->IgnoreTObjectStreamer();
}

void StPicoDstMaker::streamerOff() {
// This is to to save space on the file. No need for TObject bits for this structure.
// see: https://root.cern.ch/doc/master/classTClass.html#a606b0442d6fec4b1cd52f43bca73aa51
StPicoEvent::Class()->IgnoreTObjectStreamer();
StPicoTrack::Class()->IgnoreTObjectStreamer();
StPicoBTofHit::Class()->IgnoreTObjectStreamer();
StPicoBTowHit::Class()->IgnoreTObjectStreamer();
StPicoMtdHit::Class()->IgnoreTObjectStreamer();
StPicoBbcHit::Class()->IgnoreTObjectStreamer();
StPicoEpdHit::Class()->IgnoreTObjectStreamer();
StPicoFmsHit::Class()->IgnoreTObjectStreamer();
StPicoBEmcSmdEHit::Class()->IgnoreTObjectStreamer();
StPicoBEmcSmdPHit::Class()->IgnoreTObjectStreamer();
StPicoEmcTrigger::Class()->IgnoreTObjectStreamer();
StPicoMtdTrigger::Class()->IgnoreTObjectStreamer();
StPicoBTofPidTraits::Class()->IgnoreTObjectStreamer();
StPicoBEmcPidTraits::Class()->IgnoreTObjectStreamer();
StPicoMtdPidTraits::Class()->IgnoreTObjectStreamer();
StPicoTrackCovMatrix::Class()->IgnoreTObjectStreamer();
StPicoETofHit::Class()->IgnoreTObjectStreamer();
StPicoETofPidTraits::Class()->IgnoreTObjectStreamer();
StPicoMcVertex::Class()->IgnoreTObjectStreamer();
StPicoMcTrack::Class()->IgnoreTObjectStreamer();
}

@genevb
Copy link
Copy Markdown
Contributor

genevb commented Nov 18, 2022

I consider the 2001 commit a hack on my part, so if it can be removed, that's a step in the right direction. And since I stopped maintaining this code something like 15 years ago, I don't feel protective of this code: please do whatever you need to. Thanks.

@klendathu2k
Copy link
Copy Markdown
Contributor Author

It certainly looked like a duck and walked like a duck... and hack rhymes with quack, so good to have confirmation.

It may be an issue of timing, that ROOT6 needs to defer the call to suppress the TObject streamer until later (eg initialization time) rather than load time. I'll push that change shortly.

@klendathu2k klendathu2k requested a review from jdbrice as a code owner November 18, 2022 14:58
@plexoos
Copy link
Copy Markdown
Member

plexoos commented Nov 18, 2022

In the context of this change I tried to understand the relation between MuDst and StrangeMuDst. It appears to me that the latter has become a part of MuDst long time ago. If this is the case, can we get rid of the __NO_STRANGE_MUDST__ branching in the code?

Comment thread StRoot/StMuDSTMaker/COMMON/StMuDstMaker.cxx Outdated
@klendathu2k
Copy link
Copy Markdown
Contributor Author

@jdbrice @nigmatkulov Would appreciate reviews as code-owners.

@plexoos plexoos requested a review from veprbl November 19, 2022 00:06
@plexoos plexoos merged commit a062a16 into star-bnl:main Nov 19, 2022
plexoos added a commit to plexoos/star-sw that referenced this pull request Dec 18, 2022
plexoos added a commit to plexoos/star-sw that referenced this pull request Dec 18, 2022
When creating the MuDst, ROOT6 has a problem with creating the
TClonesArray
of StStrangeAssoc objects. Running under GDB shows that TClass::GetClass
enters
an infinite recursion... almost as if the system is confused, and
believes the class is it's
own base class.  

Disabling the call to initializeForWriting() on loading the share
library resolves the issue.
Though I don't know what side effects this may cause.

Co-authored-by: Dmitri Smirnov <dmixsmi@gmail.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

ROOT6 Issues and changes related to transition from ROOT5 to ROOT6

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants