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

[LTO_X - Alignment & Calibration] Solve -Wstrict-overflow compiler warnings #38649

Conversation

aandvalenzuela
Copy link
Contributor

Hello,

We have seen some compiler warnings of the type -Wstrict-overflow in LTO_X IBs (CMSSW_12_5_LTO_X_2022-07-07-1100 and CMSSW_12_5_LTO_X_2022-07-06-1100, for example) in both Alignment/OfflineValidation and Alignment/TrackerAlignment packages. See sample stack traces, respectively:

>> Building edm plugin tmp/el8_amd64_gcc10/src/Alignment/OfflineValidation/plugins/AlignmentOfflinevalidationPlugins/libAlignmentOfflinevalidationPlugins.so
/data/cmsbld/jenkins/workspace/build-any-ib/w/el8_amd64_gcc10/external/gcc/10.3.0-84898dea653199466402e67d73657f10/bin/c++ -O2 -pthread -pipe -Werror=main -Werror=pointer-arith -Werror=overlength-strings -Wno-vla -Werror=overflow -std=c++1z -ftree-vectorize -Wstrict-overflow -Werror=array-bounds -Werror=format-contains-nul -Werror=type-limits -fvisibility-inlines-hidden -fno-math-errno --param vect-max-version-for-alias-checks=50 -Xassembler --compress-debug-sections -msse3 -felide-constructors -fmessage-length=0 -Wall -Wno-non-template-friend -Wno-long-long -Wreturn-type -Wextra -Wpessimizing-move -Wclass-memaccess -Wno-cast-function-type -Wno-unused-but-set-parameter -Wno-ignored-qualifiers -Wno-deprecated-copy -Wno-unused-parameter -Wunused -Wparentheses -Wno-deprecated -Werror=return-type -Werror=missing-braces -Werror=unused-value -Werror=unused-label -Werror=address -Werror=format -Werror=sign-compare -Werror=write-strings -Werror=delete-non-virtual-dtor -Werror=strict-aliasing -Werror=narrowing -Werror=unused-but-set-variable -Werror=reorder -Werror=unused-variable -Werror=conversion-null -Werror=return-local-addr -Wnon-virtual-dtor -Werror=switch -fdiagnostics-show-option -Wno-unused-local-typedefs -Wno-attributes -Wno-psabi -Wno-error=unused-variable -DBOOST_DISABLE_ASSERTS -flto -fipa-icf -flto-odr-type-merging -fno-fat-lto-objects -Wodr -shared -Wl,-E -Wl,-z,defs tmp/el8_amd64_gcc10/src/Alignment/OfflineValidation/plugins/AlignmentOfflinevalidationPlugins/CosmicSplitterValidation.cc.o tmp/el8_amd64_gcc10/src/Alignment/OfflineValidation/plugins/AlignmentOfflinevalidationPlugins/DMRChecker.cc.o tmp/el8_amd64_gcc10/src/Alignment/OfflineValidation/plugins/AlignmentOfflinevalidationPlugins/DiElectronVertexValidation.cc.o tmp/el8_amd64_gcc10/src/Alignment/OfflineValidation/plugins/AlignmentOfflinevalidationPlugins/DiMuonVertexValidation.cc.o tmp/el8_amd64_gcc10/src/Alignment/OfflineValidation/plugins/AlignmentOfflinevalidationPlugins/EopTreeWriter.cc.o tmp/el8_amd64_gcc10/src/Alignment/OfflineValidation/plugins/AlignmentOfflinevalidationPlugins/GeneralPurposeTrackAnalyzer.cc.o tmp/el8_amd64_gcc10/src/Alignment/OfflineValidation/plugins/AlignmentOfflinevalidationPlugins/MuonAlignmentAnalyzer.cc.o tmp/el8_amd64_gcc10/src/Alignment/OfflineValidation/plugins/AlignmentOfflinevalidationPlugins/OverlapValidation.cc.o tmp/el8_amd64_gcc10/src/Alignment/OfflineValidation/plugins/AlignmentOfflinevalidationPlugins/PixelBaryCentreAnalyzer.cc.o tmp/el8_amd64_gcc10/src/Alignment/OfflineValidation/plugins/AlignmentOfflinevalidationPlugins/PrimaryVertexValidation.cc.o tmp/el8_amd64_gcc10/src/Alignment/OfflineValidation/plugins/AlignmentOfflinevalidationPlugins/ResidualRefitting.cc.o tmp/el8_amd64_gcc10/src/Alignment/OfflineValidation/plugins/AlignmentOfflinevalidationPlugins/SplitVertexResolution.cc.o tmp/el8_amd64_gcc10/src/Alignment/OfflineValidation/plugins/AlignmentOfflinevalidationPlugins/TrackerGeometryCompare.cc.o tmp/el8_amd64_gcc10/src/Alignment/OfflineValidation/plugins/AlignmentOfflinevalidationPlugins/TrackerGeometryIntoNtuples.cc.o tmp/el8_amd64_gcc10/src/Alignment/OfflineValidation/plugins/AlignmentOfflinevalidationPlugins/TrackerOfflineValidation.cc.o tmp/el8_amd64_gcc10/src/Alignment/OfflineValidation/plugins/AlignmentOfflinevalidationPlugins/TrackerOfflineValidationSummary.cc.o tmp/el8_amd64_gcc10/src/Alignment/OfflineValidation/plugins/AlignmentOfflinevalidationPlugins/Tracker_OldtoNewConverter.cc.o tmp/el8_amd64_gcc10/src/Alignment/OfflineValidation/plugins/AlignmentOfflinevalidationPlugins/ValidationMisalignedTracker.cc.o -o tmp/el8_amd64_gcc10/src/Alignment/OfflineValidation/plugins/AlignmentOfflinevalidationPlugins/libAlignmentOfflinevalidationPlugins.so -Wl,-E -Wl,--hash-style=gnu -L/data/cmsbld/jenkins/workspace/build-any-ib/w/tmp/BUILDROOT/ed6117194997de64d40aad03ededc67f/opt/cmssw/el8_amd64_gcc10/cms/cmssw/CMSSW_12_5_LTO_X_2022-07-06-1100/biglib/el8_amd64_gcc10 -L/data/cmsbld/jenkins/workspace/build-any-ib/w/tmp/BUILDROOT/ed6117194997de64d40aad03ededc67f/opt/cmssw/el8_amd64_gcc10/cms/cmssw/CMSSW_12_5_LTO_X_2022-07-06-1100/lib/el8_amd64_gcc10 -L/data/cmsbld/jenkins/workspace/build-any-ib/w/tmp/BUILDROOT/ed6117194997de64d40aad03ededc67f/opt/cmssw/el8_amd64_gcc10/cms/cmssw/CMSSW_12_5_LTO_X_2022-07-06-1100/external/el8_amd64_gcc10/lib -lRecoVertexPrimaryVertexProducer -lRecoMuonTrackingTools -lRecoVertexAdaptiveVertexFit -lRecoVertexKalmanVertexFit -lRecoVertexLinearizationPointFinders -lTrackingToolsIPTools -lDQMSiPixelPhase1Common -lRecoVertexVertexTools -lCommonToolsTriggerUtils -lRecoVertexVertexPrimitives -lTrackingToolsTrackRefitter -lHLTriggerHLTcore -lTrackingToolsTransientTrack -lCondFormatsHLTObjects -lDataFormatsPatCandidates -lAlignmentOfflineValidation -lDataFormatsHLTReco -lDataFormatsBTauReco -lDataFormatsJetMatching -lDataFormatsL1TParticleFlow -lDataFormatsMETReco -lDataFormatsTauReco -lTrackingToolsKalmanUpdators -lTrackingToolsTrackFitters -lAlignmentTrackerAlignment -lCalibTrackerSiStripCommon -lDataFormatsJetReco -lRecoMuonNavigation -lRecoTrackerTransientTrackingRecHit -lTrackingToolsGsfTools -lTrackingToolsRecoGeometry -lAlignmentCommonAlignment -lDataFormatsParticleFlowCandidate -lRecoLocalTrackerSiStripRecHitConverter -lRecoMuonTransientTrackingRecHit -lRecoTrackerTkDetLayers -lSimTrackerTrackerHitAssociation -lTrackingToolsPatternTools -lDataFormatsParticleFlowReco -lRecoMTDDetLayers -lRecoMuonDetLayers -lTrackingToolsTrackAssociator -lTrackingToolsTransientTrackingRecHit -lDataFormatsEgammaCandidates -lDataFormatsHcalIsolatedTrack -lDataFormatsL1TCorrelator -lDataFormatsMuonReco -lRecoLocalTrackerPhase2TrackerRecHits -lTrackPropagationSteppingHelixPropagator -lTrackingToolsDetLayers -lDataFormatsL1TMuon -lDataFormatsRecoCandidate -lRecoLocalTrackerClusterParameterEstimator -lTrackingToolsGeomPropagators -lDQMTrackerRemapper -lDataFormatsCSCDigi -lDataFormatsEgammaReco -lDataFormatsGsfTrackReco -lDataFormatsVertexReco -lSimDataFormatsTrackingAnalysis -lTrackingToolsTrajectoryState -lDataFormatsGEMDigi -lDataFormatsTrackReco -lRecoTrackerRecord -lDataFormatsGEMRecHit -lDataFormatsTrackCandidate -lDataFormatsTrackerRecHit2D -lL1TriggerL1TGlobal -lTrackingToolsRecords -lCommonToolsTrackerMap -lCondFormatsSiPhase2TrackerObjects -lCondFormatsSiPixelObjects -lDataFormatsCSCRecHit -lDataFormatsDTRecHit -lDataFormatsFTLRecHit -lDataFormatsL1TGlobal -lDataFormatsL1TMuonPhase2 -lDataFormatsTrajectorySeed -lGeometryMTDGeometryBuilder -lL1TriggerGlobalTriggerAnalyzer -lRecoLocalTrackerRecords -lCalibFormatsSiStripObjects -lCalibTrackerRecords -lDataFormatsL1Trigger -lDataFormatsTrackingRecHit -lGeometryCSCGeometry -lGeometryDTGeometry -lGeometryGEMGeometry -lGeometryMTDNumberingBuilder -lGeometryRPCGeometry -lGeometryTrackerGeometryBuilder -lCalibTrackerStandaloneTrackerTopology -lCondFormatsSiStripObjects -lDataFormatsL1TrackTrigger -lMagneticFieldRecords -lMagneticFieldVolumeBasedEngine -lRecoMuonRecords -lCondFormatsDataRecord -lDataFormatsTrackerCommon -lGeometryCaloGeometry -lGeometryCommonTopologies -lMagneticFieldLayers -lRecoMTDRecords -lCondCoreDBOutputService -lCondFormatsAlignment -lCondFormatsL1TObjects -lDataFormatsBeamSpot -lDataFormatsCaloTowers -lDataFormatsEcalRecHit -lDataFormatsGeometryCommonDetAlgo -lDataFormatsHcalRecHit -lDataFormatsHepMCCandidate -lDataFormatsSiStripCluster -lGeometryRecords -lGeometryTrackerNumberingBuilder -lMagneticFieldVolumeGeometry -lSimDataFormatsCrossingFrame -lTrackingToolsAnalyticalJacobians -lCommonToolsStatistics -lCommonToolsUtilAlgos -lCondCoreCondDB -lCondFormatsAlignmentRecord -lDQMServicesCore -lDataFormatsCandidate -lDataFormatsDTDigi -lDataFormatsEcalDigi -lDataFormatsGeometrySurface -lDataFormatsHcalDigi -lDataFormatsL1GlobalCaloTrigger -lDataFormatsSiPixelDigi -lDataFormatsSiStripCommon -lDataFormatsTrajectoryState -lDetectorDescriptionCore -lDetectorDescriptionDDCMS -lGeometryMTDCommonData -lMagneticFieldEngine -lSimDataFormatsTrackerDigiSimLink -lSimDataFormatsTrackingHit -lCommonToolsUtils -lCondFormatsBeamSpotObjects -lCondFormatsGeometryObjects -lCondFormatsRunInfo -lDataFormatsCLHEP -lDataFormatsCaloRecHit -lDataFormatsEcalDetId -lDataFormatsForwardDetId -lDataFormatsGeometryVector -lDataFormatsHcalDetId -lDataFormatsL1CaloTrigger -lDataFormatsL1GlobalTrigger -lDataFormatsMuonDetId -lDataFormatsNanoAOD -lDataFormatsPhase2TrackerCluster -lDataFormatsSiPixelDetId -lDataFormatsSiStripDetId -lFWCoreFramework -lFWCorePrescaleService -lSimDataFormatsCaloHit -lSimDataFormatsTrack -lSimDataFormatsVertex -lCondFormatsCommon -lDataFormatsDetId -lDataFormatsFEDRawData -lDataFormatsL1GlobalMuonTrigger -lDataFormatsMath -lDataFormatsOnlineMetaData -lDataFormatsPhase2TrackerDigi -lDataFormatsScalers -lDataFormatsScouting -lDataFormatsSiPixelCluster -lDataFormatsSiStripDigi -lFWCoreCommon -lFWCoreServiceRegistry -lSimDataFormatsGeneratorProducts -lCondFormatsPhysicsToolsObjects -lDataFormatsCommon -lFWCoreParameterSet -lFWCoreMessageLogger -lDataFormatsProvenance -lFWCorePluginManager -lFWCoreReflection -lTrackingToolsTrajectoryParametrization -lCalibFormatsSiPixelObjects -lCondFormatsSerialization -lFWCoreConcurrency -lFWCoreUtilities -lFWCoreVersion -lSimDataFormatsEncodedEventId -lUtilitiesBinningTools -lUtilitiesOpenSSL -llcg_CoralCommon -llcg_RelationalAccess -llcg_CoralKernel -llcg_CoralBase -lDDAlign -lDDCond -lDDCore -lDDParsers -lTreePlayer -lGraf3d -lPostscript -lHistPainter -lGpad -lGraf -lPhysics -lHist -lMatrix -lGenVector -lMathMore -lTree -lNet -lImt -lGeom -lThread -lboost_filesystem -lMathCore -lRIO -lSmatrix -lboost_iostreams -lboost_regex -lboost_serialization -lboost_system -lclasslib -lCore -lboost_thread -lboost_date_time -lCLHEP -lHepMCfio -lHepMC -lpcre -lbz2 -lcurl -lgsl -luuid -lprotobuf -ltbb -lxerces-c -llzma -lz -lfmt -lHepMC3 -lHepMC3search -lcms-md5 -lopenblas -lssl -lcrypto -lcrypt -ldl -lrt -lstdc++fs -ltinyxml2
/data/cmsbld/jenkins/workspace/build-any-ib/w/tmp/BUILDROOT/ed6117194997de64d40aad03ededc67f/opt/cmssw/el8_amd64_gcc10/cms/cmssw/CMSSW_12_5_LTO_X_2022-07-06-1100/src/Alignment/OfflineValidation/plugins/OverlapValidation.cc: In member function 'analyzeTrajectory':
  /data/cmsbld/jenkins/workspace/build-any-ib/w/tmp/BUILDROOT/ed6117194997de64d40aad03ededc67f/opt/cmssw/el8_amd64_gcc10/cms/cmssw/CMSSW_12_5_LTO_X_2022-07-06-1100/src/Alignment/OfflineValidation/plugins/OverlapValidation.cc:386:47: warning: assuming pointer wraparound does not occur when comparing P +- C1 with P +- C2 [-Wstrict-overflow]
   386 |            itmCompare >= measurements.begin() && itmCompare > itm - 4;
      |                                               ^
Leaving library rule at src/Alignment/OfflineValidation/plugins

and

>> Building edm plugin tmp/el8_amd64_gcc10/src/Alignment/TrackerAlignment/plugins/AlignmentTrackerAlignmentSkimPlugin/libAlignmentTrackerAlignmentSkimPlugin.so
/data/cmsbld/jenkins/workspace/build-any-ib/w/el8_amd64_gcc10/external/gcc/10.3.0-84898dea653199466402e67d73657f10/bin/c++ -O2 -pthread -pipe -Werror=main -Werror=pointer-arith -Werror=overlength-strings -Wno-vla -Werror=overflow -std=c++1z -ftree-vectorize -Wstrict-overflow -Werror=array-bounds -Werror=format-contains-nul -Werror=type-limits -fvisibility-inlines-hidden -fno-math-errno --param vect-max-version-for-alias-checks=50 -Xassembler --compress-debug-sections -msse3 -felide-constructors -fmessage-length=0 -Wall -Wno-non-template-friend -Wno-long-long -Wreturn-type -Wextra -Wpessimizing-move -Wclass-memaccess -Wno-cast-function-type -Wno-unused-but-set-parameter -Wno-ignored-qualifiers -Wno-deprecated-copy -Wno-unused-parameter -Wunused -Wparentheses -Wno-deprecated -Werror=return-type -Werror=missing-braces -Werror=unused-value -Werror=unused-label -Werror=address -Werror=format -Werror=sign-compare -Werror=write-strings -Werror=delete-non-virtual-dtor -Werror=strict-aliasing -Werror=narrowing -Werror=unused-but-set-variable -Werror=reorder -Werror=unused-variable -Werror=conversion-null -Werror=return-local-addr -Wnon-virtual-dtor -Werror=switch -fdiagnostics-show-option -Wno-unused-local-typedefs -Wno-attributes -Wno-psabi -Wno-error=unused-variable -DBOOST_DISABLE_ASSERTS -flto -fipa-icf -flto-odr-type-merging -fno-fat-lto-objects -Wodr -shared -Wl,-E -Wl,-z,defs tmp/el8_amd64_gcc10/src/Alignment/TrackerAlignment/plugins/AlignmentTrackerAlignmentSkimPlugin/AlignmentPrescaler.cc.o tmp/el8_amd64_gcc10/src/Alignment/TrackerAlignment/plugins/AlignmentTrackerAlignmentSkimPlugin/TkAlCaSkimTreeMerger.cc.o tmp/el8_amd64_gcc10/src/Alignment/TrackerAlignment/plugins/AlignmentTrackerAlignmentSkimPlugin/TkAlCaOverlapTagger.cc.o -o tmp/el8_amd64_gcc10/src/Alignment/TrackerAlignment/plugins/AlignmentTrackerAlignmentSkimPlugin/libAlignmentTrackerAlignmentSkimPlugin.so -Wl,-E -Wl,--hash-style=gnu -L/data/cmsbld/jenkins/workspace/build-any-ib/w/tmp/BUILDROOT/ed6117194997de64d40aad03ededc67f/opt/cmssw/el8_amd64_gcc10/cms/cmssw/CMSSW_12_5_LTO_X_2022-07-06-1100/biglib/el8_amd64_gcc10 -L/data/cmsbld/jenkins/workspace/build-any-ib/w/tmp/BUILDROOT/ed6117194997de64d40aad03ededc67f/opt/cmssw/el8_amd64_gcc10/cms/cmssw/CMSSW_12_5_LTO_X_2022-07-06-1100/lib/el8_amd64_gcc10 -L/data/cmsbld/jenkins/workspace/build-any-ib/w/tmp/BUILDROOT/ed6117194997de64d40aad03ededc67f/opt/cmssw/el8_amd64_gcc10/cms/cmssw/CMSSW_12_5_LTO_X_2022-07-06-1100/external/el8_amd64_gcc10/lib -lRecoTrackerTransientTrackingRecHit -lRecoLocalTrackerSiStripRecHitConverter -lTrackingToolsTransientTrackingRecHit -lRecoLocalTrackerPhase2TrackerRecHits -lTrackingToolsDetLayers -lRecoLocalTrackerClusterParameterEstimator -lTrackingToolsGeomPropagators -lTrackingToolsTrajectoryState -lDataFormatsTrackReco -lDataFormatsTrackCandidate -lDataFormatsTrackerRecHit2D -lCondFormatsSiPhase2TrackerObjects -lDataFormatsAlignment -lDataFormatsFTLRecHit -lDataFormatsTrajectorySeed -lRecoLocalTrackerRecords -lCalibFormatsSiStripObjects -lCalibTrackerRecords -lDataFormatsTrackingRecHit -lGeometryTrackerGeometryBuilder -lCondFormatsSiStripObjects -lDataFormatsL1TrackTrigger -lMagneticFieldRecords -lCondFormatsDataRecord -lDataFormatsTrackerCommon -lGeometryCommonTopologies -lCondFormatsAlignment -lDataFormatsBeamSpot -lDataFormatsGeometryCommonDetAlgo -lDataFormatsSiStripCluster -lGeometryRecords -lGeometryTrackerNumberingBuilder -lTrackingToolsAnalyticalJacobians -lCondFormatsAlignmentRecord -lDataFormatsCandidate -lDataFormatsGeometrySurface -lDataFormatsSiStripCommon -lDataFormatsTrajectoryState -lDetectorDescriptionCore -lDetectorDescriptionDDCMS -lMagneticFieldEngine -lCondFormatsGeometryObjects -lDataFormatsCLHEP -lDataFormatsCaloRecHit -lDataFormatsEcalDetId -lDataFormatsForwardDetId -lDataFormatsGeometryVector -lDataFormatsL1GlobalTrigger -lDataFormatsMuonDetId -lDataFormatsPhase2TrackerCluster -lDataFormatsSiPixelDetId -lDataFormatsSiStripDetId -lFWCoreFramework -lDataFormatsDetId -lDataFormatsFEDRawData -lDataFormatsL1GlobalMuonTrigger -lDataFormatsMath -lDataFormatsPhase2TrackerDigi -lDataFormatsScouting -lDataFormatsSiPixelCluster -lDataFormatsSiStripDigi -lFWCoreCommon -lFWCoreServiceRegistry -lCondFormatsPhysicsToolsObjects -lDataFormatsCommon -lFWCoreParameterSet -lFWCoreMessageLogger -lDataFormatsProvenance -lFWCorePluginManager -lFWCoreReflection -lTrackingToolsTrajectoryParametrization -lCondFormatsSerialization -lFWCoreConcurrency -lFWCoreUtilities -lFWCoreVersion -lUtilitiesGeneral -lDDAlign -lDDCond -lDDCore -lDDParsers -lPhysics -lHist -lMatrix -lGenVector -lMathMore -lTree -lNet -lGeom -lThread -lMathCore -lRIO -lSmatrix -lboost_iostreams -lboost_serialization -lCore -lboost_thread -lboost_date_time -lCLHEP -lpcre -lbz2 -lgsl -luuid -ltbb -lxerces-c -llzma -lz -lfmt -lcms-md5 -lopenblas -lcrypt -ldl -lrt -lstdc++fs -ltinyxml2
/data/cmsbld/jenkins/workspace/build-any-ib/w/tmp/BUILDROOT/ed6117194997de64d40aad03ededc67f/opt/cmssw/el8_amd64_gcc10/cms/cmssw/CMSSW_12_5_LTO_X_2022-07-06-1100/src/Alignment/TrackerAlignment/plugins/TkAlCaOverlapTagger.cc: In member function 'produce':
  /data/cmsbld/jenkins/workspace/build-any-ib/w/tmp/BUILDROOT/ed6117194997de64d40aad03ededc67f/opt/cmssw/el8_amd64_gcc10/cms/cmssw/CMSSW_12_5_LTO_X_2022-07-06-1100/src/Alignment/TrackerAlignment/plugins/TkAlCaOverlapTagger.cc:129:43: warning: assuming pointer wraparound does not occur when comparing P +- C1 with P +- C2 [-Wstrict-overflow]
   129 |              itmCompare >= tmColl.begin() && itmCompare > itTrajMeas - 4;
      |                                           ^

