• Icon: Bug Bug
    • Resolution: Fixed
    • Icon: Critical Critical
    • cppcheck-plugin
    • None
    • Jenkins 2.135

      Cppcheck 1.23 crashes with:

      13:13:42 [Cppcheck] Starting the cppcheck analysis.
      13:13:42 ERROR: Build step failed with exception
      13:13:42 java.lang.NullPointerException
      13:13:42 	at org.jenkinsci.plugins.cppcheck.CppcheckPublisher.perform(CppcheckPublisher.java:387)
      13:13:42 	at hudson.tasks.BuildStepMonitor$1.perform(BuildStepMonitor.java:20)
      13:13:42 	at hudson.model.AbstractBuild$AbstractBuildExecution.perform(AbstractBuild.java:744)
      13:13:42 	at hudson.model.AbstractBuild$AbstractBuildExecution.performAllBuildSteps(AbstractBuild.java:690)
      13:13:42 	at hudson.model.Build$BuildExecution.post2(Build.java:186)
      13:13:42 	at hudson.model.AbstractBuild$AbstractBuildExecution.post(AbstractBuild.java:635)
      13:13:42 	at hudson.model.Run.execute(Run.java:1840)
      13:13:42 	at hudson.matrix.MatrixRun.run(MatrixRun.java:153)
      13:13:42 	at hudson.model.ResourceController.execute(ResourceController.java:97)
      13:13:42 	at hudson.model.Executor.run(Executor.java:429)
      13:13:42 Build step 'Publish Cppcheck results' marked build as failure
      

          [JENKINS-52854] NPE with Cppcheck plugin 1.23

          Marco Steffan added a comment -

          1.22 in fact has the problem that configuration gets lost. Future versions have no ability to restore that configuration. Thus, you have to re-enter your configs - sorry for that! After doing that the exception should not appear any more. cobexer, nkjensen could you confirm that?

          Marco Steffan added a comment - 1.22 in fact has the problem that configuration gets lost. Future versions have no ability to restore that configuration. Thus, you have to re-enter your configs - sorry for that! After doing that the exception should not appear any more. cobexer , nkjensen could you confirm that?

          marcosteffan Thank you! It solved my problem too. Now running 1.23

          Niels Kristian Jensen added a comment - marcosteffan Thank you! It solved my problem too. Now running 1.23

          Hi marcosteffan,

          Thank you for this comment and for maintaining this plugin.

          Do you know if the field names have changed?
          I am using Jenkins Job Builder and this kind of XML doesn't work anymore: after the update, the 'patterns' input in Jenkins WebUI is empty:

          <?xml version="1.0" encoding="utf-8"?>
          <project>
            <publishers>
              <org.jenkinsci.plugins.cppcheck.CppcheckPublisher plugin="cppcheck">
                <cppcheckConfig>
                  <pattern>**/cppcheck.xml</pattern>
                  <ignoreBlankFiles>true</ignoreBlankFiles>
                  <allowNoReport>true</allowNoReport>
                  <configSeverityEvaluation>
                    <threshold>5</threshold>
                    <newThreshold>5</newThreshold>
                    <failureThreshold>7</failureThreshold>
                    <newFailureThreshold>3</newFailureThreshold>
                    <healthy>5</healthy>
                    <unHealthy>10</unHealthy>
                    <severityError>false</severityError>
                    <severityWarning>false</severityWarning>
                    <severityStyle>false</severityStyle>
                    <severityPerformance>false</severityPerformance>
                    <severityInformation>false</severityInformation>
                    <severityNoCategory>false</severityNoCategory>
                    <severityPortability>false</severityPortability>
                  </configSeverityEvaluation>
                  <configGraph>
                    <xSize>600</xSize>
                    <ySize>300</ySize>
                    <numBuildsInGraph>10</numBuildsInGraph>
                    <displayAllErrors>false</displayAllErrors>
                    <displayErrorSeverity>true</displayErrorSeverity>
                    <displayWarningSeverity>true</displayWarningSeverity>
                    <displayStyleSeverity>true</displayStyleSeverity>
                    <displayPerformanceSeverity>true</displayPerformanceSeverity>
                    <displayInformationSeverity>true</displayInformationSeverity>
                    <displayNoCategorySeverity>true</displayNoCategorySeverity>
                    <displayPortabilitySeverity>true</displayPortabilitySeverity>
                  </configGraph>
                </cppcheckConfig>
              </org.jenkinsci.plugins.cppcheck.CppcheckPublisher>
            </publishers>
          </project>

          https://git.openstack.org/cgit/openstack-infra/jenkins-job-builder/tree/tests/publishers/fixtures/cppcheck-full.xml

          If the names have changed, by chance, do you know if we can force them back to the previous ones not to break Jenkins-Job-Builder?

          Matthieu Baerts added a comment - Hi marcosteffan , Thank you for this comment and for maintaining this plugin. Do you know if the field names have changed? I am using Jenkins Job Builder and this kind of XML doesn't work anymore: after the update, the 'patterns' input in Jenkins WebUI is empty: <?xml version= "1.0" encoding= "utf-8" ?> <project> <publishers> <org.jenkinsci.plugins.cppcheck.CppcheckPublisher plugin= "cppcheck" > <cppcheckConfig> <pattern> **/cppcheck.xml </pattern> <ignoreBlankFiles> true </ignoreBlankFiles> <allowNoReport> true </allowNoReport> <configSeverityEvaluation> <threshold> 5 </threshold> <newThreshold> 5 </newThreshold> <failureThreshold> 7 </failureThreshold> <newFailureThreshold> 3 </newFailureThreshold> <healthy> 5 </healthy> <unHealthy> 10 </unHealthy> <severityError> false </severityError> <severityWarning> false </severityWarning> <severityStyle> false </severityStyle> <severityPerformance> false </severityPerformance> <severityInformation> false </severityInformation> <severityNoCategory> false </severityNoCategory> <severityPortability> false </severityPortability> </configSeverityEvaluation> <configGraph> <xSize> 600 </xSize> <ySize> 300 </ySize> <numBuildsInGraph> 10 </numBuildsInGraph> <displayAllErrors> false </displayAllErrors> <displayErrorSeverity> true </displayErrorSeverity> <displayWarningSeverity> true </displayWarningSeverity> <displayStyleSeverity> true </displayStyleSeverity> <displayPerformanceSeverity> true </displayPerformanceSeverity> <displayInformationSeverity> true </displayInformationSeverity> <displayNoCategorySeverity> true </displayNoCategorySeverity> <displayPortabilitySeverity> true </displayPortabilitySeverity> </configGraph> </cppcheckConfig> </org.jenkinsci.plugins.cppcheck.CppcheckPublisher> </publishers> </project> https://git.openstack.org/cgit/openstack-infra/jenkins-job-builder/tree/tests/publishers/fixtures/cppcheck-full.xml If the names have changed, by chance, do you know if we can force them back to the previous ones not to break Jenkins-Job-Builder?

          Considering that downgrading fixed the problem for me means that the configuration is not lost by merely upgrading.
          Thus you can restore compatibility by fixing the Cppcheck plugin for anyone that did not modify jobs after updating or for those that have not updated yet.

          Ing. Christoph Obexer added a comment - Considering that downgrading fixed the problem for me means that the configuration is not lost by merely upgrading. Thus you can restore compatibility by fixing the Cppcheck plugin for anyone that did not modify jobs after updating or for those that have not updated yet.

          Ing. Christoph Obexer added a comment - I guess this commit: https://github.com/jenkinsci/cppcheck-plugin/commit/32710c4c344bcc72c5bab3d2b4a3b5bd3a12382f broke compatibility?!

          https://wiki.jenkins.io/display/JENKINS/Hint+on+retaining+backward+compatibility should be the guide for how to keep compatibility (the "Scenario: Rename a field" AFAICT)

          Ing. Christoph Obexer added a comment - https://wiki.jenkins.io/display/JENKINS/Hint+on+retaining+backward+compatibility should be the guide for how to keep compatibility (the "Scenario: Rename a field" AFAICT)

          Matthieu Baerts added a comment - - edited

          cobexer: thank you for the links!

          marcosteffan: I confirm that the compatibility is broken, see what I can get from config.xml after having edited the config from the WebUI:

          (...)
              <org.jenkinsci.plugins.cppcheck.CppcheckPublisher plugin="cppcheck@1.23">
                <config> <!-- Not cppcheckConfig anymore -->
                  <pattern>**/cppcheck.xml</pattern>
                  <ignoreBlankFiles>false</ignoreBlankFiles>
                  <allowNoReport>false</allowNoReport>
                  <configSeverityEvaluation>
                    <threshold></threshold>
                    <newThreshold></newThreshold>
                    <failureThreshold></failureThreshold>
                    <newFailureThreshold></newFailureThreshold>
                    <healthy></healthy>
                    <unHealthy></unHealthy>
                    <severityError>true</severityError>
                    <severityWarning>true</severityWarning>
                    <severityStyle>true</severityStyle>
                    <severityPerformance>true</severityPerformance>
                    <severityInformation>true</severityInformation>
                    <severityNoCategory>true</severityNoCategory>
                    <severityPortability>true</severityPortability>
                  </configSeverityEvaluation>
                  <configGraph>
                    <xSize>500</xSize>
                    <ySize>200</ySize>
                    <numBuildsInGraph>0</numBuildsInGraph>
                    <displayAllErrors>true</displayAllErrors>
                    <displayErrorSeverity>false</displayErrorSeverity>
                    <displayWarningSeverity>false</displayWarningSeverity>
                    <displayStyleSeverity>false</displayStyleSeverity>
                    <displayPerformanceSeverity>false</displayPerformanceSeverity>
                    <displayInformationSeverity>false</displayInformationSeverity>
                    <displayNoCategorySeverity>false</displayNoCategorySeverity>
                    <displayPortabilitySeverity>false</displayPortabilitySeverity>
                  </configGraph>
                </config> <!-- Not cppcheckConfig anymore -->
              </org.jenkinsci.plugins.cppcheck.CppcheckPublisher>
          (...)
          

          cppcheckConfig → config.

          Matthieu Baerts added a comment - - edited cobexer : thank you for the links! marcosteffan : I confirm that the compatibility is broken, see what I can get from config.xml after having edited the config from the WebUI: (...) <org.jenkinsci.plugins.cppcheck.CppcheckPublisher plugin= "cppcheck@1.23" > <config> <!-- Not cppcheckConfig anymore --> <pattern> **/cppcheck.xml </pattern> <ignoreBlankFiles> false </ignoreBlankFiles> <allowNoReport> false </allowNoReport> <configSeverityEvaluation> <threshold> </threshold> <newThreshold> </newThreshold> <failureThreshold> </failureThreshold> <newFailureThreshold> </newFailureThreshold> <healthy> </healthy> <unHealthy> </unHealthy> <severityError> true </severityError> <severityWarning> true </severityWarning> <severityStyle> true </severityStyle> <severityPerformance> true </severityPerformance> <severityInformation> true </severityInformation> <severityNoCategory> true </severityNoCategory> <severityPortability> true </severityPortability> </configSeverityEvaluation> <configGraph> <xSize> 500 </xSize> <ySize> 200 </ySize> <numBuildsInGraph> 0 </numBuildsInGraph> <displayAllErrors> true </displayAllErrors> <displayErrorSeverity> false </displayErrorSeverity> <displayWarningSeverity> false </displayWarningSeverity> <displayStyleSeverity> false </displayStyleSeverity> <displayPerformanceSeverity> false </displayPerformanceSeverity> <displayInformationSeverity> false </displayInformationSeverity> <displayNoCategorySeverity> false </displayNoCategorySeverity> <displayPortabilitySeverity> false </displayPortabilitySeverity> </configGraph> </config> <!-- Not cppcheckConfig anymore --> </org.jenkinsci.plugins.cppcheck.CppcheckPublisher> (...) cppcheckConfig → config.

          FYI, today I created a PR on Github to fix the issue (keep backward compatibility with versions <1.23 but not 1.23 or course): https://github.com/jenkinsci/cppcheck-plugin/pull/44

          It seems to work for me! It produce this 'config.xml' with the right section:

              <org.jenkinsci.plugins.cppcheck.CppcheckPublisher plugin="cppcheck">
                <cppcheckConfig>
                  <pattern>**/cppcheck.xml</pattern>
          

          Please don't hesitate to confirm that

          Note that you can directly use this artefact built by Jenkins there before waiting for the new release (if this patch is accepted and a new release is made by marcosteffan): https://ci.jenkins.io/blue/organizations/jenkins/Plugins%2Fcppcheck-plugin/detail/PR-44/2/artifacts/

          Matthieu Baerts added a comment - FYI, today I created a PR on Github to fix the issue (keep backward compatibility with versions <1.23 but not 1.23 or course): https://github.com/jenkinsci/cppcheck-plugin/pull/44 It seems to work for me! It produce this 'config.xml' with the right section: <org.jenkinsci.plugins.cppcheck.CppcheckPublisher plugin= "cppcheck" > <cppcheckConfig> <pattern> **/cppcheck.xml </pattern> Please don't hesitate to confirm that Note that you can directly use this artefact built by Jenkins there before waiting for the new release (if this patch is accepted and a new release is made by marcosteffan ): https://ci.jenkins.io/blue/organizations/jenkins/Plugins%2Fcppcheck-plugin/detail/PR-44/2/artifacts/

          nkjensen: thank you for this comment. May you open a new ticket about that as it is not linked with the crash we have here? (this bug might be lost because of that)

          Matthieu Baerts added a comment - nkjensen : thank you for this comment. May you open a new ticket about that as it is not linked with the crash we have here? (this bug might be lost because of that)

          Kyle Leinen added a comment -

          marcosteffan Any movement on this fix? I am going to build the snapshot in the interim, but it would be nice to have this merged and officially released.

          Kyle Leinen added a comment - marcosteffan Any movement on this fix? I am going to build the snapshot in the interim, but it would be nice to have this merged and officially released.

            marcosteffan Marco Steffan
            cobexer Ing. Christoph Obexer
            Votes:
            9 Vote for this issue
            Watchers:
            11 Start watching this issue

              Created:
              Updated:
              Resolved: