Uploaded image for project: 'SonarCFamily'
  1. SonarCFamily
  2. CPP-2395

gcov sensor: Fix regression leading to "MalformedInputException: Input length = 1"

    Details

    • Type: Bug
    • Status: Closed
    • Priority: Major
    • Resolution: Fixed
    • Affects Version/s: 6.6
    • Fix Version/s: 6.7
    • Component/s: None
    • Labels:
      None

      Description

      When source files do not match filesystem encoding gcov sensor fail to read their content with the following exception:

      Caused by: java.nio.charset.MalformedInputException: Input length = 1
      	at java.nio.charset.CoderResult.throwException(CoderResult.java:281)
      	at sun.nio.cs.StreamDecoder.implRead(StreamDecoder.java:339)
      	at sun.nio.cs.StreamDecoder.read(StreamDecoder.java:178)
      	at java.io.InputStreamReader.read(InputStreamReader.java:184)
      	at java.io.BufferedReader.fill(BufferedReader.java:161)
      	at java.io.BufferedReader.readLine(BufferedReader.java:324)
      	at java.io.BufferedReader.readLine(BufferedReader.java:389)
      	at java.nio.file.Files.readAllLines(Files.java:3205)
      	at com.sonar.cpp.plugin.gcov.GcovParser.<init>(GcovParser.java:55)
      

      Workaround: change the encoding of the source file related to the failing report to filesystem encoding, likely to be UTF-8.

        Attachments

          Issue Links

            Activity

              People

              • Assignee:
                massimo.paladin Massimo PALADIN
                Reporter:
                massimo.paladin Massimo PALADIN
              • Votes:
                0 Vote for this issue
                Watchers:
                2 Start watching this issue

                Dates

                • Due:
                  Created:
                  Updated:
                  Resolved: