• 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

          Ing. Christoph Obexer created issue -

          Niels Kristian Jensen added a comment - - edited

          I see the same on Jenkins 2.121.2 running Windows Server 2008 R2.

          Downgrading to 1.22 did not solve the issue.

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

          The last "working" build 2 days ago showed:

          [Cppcheck] Starting the cppcheck analysis.
          [Cppcheck] Processing 1 files with the pattern 'cppcheck.xml '.
          [Cppcheck] Not changing build status, since no threshold has been exceeded.
          [Cppcheck] Ending the cppcheck analysis.

          I updated from Jenkins 2.107.x yesterday. It seems to fit the time, when cppcheck started to NPE.

          Niels Kristian Jensen added a comment - - edited I see the same on Jenkins 2.121.2 running Windows Server 2008 R2. Downgrading to 1.22 did not solve the issue. [Cppcheck] Starting the cppcheck analysis. ERROR: Build step failed with exception java.lang.NullPointerException at org.jenkinsci.plugins.cppcheck.CppcheckPublisher.perform(CppcheckPublisher.java:436) at hudson.tasks.BuildStepMonitor$1.perform(BuildStepMonitor.java:20) at hudson.model.AbstractBuild$AbstractBuildExecution.perform(AbstractBuild.java:744) at hudson.model.AbstractBuild$AbstractBuildExecution.performAllBuildSteps(AbstractBuild.java:690) at hudson.model.Build$BuildExecution.post2(Build.java:186) at hudson.model.AbstractBuild$AbstractBuildExecution.post(AbstractBuild.java:635) at hudson.model.Run.execute(Run.java:1823) at hudson.model.FreeStyleBuild.run(FreeStyleBuild.java:43) at hudson.model.ResourceController.execute(ResourceController.java:97) at hudson.model.Executor.run(Executor.java:429) Build step 'Publish Cppcheck results' marked build as failure The last "working" build 2 days ago showed: [Cppcheck] Starting the cppcheck analysis. [Cppcheck] Processing 1 files with the pattern 'cppcheck.xml '. [Cppcheck] Not changing build status, since no threshold has been exceeded. [Cppcheck] Ending the cppcheck analysis. I updated from Jenkins 2.107.x yesterday. It seems to fit the time, when cppcheck started to NPE.

          Downgrading to 1.22 did fix the problem for me tough!

          Ing. Christoph Obexer added a comment - Downgrading to 1.22 did fix the problem for me tough!

          I had the same problem. It seems that upgrading from 1.22 to 1.23 looses some configuration, in fact the field `Cppcheck report XMLs` was empty after upgrade.  Reentering and saving the configuration did the job and now 1.23 works fine for me

          felix schwitzer added a comment - I had the same problem. It seems that upgrading from 1.22 to 1.23 looses some configuration, in fact the field `Cppcheck report XMLs` was empty after upgrade.  Reentering and saving the configuration did the job and now 1.23 works fine for me

          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)

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

              Created:
              Updated:
              Resolved: