Uploaded image for project: 'Jenkins'
  1. Jenkins
  2. JENKINS-52854

NPE with Cppcheck plugin 1.23

    XMLWordPrintable

    Details

    • Type: Bug
    • Status: Resolved (View Workflow)
    • Priority: Critical
    • Resolution: Fixed
    • Component/s: cppcheck-plugin
    • Labels:
      None
    • Environment:
      Jenkins 2.135
    • Similar Issues:

      Description

      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
      

        Attachments

          Activity

          Hide
          cobexer 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)

          Show
          cobexer 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)
          Hide
          matttbe Matthieu Baerts added a comment - - edited

          Christoph Obexer: thank you for the links!

          Marco Steffan: 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.

          Show
          matttbe Matthieu Baerts added a comment - - edited Christoph Obexer : thank you for the links! Marco Steffan : 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.
          Hide
          matttbe 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 Marco Steffan): https://ci.jenkins.io/blue/organizations/jenkins/Plugins%2Fcppcheck-plugin/detail/PR-44/2/artifacts/

          Show
          matttbe 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 Marco Steffan ): https://ci.jenkins.io/blue/organizations/jenkins/Plugins%2Fcppcheck-plugin/detail/PR-44/2/artifacts/
          Hide
          matttbe Matthieu Baerts added a comment -

          Niels Kristian Jensen: 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)

          Show
          matttbe Matthieu Baerts added a comment - Niels Kristian Jensen : 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)
          Hide
          kmleinen Kyle Leinen added a comment -

          Marco Steffan 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.

          Show
          kmleinen Kyle Leinen added a comment - Marco Steffan 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.

            People

            • Assignee:
              marcosteffan Marco Steffan
              Reporter:
              cobexer Christoph Obexer
            • Votes:
              9 Vote for this issue
              Watchers:
              12 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved: