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

Utilities/StaticAnalyzers: Add CMS_SA_ALLOW exceptions on Static Analyzer checks involving Decls. #28630

Conversation

gartung
Copy link
Member

@gartung gartung commented Dec 16, 2019

Allows the user of cms threads safety macro CMS_SA_ALLOW in declarations that should be allowed to suppress the warning associated with the static analyzer check. This is done to reduce the volume of warnings in the static analyzer reports.

@gartung
Copy link
Member Author

gartung commented Dec 16, 2019

@Dr15Jones

@cmsbuild
Copy link
Contributor

The code-checks are being triggered in jenkins.

@cmsbuild
Copy link
Contributor

-code-checks

Logs: https://cmssdt.cern.ch/SDT/code-checks/cms-sw-PR-28630/13173

  • This PR adds an extra 24KB to repository

Code check has found code style and quality issues which could be resolved by applying following patch(s)

@cmsbuild
Copy link
Contributor

The code-checks are being triggered in jenkins.

@cmsbuild
Copy link
Contributor

+code-checks

Logs: https://cmssdt.cern.ch/SDT/code-checks/cms-sw-PR-28630/13174

  • This PR adds an extra 24KB to repository

@Dr15Jones
Copy link
Contributor

@gartung could you give an example, as a comment in this pull request, on what new declarations can be marked?

@cmsbuild
Copy link
Contributor

A new Pull Request was created by @gartung (Patrick Gartung) for master.

It involves the following packages:

Utilities/StaticAnalyzers

@cmsbuild, @smuzaffar, @Dr15Jones can you please review it and eventually sign? Thanks.
@wddgit this is something you requested to watch as well.
@davidlange6, @slava77, @fabiocos you are the release manager for this.

cms-bot commands are listed here

@gartung
Copy link
Member Author

gartung commented Dec 17, 2019

CMS_SA_ALLOW can be used before these declarations

Stand alone checkers

  • Before any non-const static local variable declaration
  • Before any non-const static member declaration
  • Before any mutable member declaration
  • Before any extern C declaration

CatchAll checker:

  • Before a function body declaration that uses catch(...)

Function checker:
Before a function or function template body declaration where

  • a non-const static local variable is accessed or modified
  • a COMMONBLOCK variable accessed or modified
  • non-const global static variable is accessed or modified

In a CMS data class:

Before a const member function declaration where

  • a non-const static local variable is accessed
  • a non-const static member variable accessed
  • a non-const global static variable accessed
  • member data is modified
  • returns or has return type pointer to a non-const member variable
  • returns or has return type object of type const std::vector<> or const td::vector<>&

Before a mutable member declaration.

@fabiocos
Copy link
Contributor

please test

@cmsbuild
Copy link
Contributor

cmsbuild commented Dec 17, 2019

The tests are being triggered in jenkins.
https://cmssdt.cern.ch/jenkins/job/ib-run-pr-tests/4021/console Started: 2019/12/17 10:35

@cmsbuild
Copy link
Contributor

+1
Tested at: e73679c
https://cmssdt.cern.ch/SDT/jenkins-artifacts/pull-request-integration/PR-a98071/4021/summary.html
CMSSW: CMSSW_11_1_X_2019-12-16-2300
SCRAM_ARCH: slc7_amd64_gcc820

@cmsbuild
Copy link
Contributor

Comparison job queued.

@gartung
Copy link
Member Author

gartung commented Dec 21, 2019

test with cms-sw/cmsdist#5445

@cmsbuild
Copy link
Contributor

cmsbuild commented Dec 21, 2019

The tests are being triggered in jenkins.
Tested with other pull request(s) cms-sw/cmsdist#5445
https://cmssdt.cern.ch/jenkins/job/ib-run-pr-tests/4086/console Started: 2019/12/21 16:43

@cmsbuild
Copy link
Contributor

+1
Tested at: 1a2113b
https://cmssdt.cern.ch/SDT/jenkins-artifacts/pull-request-integration/PR-6fefb9/4086/summary.html
CMSSW: CMSSW_11_1_X_2019-12-21-1100
SCRAM_ARCH: slc7_amd64_gcc820

@cmsbuild
Copy link
Contributor

Comparison job queued.

@cmsbuild
Copy link
Contributor

Comparison is ready
https://cmssdt.cern.ch/SDT/jenkins-artifacts/pull-request-integration/PR-6fefb9/4086/summary.html

Comparison Summary:

  • No significant changes to the logs found
  • Reco comparison results: 0 differences found in the comparisons
  • DQMHistoTests: Total files compared: 34
  • DQMHistoTests: Total histograms compared: 2813777
  • DQMHistoTests: Total failures: 1
  • DQMHistoTests: Total nulls: 0
  • DQMHistoTests: Total successes: 2813435
  • DQMHistoTests: Total skipped: 341
  • DQMHistoTests: Total Missing objects: 0
  • DQMHistoSizes: Histogram memory added: 0.0 KiB( 33 files compared)
  • Checked 147 log files, 16 edm output root files, 34 DQM output files

@Dr15Jones
Copy link
Contributor

@gartung what is the state of this? Were you able to get the annotation of try {} catch(...) to work?

@gartung
Copy link
Member Author

gartung commented Dec 23, 2019

Yes the putting CMS_SA_ALLOW in front of the try statement will suppress the warning about catch (...) I tested it on the try catch in FWCore/Services and it works.

@gartung
Copy link
Member Author

gartung commented Dec 23, 2019

Making vetos for the other checkers can be in another pull request.

@Dr15Jones
Copy link
Contributor

+1

@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. @davidlange6, @slava77, @smuzaffar, @fabiocos, @silviodonato (and backports should be raised in the release meeting by the corresponding L2)

@fabiocos
Copy link
Contributor

+1

@cmsbuild cmsbuild merged commit 4010528 into cms-sw:master Dec 28, 2019
@gartung gartung deleted the gartung-Utilities-StaticAnalyzers-add-sa-allow-all branch January 6, 2020 17:51
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.

None yet

4 participants