Regarding the type of error and following some online discussions of this type of warning fmtlib/fmt/issues/2757, I have tried to workaround it as shown in this PR, but feel free to propose other solutions that could be better regarding the analysis itself.

Many thanks,
Andrea.

@cmsbuild cmsbuild added this to the CMSSW_12_5_X milestone Jul 8, 2022
@aandvalenzuela aandvalenzuela changed the title [LTO_X - Alignment] Solve -Wstrict-overflow warnings [LTO_X - Alignment] Solve -Wstrict-overflow compiler warnings Jul 8, 2022
@cmsbuild
Copy link
Contributor

cmsbuild commented Jul 8, 2022

+code-checks

Logs: https://cmssdt.cern.ch/SDT/code-checks/cms-sw-PR-38649/30934

  • This PR adds an extra 24KB to repository

@cmsbuild
Copy link
Contributor

cmsbuild commented Jul 8, 2022

A new Pull Request was created by @aandvalenzuela (Andrea Valenzuela) for master.

It involves the following packages:

  • Alignment/OfflineValidation (alca)
  • Alignment/TrackerAlignment (alca)

@malbouis, @yuanchao, @cmsbuild, @francescobrivio, @ChrisMisan, @tvami can you please review it and eventually sign? Thanks.
@mmusich, @adewit, @tocheng, @tlampen this is something you requested to watch as well.
@perrotta, @dpiparo, @qliphy, @rappoccio you are the release manager for this.

