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

PC-Lint summary warning leads to java.nio.file.InvalidPathException

    • Icon: Bug Bug
    • Resolution: Fixed
    • Icon: Critical Critical
    • core, (1)
      warnings-plugin
    • Jenkins 2.53 (Windows Server 2008 x64)
      analysis-core 1.84
      token-macro 2.1
      warnings 4.60

      Hi!

      Since the latest update to token-macro 2.1 (But I'm not sure that this update causes this issue), the PC-lint summary warning 
      (0): Warning 459: Function 'Gmc::CAcpChannel::TcFunctCyclicNetworkData(const void *)' whose address was taken has an unprotected access to variable 'Gmc::CAcpChannel::Channels'
      ; I.e, without file-name and line-number 0, causes an exception afterwards:

      [WARNINGS] Plug-in Result: Unstable - <a href="warningsResult">59 warnings</a> exceed the threshold of 0 by 59
      ERROR: Build step failed with exception
      java.nio.file.InvalidPathException: Illegal char <:> at index 3: Gmc::CAcpChannel::TcFunctCyclicNetworkData(const void *)
      {{ at sun.nio.fs.WindowsPathParser.normalize(WindowsPathParser.java:182)}}
      {{ at sun.nio.fs.WindowsPathParser.parse(WindowsPathParser.java:153)}}
      {{ at sun.nio.fs.WindowsPathParser.parse(WindowsPathParser.java:77)}}
      {{ at sun.nio.fs.WindowsPath.parse(WindowsPath.java:94)}}
      {{ at sun.nio.fs.WindowsFileSystem.getPath(WindowsFileSystem.java:255)}}
      {{ at java.io.File.toPath(File.java:2234)}}
      {{ at hudson.FilePath$41.invoke(FilePath.java:2011)}}
      {{ at hudson.FilePath$41.invoke(FilePath.java:2006)}}
      {{ at hudson.FilePath.act(FilePath.java:997)}}
      {{ at hudson.FilePath.act(FilePath.java:975)}}
      {{ at hudson.FilePath.copyTo(FilePath.java:2006)}}
      {{ at hudson.FilePath.copyTo(FilePath.java:1982)}}
      {{ at hudson.plugins.analysis.util.Files.copyFilesWithAnnotationsToBuildFolder(Files.java:80)}}
      {{ at hudson.plugins.analysis.core.HealthAwareRecorder.copyFilesWithAnnotationsToBuildFolder(HealthAwareRecorder.java:348)}}
      {{ at hudson.plugins.analysis.core.HealthAwarePublisher.perform(HealthAwarePublisher.java:89)}}
      {{ at hudson.plugins.analysis.core.HealthAwareRecorder.perform(HealthAwareRecorder.java:295)}}
      {{ at hudson.tasks.BuildStepCompatibilityLayer.perform(BuildStepCompatibilityLayer.java:81)}}
      {{ at hudson.tasks.BuildStepMonitor$1.perform(BuildStepMonitor.java:20)}}
      {{ at hudson.model.AbstractBuild$AbstractBuildExecution.perform(AbstractBuild.java:779)}}
      {{ at hudson.model.AbstractBuild$AbstractBuildExecution.performAllBuildSteps(AbstractBuild.java:720)}}
      {{ at hudson.model.Build$BuildExecution.post2(Build.java:186)}}
      {{ at hudson.model.AbstractBuild$AbstractBuildExecution.post(AbstractBuild.java:665)}}
      {{ at hudson.model.Run.execute(Run.java:1760)}}
      {{ at hudson.model.FreeStyleBuild.run(FreeStyleBuild.java:43)}}
      {{ at hudson.model.ResourceController.execute(ResourceController.java:97)}}
      {{ at hudson.model.Executor.run(Executor.java:405)}}
      Build step 'Scan for compiler warnings' changed build result to UNSTABLE

       

      A few days before, the result of the same warning-output was "only" a (malformed) entry:

      [Gmc::CAcpChannel::TcFunctCyclicNetworkData(const void *):0], PC-Lint, Priority: Normal
      Function 'Gmc::CAcpChannel::TcFunctCyclicNetworkData(const void *)' whose address was taken has an unprotected access to variable 'Gmc::CAcpChannel::Channels'

      , but no exception back-trace.

       

      Best regards from Salzburg,
      Markus

          [JENKINS-43531] PC-Lint summary warning leads to java.nio.file.InvalidPathException

          Ulli Hafner added a comment -

          Can you please check if this works in the latest LTS release? Maybe this is related to a core change in FilePath.

          Ulli Hafner added a comment - Can you please check if this works in the latest LTS release? Maybe this is related to a core change in FilePath.

          Ulli Hafner added a comment -

          Stephen, can you please have a look if this is related to commit f0cd7ae

          Ulli Hafner added a comment - Stephen, can you please have a look if this is related to commit f0cd7ae

          I have filed https://github.com/jenkinsci/jenkins/pull/2849 to prevent this type of issue affecting other plugins, but realistically plugins should be able to handle an InvalidPathException if they are likely to trigger one, so analysis-core should be fixing irrespective of a core change

          Stephen Connolly added a comment - I have filed  https://github.com/jenkinsci/jenkins/pull/2849 to prevent this type of issue affecting other plugins, but realistically plugins should be able to handle an InvalidPathException  if they are likely to trigger one, so analysis-core should be fixing irrespective of a core change

          Code changed in jenkins
          User: Stephen Connolly
          Path:
          cli/src/main/java/hudson/cli/PrivateKeyProvider.java
          core/src/main/java/hudson/ClassicPluginStrategy.java
          core/src/main/java/hudson/FilePath.java
          core/src/main/java/hudson/FileSystemProvisioner.java
          core/src/main/java/hudson/Main.java
          core/src/main/java/hudson/PluginWrapper.java
          core/src/main/java/hudson/Util.java
          core/src/main/java/hudson/WebAppMain.java
          core/src/main/java/hudson/XmlFile.java
          core/src/main/java/hudson/lifecycle/WindowsInstallerLink.java
          core/src/main/java/hudson/model/FileParameterValue.java
          core/src/main/java/hudson/model/Queue.java
          core/src/main/java/hudson/model/Run.java
          core/src/main/java/hudson/model/UpdateCenter.java
          core/src/main/java/hudson/tools/JDKInstaller.java
          core/src/main/java/hudson/util/AtomicFileWriter.java
          core/src/main/java/hudson/util/CompressedFile.java
          core/src/main/java/hudson/util/IOUtils.java
          core/src/main/java/hudson/util/SecretRewriter.java
          core/src/main/java/hudson/util/StreamTaskListener.java
          core/src/main/java/hudson/util/TextFile.java
          core/src/main/java/hudson/util/io/ReopenableFileOutputStream.java
          core/src/main/java/hudson/util/io/RewindableFileOutputStream.java
          core/src/main/java/hudson/util/io/TarArchiver.java
          core/src/main/java/hudson/util/io/ZipArchiver.java
          core/src/main/java/jenkins/diagnosis/HsErrPidList.java
          core/src/main/java/jenkins/security/DefaultConfidentialStore.java
          core/src/main/java/jenkins/util/JSONSignatureValidator.java
          core/src/main/java/jenkins/util/VirtualFile.java
          core/src/main/java/jenkins/util/io/FileBoolean.java
          core/src/main/java/jenkins/util/xml/XMLUtils.java
          http://jenkins-ci.org/commit/jenkins/3871d7778e30828d7c69076e7536dd7e106eb96a
          Log:
          JENKINS-43531 Plugins may not be expecting InvalidPathException

          • Plugins should really be expecting it, but as historically they have not, may as well convert to IOE for them

          SCM/JIRA link daemon added a comment - Code changed in jenkins User: Stephen Connolly Path: cli/src/main/java/hudson/cli/PrivateKeyProvider.java core/src/main/java/hudson/ClassicPluginStrategy.java core/src/main/java/hudson/FilePath.java core/src/main/java/hudson/FileSystemProvisioner.java core/src/main/java/hudson/Main.java core/src/main/java/hudson/PluginWrapper.java core/src/main/java/hudson/Util.java core/src/main/java/hudson/WebAppMain.java core/src/main/java/hudson/XmlFile.java core/src/main/java/hudson/lifecycle/WindowsInstallerLink.java core/src/main/java/hudson/model/FileParameterValue.java core/src/main/java/hudson/model/Queue.java core/src/main/java/hudson/model/Run.java core/src/main/java/hudson/model/UpdateCenter.java core/src/main/java/hudson/tools/JDKInstaller.java core/src/main/java/hudson/util/AtomicFileWriter.java core/src/main/java/hudson/util/CompressedFile.java core/src/main/java/hudson/util/IOUtils.java core/src/main/java/hudson/util/SecretRewriter.java core/src/main/java/hudson/util/StreamTaskListener.java core/src/main/java/hudson/util/TextFile.java core/src/main/java/hudson/util/io/ReopenableFileOutputStream.java core/src/main/java/hudson/util/io/RewindableFileOutputStream.java core/src/main/java/hudson/util/io/TarArchiver.java core/src/main/java/hudson/util/io/ZipArchiver.java core/src/main/java/jenkins/diagnosis/HsErrPidList.java core/src/main/java/jenkins/security/DefaultConfidentialStore.java core/src/main/java/jenkins/util/JSONSignatureValidator.java core/src/main/java/jenkins/util/VirtualFile.java core/src/main/java/jenkins/util/io/FileBoolean.java core/src/main/java/jenkins/util/xml/XMLUtils.java http://jenkins-ci.org/commit/jenkins/3871d7778e30828d7c69076e7536dd7e106eb96a Log: JENKINS-43531 Plugins may not be expecting InvalidPathException Plugins should really be expecting it, but as historically they have not, may as well convert to IOE for them

          Code changed in jenkins
          User: Oleg Nenashev
          Path:
          cli/src/main/java/hudson/cli/PrivateKeyProvider.java
          core/src/main/java/hudson/ClassicPluginStrategy.java
          core/src/main/java/hudson/FilePath.java
          core/src/main/java/hudson/FileSystemProvisioner.java
          core/src/main/java/hudson/Main.java
          core/src/main/java/hudson/PluginWrapper.java
          core/src/main/java/hudson/Util.java
          core/src/main/java/hudson/WebAppMain.java
          core/src/main/java/hudson/XmlFile.java
          core/src/main/java/hudson/lifecycle/WindowsInstallerLink.java
          core/src/main/java/hudson/model/FileParameterValue.java
          core/src/main/java/hudson/model/Queue.java
          core/src/main/java/hudson/model/Run.java
          core/src/main/java/hudson/model/UpdateCenter.java
          core/src/main/java/hudson/tools/JDKInstaller.java
          core/src/main/java/hudson/util/AtomicFileWriter.java
          core/src/main/java/hudson/util/CompressedFile.java
          core/src/main/java/hudson/util/IOUtils.java
          core/src/main/java/hudson/util/SecretRewriter.java
          core/src/main/java/hudson/util/StreamTaskListener.java
          core/src/main/java/hudson/util/TextFile.java
          core/src/main/java/hudson/util/io/ReopenableFileOutputStream.java
          core/src/main/java/hudson/util/io/RewindableFileOutputStream.java
          core/src/main/java/hudson/util/io/TarArchiver.java
          core/src/main/java/hudson/util/io/ZipArchiver.java
          core/src/main/java/jenkins/diagnosis/HsErrPidList.java
          core/src/main/java/jenkins/security/DefaultConfidentialStore.java
          core/src/main/java/jenkins/util/JSONSignatureValidator.java
          core/src/main/java/jenkins/util/VirtualFile.java
          core/src/main/java/jenkins/util/io/FileBoolean.java
          core/src/main/java/jenkins/util/xml/XMLUtils.java
          http://jenkins-ci.org/commit/jenkins/d1d72ca91726ba92627b0bb606bd046a23c25fd8
          Log:
          Merge pull request #2849 from stephenc/jenkins-43531

          JENKINS-43531 Plugins may not be expecting InvalidPathException

          Compare: https://github.com/jenkinsci/jenkins/compare/77a9f026f88d...d1d72ca91726

          SCM/JIRA link daemon added a comment - Code changed in jenkins User: Oleg Nenashev Path: cli/src/main/java/hudson/cli/PrivateKeyProvider.java core/src/main/java/hudson/ClassicPluginStrategy.java core/src/main/java/hudson/FilePath.java core/src/main/java/hudson/FileSystemProvisioner.java core/src/main/java/hudson/Main.java core/src/main/java/hudson/PluginWrapper.java core/src/main/java/hudson/Util.java core/src/main/java/hudson/WebAppMain.java core/src/main/java/hudson/XmlFile.java core/src/main/java/hudson/lifecycle/WindowsInstallerLink.java core/src/main/java/hudson/model/FileParameterValue.java core/src/main/java/hudson/model/Queue.java core/src/main/java/hudson/model/Run.java core/src/main/java/hudson/model/UpdateCenter.java core/src/main/java/hudson/tools/JDKInstaller.java core/src/main/java/hudson/util/AtomicFileWriter.java core/src/main/java/hudson/util/CompressedFile.java core/src/main/java/hudson/util/IOUtils.java core/src/main/java/hudson/util/SecretRewriter.java core/src/main/java/hudson/util/StreamTaskListener.java core/src/main/java/hudson/util/TextFile.java core/src/main/java/hudson/util/io/ReopenableFileOutputStream.java core/src/main/java/hudson/util/io/RewindableFileOutputStream.java core/src/main/java/hudson/util/io/TarArchiver.java core/src/main/java/hudson/util/io/ZipArchiver.java core/src/main/java/jenkins/diagnosis/HsErrPidList.java core/src/main/java/jenkins/security/DefaultConfidentialStore.java core/src/main/java/jenkins/util/JSONSignatureValidator.java core/src/main/java/jenkins/util/VirtualFile.java core/src/main/java/jenkins/util/io/FileBoolean.java core/src/main/java/jenkins/util/xml/XMLUtils.java http://jenkins-ci.org/commit/jenkins/d1d72ca91726ba92627b0bb606bd046a23c25fd8 Log: Merge pull request #2849 from stephenc/jenkins-43531 JENKINS-43531 Plugins may not be expecting InvalidPathException Compare: https://github.com/jenkinsci/jenkins/compare/77a9f026f88d...d1d72ca91726

          Oleg Nenashev added a comment -

          The fix has been released in Jenkins 2.56.
          I doubt anything else is required on the plugin side

          Oleg Nenashev added a comment - The fix has been released in Jenkins 2.56. I doubt anything else is required on the plugin side

          Dave Taddei added a comment -

          Am seeing this in Jenkins 2.56, warnings plugin 4.62. 

          MSBuild log parsing is throwing this exception as a result of a namespace I believe.

          2017-04-14 13:47:53.830 java.nio.file.InvalidPathException: Illegal char <:> at index 101: E:\Jenkins\workspace\xxxxxx_Windows\cc765783\module\Src\DataAssociation\CAssociation.cpp(76): warning C4996: 'xxxx::Logging::CLoggingData': This class has been moved. Use the the include xxxx\Logging\Logging.hE:\Jenkins\workspace\xxxxxx_Windows\cc765783\module\Src\DataAssociation\CAssociationMaxDifference.cpp

          Dave Taddei added a comment - Am seeing this in Jenkins 2.56, warnings plugin 4.62.  MSBuild log parsing is throwing this exception as a result of a namespace I believe. 2017-04-14 13:47:53.830 java.nio.file.InvalidPathException: Illegal char <:> at index 101: E:\Jenkins\workspace\xxxxxx_Windows\cc765783\module\Src\DataAssociation\CAssociation.cpp(76): warning C4996: 'xxxx::Logging::CLoggingData': This class has been moved. Use the the include xxxx\Logging\Logging.hE:\Jenkins\workspace\xxxxxx_Windows\cc765783\module\Src\DataAssociation\CAssociationMaxDifference.cpp

          Ulli Hafner added a comment -

          Is this still valid, or did the fix in Jenkins work?

          Ulli Hafner added a comment - Is this still valid, or did the fix in Jenkins work?

          Ulli Hafner added a comment -

          Just tried with 2.60.1, everything ok.

          Started by user Ulli Hafner
          [EnvInject] - Loading node environment variables.
          Building in workspace /Users/hafner/Development/jenkins/workspace/JENKINS-43595
          [JENKINS-43595] $ /bin/sh -xe /var/folders/yj/bbp1px3x0wnfqd56p4hnv2b00000gn/T/jenkins504031408983210722.sh
          + echo 'File\?>,<%71.c(435): warning C4311: '\''type cast'\'': pointer truncation from '\''void *'\'' to '\''unsigned int'\'' [C:\jenkins\workspace\src\project.vcxproj]'
          File\?>,<%71.c(435): warning C4311: 'type cast': pointer truncation from 'void *' to 'unsigned int' [C:\jenkins\workspace\src\project.vcxproj]
          [WARNINGS] Parsing warnings in console log with parser MSBuild
          [WARNINGS] Computing warning deltas based on reference build #1
          Finished: SUCCESS
          

          Ulli Hafner added a comment - Just tried with 2.60.1, everything ok. Started by user Ulli Hafner [EnvInject] - Loading node environment variables. Building in workspace /Users/hafner/Development/jenkins/workspace/JENKINS-43595 [JENKINS-43595] $ /bin/sh -xe /var/folders/yj/bbp1px3x0wnfqd56p4hnv2b00000gn/T/jenkins504031408983210722.sh + echo 'File\?>,<%71.c(435): warning C4311: '\''type cast'\'': pointer truncation from '\''void *'\'' to '\''unsigned int'\'' [C:\jenkins\workspace\src\project.vcxproj]' File\?>,<%71.c(435): warning C4311: 'type cast': pointer truncation from 'void *' to 'unsigned int' [C:\jenkins\workspace\src\project.vcxproj] [WARNINGS] Parsing warnings in console log with parser MSBuild [WARNINGS] Computing warning deltas based on reference build #1 Finished: SUCCESS

            drulli Ulli Hafner
            gmc_devel GMC Software Development B&R Corporate
            Votes:
            3 Vote for this issue
            Watchers:
            8 Start watching this issue

              Created:
              Updated:
              Resolved: