Skip to content
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

Move two StopReasonName arrays into source files #42628

Merged
merged 1 commit into from
Aug 29, 2023

Conversation

hahnjo
Copy link
Contributor

@hahnjo hahnjo commented Aug 22, 2023

PR description:

This works around root-project/root#13429 by not having std::string arrays in headers that are double-freed.

PR validation:

Not needed

PR backport:

Probably not needed.

@cmsbuild
Copy link
Contributor

+code-checks

Logs: https://cmssdt.cern.ch/SDT/code-checks/cms-sw-PR-42628/36682

  • This PR adds an extra 16KB to repository

@cmsbuild
Copy link
Contributor

A new Pull Request was created by @hahnjo (Jonas Hahnfeld) for master.

It involves the following packages:

  • DataFormats/TrackCandidate (reconstruction)
  • DataFormats/TrackReco (reconstruction)

@cmsbuild, @mandrenguyen, @clacaputo can you please review it and eventually sign? Thanks.
@VourMa, @JanFSchulte, @rovere, @VinInn, @missirol, @gpetruc, @mmusich, @mtosi this is something you requested to watch as well.
@perrotta, @dpiparo, @antoniovilela, @rappoccio you are the release manager for this.

cms-bot commands are listed here

@hahnjo
Copy link
Contributor Author

hahnjo commented Aug 22, 2023

@smuzaffar could you please test this PR with ROOT6 IBs? I hope this works around the problem while we work on a proper solution.

@iarspider
Copy link
Contributor

please test with CMSSW_13_3_ROOT6_X

@smuzaffar
Copy link
Contributor

test parameters:

  • addpkg = Alignment/OfflineValidation

@smuzaffar
Copy link
Contributor

please test for CMSSW_13_3_ROOT6_X

@smuzaffar
Copy link
Contributor

please test

lets test production arch/IB

@cmsbuild
Copy link
Contributor

-1

Failed Tests: Build
Summary: https://cmssdt.cern.ch/SDT/jenkins-artifacts/pull-request-integration/PR-b50767/34415/summary.html
COMMIT: 2c532f0
CMSSW: CMSSW_13_3_X_2023-08-21-2300/el8_amd64_gcc11
User test area: For local testing, you can use /cvmfs/cms-ci.cern.ch/week1/cms-sw/cmssw/42628/34415/install.sh to create a dev area with all the needed externals and cmssw changes.

Build

I found compilation error when building:

>> Compiling edm plugin /data/cmsbld/jenkins/workspace/ib-run-pr-tests/CMSSW_13_3_X_2023-08-21-2300/src/DQM/TrackingMonitor/src/V0Monitor.cc
>> Compiling edm plugin /data/cmsbld/jenkins/workspace/ib-run-pr-tests/CMSSW_13_3_X_2023-08-21-2300/src/DQM/TrackingMonitor/src/VertexMonitor.cc
>> Compiling edm plugin /data/cmsbld/jenkins/workspace/ib-run-pr-tests/CMSSW_13_3_X_2023-08-21-2300/src/DQM/TrackingMonitor/src/dEdxAnalyzer.cc
>> Compiling edm plugin /data/cmsbld/jenkins/workspace/ib-run-pr-tests/CMSSW_13_3_X_2023-08-21-2300/src/DQM/TrackingMonitor/src/dEdxHitAnalyzer.cc
/data/cmsbld/jenkins/workspace/ib-run-pr-tests/CMSSW_13_3_X_2023-08-21-2300/src/DQM/TrackingMonitor/src/TrackAnalyzer.cc: In member function 'void tadqm::TrackAnalyzer::bookHistosForHitProperties(dqm::legacy::DQMStore::IBooker&)':
/data/cmsbld/jenkins/workspace/ib-run-pr-tests/CMSSW_13_3_X_2023-08-21-2300/src/DQM/TrackingMonitor/src/TrackAnalyzer.cc:718:33: error: invalid application of 'sizeof' to incomplete type 'const string []' {aka 'const std::__cxx11::basic_string []'}
  718 |     size_t StopReasonNameSize = sizeof(StopReasonName::StopReasonName) / sizeof(std::string);
      |                                 ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
/data/cmsbld/jenkins/workspace/ib-run-pr-tests/CMSSW_13_3_X_2023-08-21-2300/src/DQM/TrackingMonitor/src/TrackBuildingAnalyzer.cc: In member function 'void TrackBuildingAnalyzer::initHisto(dqm::legacy::DQMStore::IBooker&, const edm::ParameterSet&)':
/data/cmsbld/jenkins/workspace/ib-run-pr-tests/CMSSW_13_3_X_2023-08-21-2300/src/DQM/TrackingMonitor/src/TrackBuildingAnalyzer.cc:332:33: error: invalid application of 'sizeof' to incomplete type 'const string []' {aka 'const std::__cxx11::basic_string []'}
  332 |     size_t StopReasonNameSize = sizeof(StopReasonName::StopReasonName) / sizeof(std::string);


@cmsbuild
Copy link
Contributor

-1

Failed Tests: Build
Summary: https://cmssdt.cern.ch/SDT/jenkins-artifacts/pull-request-integration/PR-b50767/34416/summary.html
COMMIT: 2c532f0
CMSSW: CMSSW_13_3_ROOT6_X_2023-08-21-2300/el8_amd64_gcc11
User test area: For local testing, you can use /cvmfs/cms-ci.cern.ch/week1/cms-sw/cmssw/42628/34416/install.sh to create a dev area with all the needed externals and cmssw changes.

Build

I found compilation error when building:

>> Compiling edm plugin /data/cmsbld/jenkins/workspace/ib-run-pr-tests/CMSSW_13_3_ROOT6_X_2023-08-21-2300/src/DQM/TrackingMonitor/src/V0Monitor.cc
>> Compiling edm plugin /data/cmsbld/jenkins/workspace/ib-run-pr-tests/CMSSW_13_3_ROOT6_X_2023-08-21-2300/src/DQM/TrackingMonitor/src/VertexMonitor.cc
>> Compiling edm plugin /data/cmsbld/jenkins/workspace/ib-run-pr-tests/CMSSW_13_3_ROOT6_X_2023-08-21-2300/src/DQM/TrackingMonitor/src/dEdxAnalyzer.cc
>> Compiling edm plugin /data/cmsbld/jenkins/workspace/ib-run-pr-tests/CMSSW_13_3_ROOT6_X_2023-08-21-2300/src/DQM/TrackingMonitor/src/dEdxHitAnalyzer.cc
/data/cmsbld/jenkins/workspace/ib-run-pr-tests/CMSSW_13_3_ROOT6_X_2023-08-21-2300/src/DQM/TrackingMonitor/src/TrackAnalyzer.cc: In member function 'void tadqm::TrackAnalyzer::bookHistosForHitProperties(dqm::legacy::DQMStore::IBooker&)':
/data/cmsbld/jenkins/workspace/ib-run-pr-tests/CMSSW_13_3_ROOT6_X_2023-08-21-2300/src/DQM/TrackingMonitor/src/TrackAnalyzer.cc:718:33: error: invalid application of 'sizeof' to incomplete type 'const string []' {aka 'const std::__cxx11::basic_string []'}
  718 |     size_t StopReasonNameSize = sizeof(StopReasonName::StopReasonName) / sizeof(std::string);
      |                                 ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
/data/cmsbld/jenkins/workspace/ib-run-pr-tests/CMSSW_13_3_ROOT6_X_2023-08-21-2300/src/DQM/TrackingMonitor/src/TrackBuildingAnalyzer.cc: In member function 'void TrackBuildingAnalyzer::initHisto(dqm::legacy::DQMStore::IBooker&, const edm::ParameterSet&)':
/data/cmsbld/jenkins/workspace/ib-run-pr-tests/CMSSW_13_3_ROOT6_X_2023-08-21-2300/src/DQM/TrackingMonitor/src/TrackBuildingAnalyzer.cc:332:33: error: invalid application of 'sizeof' to incomplete type 'const string []' {aka 'const std::__cxx11::basic_string []'}
  332 |     size_t StopReasonNameSize = sizeof(StopReasonName::StopReasonName) / sizeof(std::string);


This works around root-project/root#13429
by not having std::string arrays in headers that are double-freed.
@cmsbuild
Copy link
Contributor