cms-bot commands are listed here

@tvami
Copy link
Contributor

tvami commented Jul 8, 2022

@cmsbuild , please test

@tvami
Copy link
Contributor

tvami commented Jul 8, 2022

@cmsbuild , please test for CMSSW_12_5_LTO_X

@tvami
Copy link
Contributor

tvami commented Jul 8, 2022

type trk,bugfix

@@ -383,7 +383,7 @@ void OverlapValidation::analyzeTrajectory(const Trajectory& trajectory,
++overlapCounts_[1];
if ((layer != -1) && (acceptLayer[subDet])) {
for (vector<TrajectoryMeasurement>::const_iterator itmCompare = itm - 1;
itmCompare >= measurements.begin() && itmCompare > itm - 4;
itmCompare >= measurements.begin() && itmCompare - (itm - 4) > 0;
Copy link
Contributor

Choose a reason for hiding this comment

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

wouldn't

itmCompare > (itm - 4);

work as well and be slightly more readable?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

For me it was also more readable, but I still get the warnings in this form:

>> Package Alignment/TrackerAlignment built
/build/tmp/CMSSW_12_5_LTO_X_2022-07-07-1100/src/Alignment/OfflineValidation/plugins/OverlapValidation.cc: In member function 'analyzeTrajectory':
/build/tmp/CMSSW_12_5_LTO_X_2022-07-07-1100/src/Alignment/OfflineValidation/plugins/OverlapValidation.cc:386:47: warning: assuming pointer wraparound does not occur when comparing P +- C1 with P +- C2 [-Wstrict-overflow]
  386 |            itmCompare >= measurements.begin() && itmCompare > (itm - 4);
      |                                               ^
Leaving library rule at src/Alignment/OfflineValidation/plugins

Copy link
Contributor

Choose a reason for hiding this comment

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

for my education how do you compile with this flag?

Copy link
Contributor

Choose a reason for hiding this comment

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

just use CMSSW_12_5_LTO_X IBs

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

(itmCompare >= measurements.begin()) && ((itmCompare > (itm - 4)) > 0);

Copy link
Contributor Author

Choose a reason for hiding this comment

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

This also works :)

@cmsbuild
Copy link
Contributor

cmsbuild commented Jul 8, 2022

+1

Summary: https://cmssdt.cern.ch/SDT/jenkins-artifacts/pull-request-integration/PR-318ed6/26076/summary.html
COMMIT: ffe7c27
CMSSW: CMSSW_12_5_LTO_X_2022-07-07-1100/el8_amd64_gcc10
User test area: For local testing, you can use /cvmfs/cms-ci.cern.ch/week0/cms-sw/cmssw/38649/26076/install.sh to create a dev area with all the needed externals and cmssw changes.

Comparison Summary

Summary:

  • No significant changes to the logs found
  • Reco comparison results: 659 differences found in the comparisons
  • DQMHistoTests: Total files compared: 50
  • DQMHistoTests: Total histograms compared: 3654771
  • DQMHistoTests: Total failures: 10385
  • DQMHistoTests: Total nulls: 0
  • DQMHistoTests: Total successes: 3644364
  • DQMHistoTests: Total skipped: 22
  • DQMHistoTests: Total Missing objects: 0
  • DQMHistoSizes: Histogram memory added: 0.0 KiB( 49 files compared)
  • Checked 208 log files, 45 edm output root files, 50 DQM output files
  • TriggerResults: no differences found

@cmsbuild
Copy link
Contributor

cmsbuild commented Jul 8, 2022

+1

Summary: https://cmssdt.cern.ch/SDT/jenkins-artifacts/pull-request-integration/PR-318ed6/26075/summary.html
COMMIT: ffe7c27
CMSSW: CMSSW_12_5_X_2022-07-07-2300/el8_amd64_gcc10
User test area: For local testing, you can use /cvmfs/cms-ci.cern.ch/week0/cms-sw/cmssw/38649/26075/install.sh to create a dev area with all the needed externals and cmssw changes.

Comparison Summary

Summary:

  • No significant changes to the logs found
  • Reco comparison results: 10 differences found in the comparisons
  • DQMHistoTests: Total files compared: 50
  • DQMHistoTests: Total histograms compared: 3654999
  • DQMHistoTests: Total failures: 20
  • DQMHistoTests: Total nulls: 0
  • DQMHistoTests: Total successes: 3654957
  • DQMHistoTests: Total skipped: 22
  • DQMHistoTests: Total Missing objects: 0
  • DQMHistoSizes: Histogram memory added: 0.0 KiB( 49 files compared)
  • Checked 208 log files, 45 edm output root files, 50 DQM output files
  • TriggerResults: no differences found

@aandvalenzuela
Copy link
Contributor Author

There is a warning of the same type in Calibration/Tools which is aso from the same alca category:

>> Building shared library tmp/el8_amd64_gcc10/src/Calibration/Tools/src/CalibrationTools/libCalibrationTools.so
/build/tmp/CMSSW_12_5_LTO_X_2022-07-07-1100/src/Calibration/Tools/src/HouseholderDecomposition.cc: In member function 'solve':
/build/tmp/CMSSW_12_5_LTO_X_2022-07-07-1100/src/Calibration/Tools/src/HouseholderDecomposition.cc:445:23: warning: assuming signed overflow does not occur when simplifying conditional to constant [-Wstrict-overflow]
  445 |     for (j = i + 1; j < Nchannels; j++) {
      |                       ^
Copying tmp/el8_amd64_gcc10/src/Calibration/Tools/src/CalibrationTools/libCalibrationTools.so to productstore area:
Leaving library rule at Calibration/Tools

I would also propose something similar as for Alignment/OfflineValidation and Alignment/TrackerAlignment :

for (j = 0; j - Nchannels < 0; j++)

Any other proposal in this case?

@tvami
Copy link
Contributor

tvami commented Jul 11, 2022

+alca

  • LTO built is compiling

@ChrisMisan
Copy link
Contributor

please abort

@@ -383,7 +383,7 @@ void OverlapValidation::analyzeTrajectory(const Trajectory& trajectory,
++overlapCounts_[1];
if ((layer != -1) && (acceptLayer[subDet])) {
for (vector<TrajectoryMeasurement>::const_iterator itmCompare = itm - 1;
itmCompare >= measurements.begin() && itmCompare > itm - 4;
(itmCompare >= measurements.begin()) && ((itmCompare > (itm - 4)) > 0);
Copy link
Contributor

@ChrisMisan ChrisMisan Jul 14, 2022

Choose a reason for hiding this comment

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

@aandvalenzuela This should also be changed:

((itmCompare > (itm - 4)) > 0)

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Done!

Solve -Wstrict-overflow warnings

Solve -Wstrict-overflow warnings

Solve -Wstrict-overflow warnings

Fix signed overflow warning

Apply smuzaffar suggestion

Fix style

Apply smuzaffar suggestion

Apply correction to initial suggestion
@aandvalenzuela aandvalenzuela force-pushed the from-CMSSW_12_5_LTO_X_2022-07-07-1100-Alignment branch from 096d968 to 805069f Compare July 14, 2022 08:20
@cmsbuild
Copy link
Contributor

+code-checks

Logs: https://cmssdt.cern.ch/SDT/code-checks/cms-sw-PR-38649/31044

  • This PR adds an extra 24KB to repository

@cmsbuild
Copy link
Contributor

Pull request #38649 was updated. @malbouis, @yuanchao, @cmsbuild, @francescobrivio, @ChrisMisan, @tvami can you please check and sign again.

@ChrisMisan
Copy link
Contributor

please test

@ChrisMisan
Copy link
Contributor

please test for CMSSW_12_5_LTO_X

@mmusich
Copy link
Contributor

mmusich commented Jul 14, 2022

please take also in account the discussion going on at #38683 (comment)

@cmsbuild
Copy link
Contributor

+1

Summary: https://cmssdt.cern.ch/SDT/jenkins-artifacts/pull-request-integration/PR-318ed6/26234/summary.html
COMMIT: 805069f
CMSSW: CMSSW_12_5_LTO_X_2022-07-12-1100/el8_amd64_gcc10
User test area: For local testing, you can use /cvmfs/cms-ci.cern.ch/week1/cms-sw/cmssw/38649/26234/install.sh to create a dev area with all the needed externals and cmssw changes.

Comparison Summary

Summary:

  • No significant changes to the logs found
  • Reco comparison results: 665 differences found in the comparisons
  • DQMHistoTests: Total files compared: 50
  • DQMHistoTests: Total histograms compared: 3653734
  • DQMHistoTests: Total failures: 10382
  • DQMHistoTests: Total nulls: 1
  • DQMHistoTests: Total successes: 3643329
  • DQMHistoTests: Total skipped: 22
  • DQMHistoTests: Total Missing objects: 0
  • DQMHistoSizes: Histogram memory added: 0.004 KiB( 49 files compared)
  • DQMHistoSizes: changed ( 312.0 ): 0.004 KiB MessageLogger/Warnings
  • Checked 208 log files, 45 edm output root files, 50 DQM output files
  • TriggerResults: no differences found

@cmsbuild
Copy link
Contributor

+1

Summary: https://cmssdt.cern.ch/SDT/jenkins-artifacts/pull-request-integration/PR-318ed6/26233/summary.html
COMMIT: 805069f
CMSSW: CMSSW_12_5_X_2022-07-13-2300/el8_amd64_gcc10
User test area: For local testing, you can use /cvmfs/cms-ci.cern.ch/week1/cms-sw/cmssw/38649/26233/install.sh to create a dev area with all the needed externals and cmssw changes.

Comparison Summary

Summary:

  • No significant changes to the logs found
  • Reco comparison results: 0 differences found in the comparisons
  • DQMHistoTests: Total files compared: 50
  • DQMHistoTests: Total histograms compared: 3653966
  • DQMHistoTests: Total failures: 2
  • DQMHistoTests: Total nulls: 0
  • DQMHistoTests: Total successes: 3653942
  • DQMHistoTests: Total skipped: 22
  • DQMHistoTests: Total Missing objects: 0
  • DQMHistoSizes: Histogram memory added: 0.0 KiB( 49 files compared)
  • Checked 208 log files, 45 edm output root files, 50 DQM output files
  • TriggerResults: no differences found

@ChrisMisan
Copy link
Contributor

-alca

  • it was decided on the ORP meeting that this PR should not be merged as it obfuscates the code

@perrotta
Copy link
Contributor

hold
(see minutes in https://indico.cern.ch/event/1184002/)

@cmsbuild
Copy link
Contributor

Pull request has been put on hold by @perrotta
They need to issue an unhold command to remove the hold state or L1 can unhold it for all

@cmsbuild cmsbuild added the hold label Jul 28, 2022
@@ -383,7 +383,7 @@ void OverlapValidation::analyzeTrajectory(const Trajectory& trajectory,
++overlapCounts_[1];
if ((layer != -1) && (acceptLayer[subDet])) {
for (vector<TrajectoryMeasurement>::const_iterator itmCompare = itm - 1;
itmCompare >= measurements.begin() && itmCompare > itm - 4;
(itmCompare >= measurements.begin()) && ((itmCompare + 4) > itm);
Copy link
Contributor

Choose a reason for hiding this comment

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

I'd argue comparing an iterator to be larger than or equal with begin() does not make much sense as in principle it is always true because

The begin iterator is not decrementable and the behavior is undefined if --container.begin() is evaluated.

https://en.cppreference.com/w/cpp/named_req/BidirectionalIterator

Copy link
Contributor

Choose a reason for hiding this comment

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

but itm-1 has a similar issue when itm is equal to measurements.begin(), no? or is that somehow ok?

Copy link
Contributor

Choose a reason for hiding this comment

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

but itm-1 has a similar issue when itm is equal to measurements.begin(), no?

Right (didn't look that far), already the itm-1 seems to be potentially undefined behavior.

How about rewriting the loop e.g. along

for (int offset = 1, end=std::min(3, std::distance(measurements.begin(), itm)); offset <= end; ++offset) {
  auto itmCompare = std::prev(itm, offset);
  ...
}

Then, for

  • itm == begin() the loop body would not be run
  • itm == begin()+1 the loop body would be run with itmCompare = itm-1
  • itm == begin()+2 the loop body would be run with itmCompare = itm-1 and itm-2
  • itm >= begin()+3 the loop body would be run with itmCompare = itm-1, itm-2, and itm-3

(I'm sure there are even better ways to write the loop)

@smuzaffar
Copy link
Contributor

-Wstrict-overflow flag is deprecated and we have dropped it (cms-sw/cmsdist#8026). So these changes are not needed

@smuzaffar smuzaffar closed this Aug 19, 2022
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.

9 participants