-
Notifications
You must be signed in to change notification settings - Fork 4.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
[DQM]L1TOccupancyClient: Bug fix and fixes static analyzer warning #46442
base: master
Are you sure you want to change the base?
Conversation
cms-bot internal usage |
@@ -459,7 +457,8 @@ double L1TOccupancyClient::xySymmetry(const ParameterSet& ps, | |||
cout << "statsup= " << statsup << ", statslow= " << statslow << endl; | |||
} | |||
|
|||
enoughStats = TMath::MinElement(nActualStrips, maxAvgs.get()) > TMath::Max(statsup, statslow); | |||
if (nActualStrips > 0) | |||
enoughStats = TMath::MinElement(nActualStrips, maxAvgs.get()) > TMath::Max(statsup, statslow); | |||
if (verbose_) { | |||
cout << "stats: " << TMath::MinElement(nActualStrips, maxAvgs.get()) |
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.
@cms-sw/dqm-l2 , any idea what should be printed in case of nActualStrips=0
?
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.
My guess would be something alog these lines
if (nActualStrips == 0) {
cout << "No valid strips found, insufficient statistics." << endl;
} else {
but perhaps the @cms-sw/l1-l2 can confirm
@@ -543,7 +541,8 @@ double L1TOccupancyClient::xySymmetry(const ParameterSet& ps, | |||
if (verbose_) { | |||
cout << "statsup= " << statsup << ", statslow= " << statslow << endl; | |||
} | |||
enoughStats = TMath::MinElement(nActualStrips, maxAvgs.get()) > TMath::Max(statsup, statslow); | |||
if (nActualStrips > 0) | |||
enoughStats = TMath::MinElement(nActualStrips, maxAvgs.get()) > TMath::Max(statsup, statslow); | |||
if (verbose_) { | |||
cout << "stats: " << TMath::MinElement(nActualStrips, maxAvgs.get()) |
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.
same here, call to TMath::MinElement
should be avoid for nActualStrips==0
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.
As above
+code-checks Logs: https://cmssdt.cern.ch/SDT/code-checks/cms-sw-PR-46442/42303
|
A new Pull Request was created by @smuzaffar for master. It involves the following packages:
@antoniovagnerini, @cmsbuild, @nothingface0, @rvenditti, @syuvivida, @tjavaid can you please review it and eventually sign? Thanks. cms-bot commands are listed here |
please test |
-1 Failed Tests: ClangBuild Clang BuildI found compilation warning while trying to compile with clang. Command used:
See details on the summary page. |
please test |
+code-checks Logs: https://cmssdt.cern.ch/SDT/code-checks/cms-sw-PR-46442/42358
|
Pull request #46442 was updated. @antoniovagnerini, @nothingface0, @rvenditti, @syuvivida, @tjavaid can you please check and sign again. |
-1 Failed Tests: Build ClangBuild BuildI found compilation error when building: >> Compiling edm plugin src/DQM/L1TMonitorClient/src/L1TdeStage2ShowerRegionalClient.cc /cvmfs/cms-ib.cern.ch/sw/x86_64/nweek-02860/el8_amd64_gcc12/external/gcc/12.3.1-40d504be6370b5a30e3947a6e575ca28/bin/c++ -c -DGNU_GCC -D_GNU_SOURCE -DTBB_USE_GLIBCXX_VERSION=120301 -DTBB_SUPPRESS_DEPRECATED_MESSAGES -DTBB_PREVIEW_RESUMABLE_TASKS=1 -DTBB_PREVIEW_TASK_GROUP_EXTENSIONS=1 -DBOOST_SPIRIT_THREADSAFE -DPHOENIX_THREADSAFE -DBOOST_MATH_DISABLE_STD_FPCLASSIFY -DBOOST_UUID_RANDOM_PROVIDER_FORCE_POSIX -D__STDC_LIMIT_MACROS -D__STDC_FORMAT_MACROS -DCMSSW_GIT_HASH='CMSSW_14_2_X_2024-10-24-1100' -DPROJECT_NAME='CMSSW' -DPROJECT_VERSION='CMSSW_14_2_X_2024-10-24-1100' -Isrc -Ipoison -I/cvmfs/cms-ib.cern.ch/sw/x86_64/nweek-02860/el8_amd64_gcc12/cms/cmssw-patch/CMSSW_14_2_X_2024-10-24-1100/src -I/cvmfs/cms-ib.cern.ch/sw/x86_64/nweek-02860/el8_amd64_gcc12/external/classlib/3.1.3-c6b100380ee001a2bc06975bb0682ffc/include -I/cvmfs/cms-ib.cern.ch/sw/x86_64/nweek-02860/el8_amd64_gcc12/external/pcre/8.43-e34796d17981e9b6d174328c69446455/include -isystem/cvmfs/cms-ib.cern.ch/sw/x86_64/nweek-02860/el8_amd64_gcc12/external/boost/1.80.0-477823d53efabc5118f199265eb7ab49/include -I/cvmfs/cms-ib.cern.ch/sw/x86_64/nweek-02860/el8_amd64_gcc12/external/bz2lib/1.0.6-d065ccd79984efc6d4660f410e4c81de/include -I/cvmfs/cms-ib.cern.ch/sw/x86_64/nweek-02860/el8_amd64_gcc12/external/libuuid/2.34-27ce4c3579b5b1de2808ea9c4cd8ed29/include -I/cvmfs/cms-ib.cern.ch/sw/x86_64/nweek-02860/el8_amd64_gcc12/external/protobuf/3.21.9-cceae2b21362e2ebbf12522a68c60cb1/include -isystem/cvmfs/cms-ib.cern.ch/sw/x86_64/nweek-02860/el8_amd64_gcc12/lcg/root/6.30.09-750fd45700afc5d74863b522cf3e6e56/include -isystem/cvmfs/cms-ib.cern.ch/sw/x86_64/nweek-02860/el8_amd64_gcc12/external/tbb/v2021.9.0-e785b749a0b6cb9c66dc1d78066210e0/include -I/cvmfs/cms-ib.cern.ch/sw/x86_64/nweek-02860/el8_amd64_gcc12/external/xz/5.2.5-6f3f49b07db84e10c9be594a1176c114/include -I/cvmfs/cms-ib.cern.ch/sw/x86_64/nweek-02860/el8_amd64_gcc12/external/zlib/1.2.11-1a082fc322b0051b504cc023f21df178/include -I/cvmfs/cms-ib.cern.ch/sw/x86_64/nweek-02860/el8_amd64_gcc12/external/fmt/10.2.1-deba157dd76fed17ac8b42adc60ff53f/include -I/cvmfs/cms-ib.cern.ch/sw/x86_64/nweek-02860/el8_amd64_gcc12/external/md5/1.0.0-5b594b264e04ae51e893b1d69a797ec6/include -I/cvmfs/cms-ib.cern.ch/sw/x86_64/nweek-02860/el8_amd64_gcc12/external/tinyxml2/6.2.0-68d511689c5dbd9a0d296bbb795fa052/include -O3 -pthread -pipe -Werror=main -Werror=pointer-arith -Werror=overlength-strings -Wno-vla -Werror=overflow -std=c++20 -ftree-vectorize -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 -Wno-error=array-bounds -Warray-bounds -fuse-ld=bfd -march=x86-64-v2 -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-unused-parameter -Wunused -Wparentheses -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=auto -fipa-icf -flto-odr-type-merging -fno-fat-lto-objects -Wodr -fPIC -MMD -MF tmp/el8_amd64_gcc12/src/DQM/L1TMonitorClient/src/DQML1TMonitorClient/L1TdeStage2ShowerRegionalClient.cc.d src/DQM/L1TMonitorClient/src/L1TdeStage2ShowerRegionalClient.cc -o tmp/el8_amd64_gcc12/src/DQM/L1TMonitorClient/src/DQML1TMonitorClient/L1TdeStage2ShowerRegionalClient.cc.o >> Compiling edm plugin src/DQM/L1TMonitorClient/src/SealModule.cc /cvmfs/cms-ib.cern.ch/sw/x86_64/nweek-02860/el8_amd64_gcc12/external/gcc/12.3.1-40d504be6370b5a30e3947a6e575ca28/bin/c++ -c -DGNU_GCC -D_GNU_SOURCE -DTBB_USE_GLIBCXX_VERSION=120301 -DTBB_SUPPRESS_DEPRECATED_MESSAGES -DTBB_PREVIEW_RESUMABLE_TASKS=1 -DTBB_PREVIEW_TASK_GROUP_EXTENSIONS=1 -DBOOST_SPIRIT_THREADSAFE -DPHOENIX_THREADSAFE -DBOOST_MATH_DISABLE_STD_FPCLASSIFY -DBOOST_UUID_RANDOM_PROVIDER_FORCE_POSIX -D__STDC_LIMIT_MACROS -D__STDC_FORMAT_MACROS -DCMSSW_GIT_HASH='CMSSW_14_2_X_2024-10-24-1100' -DPROJECT_NAME='CMSSW' -DPROJECT_VERSION='CMSSW_14_2_X_2024-10-24-1100' -Isrc -Ipoison -I/cvmfs/cms-ib.cern.ch/sw/x86_64/nweek-02860/el8_amd64_gcc12/cms/cmssw-patch/CMSSW_14_2_X_2024-10-24-1100/src -I/cvmfs/cms-ib.cern.ch/sw/x86_64/nweek-02860/el8_amd64_gcc12/external/classlib/3.1.3-c6b100380ee001a2bc06975bb0682ffc/include -I/cvmfs/cms-ib.cern.ch/sw/x86_64/nweek-02860/el8_amd64_gcc12/external/pcre/8.43-e34796d17981e9b6d174328c69446455/include -isystem/cvmfs/cms-ib.cern.ch/sw/x86_64/nweek-02860/el8_amd64_gcc12/external/boost/1.80.0-477823d53efabc5118f199265eb7ab49/include -I/cvmfs/cms-ib.cern.ch/sw/x86_64/nweek-02860/el8_amd64_gcc12/external/bz2lib/1.0.6-d065ccd79984efc6d4660f410e4c81de/include -I/cvmfs/cms-ib.cern.ch/sw/x86_64/nweek-02860/el8_amd64_gcc12/external/libuuid/2.34-27ce4c3579b5b1de2808ea9c4cd8ed29/include -I/cvmfs/cms-ib.cern.ch/sw/x86_64/nweek-02860/el8_amd64_gcc12/external/protobuf/3.21.9-cceae2b21362e2ebbf12522a68c60cb1/include -isystem/cvmfs/cms-ib.cern.ch/sw/x86_64/nweek-02860/el8_amd64_gcc12/lcg/root/6.30.09-750fd45700afc5d74863b522cf3e6e56/include -isystem/cvmfs/cms-ib.cern.ch/sw/x86_64/nweek-02860/el8_amd64_gcc12/external/tbb/v2021.9.0-e785b749a0b6cb9c66dc1d78066210e0/include -I/cvmfs/cms-ib.cern.ch/sw/x86_64/nweek-02860/el8_amd64_gcc12/external/xz/5.2.5-6f3f49b07db84e10c9be594a1176c114/include -I/cvmfs/cms-ib.cern.ch/sw/x86_64/nweek-02860/el8_amd64_gcc12/external/zlib/1.2.11-1a082fc322b0051b504cc023f21df178/include -I/cvmfs/cms-ib.cern.ch/sw/x86_64/nweek-02860/el8_amd64_gcc12/external/fmt/10.2.1-deba157dd76fed17ac8b42adc60ff53f/include -I/cvmfs/cms-ib.cern.ch/sw/x86_64/nweek-02860/el8_amd64_gcc12/external/md5/1.0.0-5b594b264e04ae51e893b1d69a797ec6/include -I/cvmfs/cms-ib.cern.ch/sw/x86_64/nweek-02860/el8_amd64_gcc12/external/tinyxml2/6.2.0-68d511689c5dbd9a0d296bbb795fa052/include -O3 -pthread -pipe -Werror=main -Werror=pointer-arith -Werror=overlength-strings -Wno-vla -Werror=overflow -std=c++20 -ftree-vectorize -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 -Wno-error=array-bounds -Warray-bounds -fuse-ld=bfd -march=x86-64-v2 -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-unused-parameter -Wunused -Wparentheses -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=auto -fipa-icf -flto-odr-type-merging -fno-fat-lto-objects -Wodr -fPIC -MMD -MF tmp/el8_amd64_gcc12/src/DQM/L1TMonitorClient/src/DQML1TMonitorClient/SealModule.cc.d src/DQM/L1TMonitorClient/src/SealModule.cc -o tmp/el8_amd64_gcc12/src/DQM/L1TMonitorClient/src/DQML1TMonitorClient/SealModule.cc.o src/DQM/L1TMonitorClient/src/L1TOccupancyClient.cc: In member function 'double L1TOccupancyClient::xySymmetry(const edm::ParameterSet&, std::string, std::vector >&, std::vector >&, bool&)': src/DQM/L1TMonitorClient/src/L1TOccupancyClient.cc:421:65: error: 'i' was not declared in this scope 421 | for (int j = upBinStrip, k = lowBinStrip; j <= maxBinStrip; i++, j++, k--) { | ^ src/DQM/L1TMonitorClient/src/L1TOccupancyClient.cc:509:65: error: 'i' was not declared in this scope 509 | for (int j = upBinStrip, k = lowBinStrip; j <= maxBinStrip; i++, j++, k--) { | ^ Clang BuildI found compilation error while trying to compile with clang. Command used:
>> Local Products Rules ..... started >> Local Products Rules ..... done >> Creating project symlinks >> Entering Package DQM/L1TMonitorClient >> Compile sequence completed for CMSSW CMSSW_14_2_X_2024-10-24-1100 gmake: *** [There are compilation/build errors. Please see the detail log above.] Error 1 + eval scram build outputlog '&&' '(python3' /data/cmsbld/jenkins/workspace/ib-run-pr-tests/cms-bot/buildLogAnalyzer.py --logDir /data/cmsbld/jenkins/workspace/ib-run-pr-tests/CMSSW_14_2_X_2024-10-24-1100/tmp/el8_amd64_gcc12/cache/log/src '||' 'true)' ++ scram build outputlog >> Entering Package DQM/L1TMonitorClient Entering library rule at DQM/L1TMonitorClient >> Compiling edm plugin src/DQM/L1TMonitorClient/src/L1EmulatorErrorFlagClient.cc |
e564d80
to
bd61fee
Compare
+code-checks Logs: https://cmssdt.cern.ch/SDT/code-checks/cms-sw-PR-46442/42359
|
Pull request #46442 was updated. @antoniovagnerini, @cmsbuild, @nothingface0, @rvenditti, @syuvivida, @tjavaid can you please check and sign again. |
please test |
+1 Size: This PR adds an extra 24KB to repository Comparison SummarySummary:
|
This PR proposes following changes
getAvrg
only when neededmaxAvgs
using the correct correct indexnActualStrips
TMath::MinElement
only ifnActualStrips>0
otherwise we have a uninitializemaxAvgs
. This fixes clang analyzer warning [a][a] https://cmssdt.cern.ch/SDT/jenkins-artifacts/ib-static-analysis/CMSSW_14_2_X_2024-10-16-1100/el8_amd64_gcc12/llvm-analysis/report-4ed65d.html#EndPath