+code-checks

Logs: https://cmssdt.cern.ch/SDT/code-checks/cms-sw-PR-42628/36684

  • This PR adds an extra 36KB to repository

"NOT_STOPPED" // 11 (be careful, NOT_STOPPED needs to be the last,
// its index differs from the enumeration value)
};
extern const std::string StopReasonName[];
Copy link
Contributor

Choose a reason for hiding this comment

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

How about making this

Suggested change
extern const std::string StopReasonName[];
extern const std::array<std::string_view, static_cast<size_t>(StopReason::SIZE)>;

?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Please feel free to make further changes as necessary / wanted. This PR is meant to provide a minimal workaround for root-project/root#13429 which appears to work, up to your decision to merge or wait for a proper fix for the underlying problem in Cling (working on it).

Incidentally, I would argue that this array of names doesn't need any C++ data type, plain const char * should be fine. I would still argue that it's better to move the strings into the source files because it means the compiler doesn't have to materialize them in all TUs that include this header, and I think it's not critical for performance.

@cmsbuild
Copy link
Contributor

+1

Summary: https://cmssdt.cern.ch/SDT/jenkins-artifacts/pull-request-integration/PR-b50767/34424/summary.html
COMMIT: deae987
CMSSW: CMSSW_13_3_ROOT6_X_2023-08-21-2300/el8_amd64_gcc11
User test area: For local testing, you can use /cvmfs/cms-ci.cern.ch/week1/cms-sw/cmssw/42628/34424/install.sh to create a dev area with all the needed externals and cmssw changes.

Comparison Summary

Summary:

  • You potentially removed 11 lines from the logs
  • Reco comparison results: 15 differences found in the comparisons
  • DQMHistoTests: Total files compared: 48
  • DQMHistoTests: Total histograms compared: 3153095
  • DQMHistoTests: Total failures: 3
  • DQMHistoTests: Total nulls: 0
  • DQMHistoTests: Total successes: 3153070
  • DQMHistoTests: Total skipped: 22
  • DQMHistoTests: Total Missing objects: 0
  • DQMHistoSizes: Histogram memory added: 0.0 KiB( 47 files compared)
  • Checked 207 log files, 159 edm output root files, 48 DQM output files
  • TriggerResults: no differences found

@hahnjo
Copy link
Contributor Author

hahnjo commented Aug 23, 2023

please test

Testing against production IB doesn't seem to have worked, not sure if you want to restart that before considering a merge...

@iarspider
Copy link
Contributor

please test

@cmsbuild
Copy link
Contributor

+1

Summary: https://cmssdt.cern.ch/SDT/jenkins-artifacts/pull-request-integration/PR-b50767/34440/summary.html
COMMIT: deae987
CMSSW: CMSSW_13_3_X_2023-08-22-2300/el8_amd64_gcc11
User test area: For local testing, you can use /cvmfs/cms-ci.cern.ch/week1/cms-sw/cmssw/42628/34440/install.sh to create a dev area with all the needed externals and cmssw changes.

Comparison Summary

Summary:

  • You potentially removed 14 lines from the logs
  • Reco comparison results: 0 differences found in the comparisons
  • DQMHistoTests: Total files compared: 48
  • DQMHistoTests: Total histograms compared: 3153095
  • DQMHistoTests: Total failures: 0
  • DQMHistoTests: Total nulls: 0
  • DQMHistoTests: Total successes: 3153073
  • DQMHistoTests: Total skipped: 22
  • DQMHistoTests: Total Missing objects: 0
  • DQMHistoSizes: Histogram memory added: 0.0 KiB( 47 files compared)
  • Checked 207 log files, 159 edm output root files, 48 DQM output files
  • TriggerResults: no differences found

@emanueleusai
Copy link
Member

+1

@mandrenguyen
Copy link
Contributor

+1
No reco changes

@cmsbuild
Copy link
Contributor

This pull request is fully signed and it will be integrated in one of the next master IBs (tests are also fine). This pull request will now be reviewed by the release team before it's merged. @perrotta, @dpiparo, @antoniovilela, @rappoccio (and backports should be raised in the release meeting by the corresponding L2)

@perrotta
Copy link
Contributor

+1

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.

8 participants