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

[cppccheck] Parsing throws exceptions. javax.xml.bind.UnmarshalException

    XMLWordPrintable

    Details

    • Type: Bug
    • Status: Closed (View Workflow)
    • Priority: Major
    • Resolution: Cannot Reproduce
    • Component/s: cppcheck-plugin
    • Labels:
      None
    • Environment:
      Windows XP, Jenkins 1.498, cppcheck plug-in 1.13, Cppcheck 1.57
    • Similar Issues:

      Description

      If I use --enable=style or --enable=all I get this error:

      [Cppcheck] Starting the cppcheck analysis.
      [Cppcheck] Processing 1 files with the pattern 'cppcheck-result2.xml'.
      [Cppcheck] Parsing throws exceptions. javax.xml.bind.UnmarshalException

      • with linked exception:
        [com.sun.org.apache.xerces.internal.impl.io.MalformedByteSequenceException: Invalid byte 2 of 3-byte UTF-8 sequence.]
        Build step 'Publish Cppcheck results' changed build result to FAILURE
        Build step 'Publish Cppcheck results' marked build as failure

      how I run cppcheck:

      cppcheck --enable=style --xml-version=2 %workspace%\Main\ 2> cppcheck-result2.xml

      this works fine: cppcheck --xml-version=2 %workspace%\Main\ 2> cppcheck-result2.xml

        Attachments

          Activity

          Hide
          rexuekonglong ying zhang added a comment -

          I have got the same problem , which is 2657KB .But the other one 356KB is ok.
          I have compare them, nothing is special.
          ╮(╯▽╰)╭ I have no idea, maybe just out of memory?

          ps: how I run cppcheck: cppcheck --enable=all -f -q -v --xml . 2>cppcheck.xml

          Show
          rexuekonglong ying zhang added a comment - I have got the same problem , which is 2657KB .But the other one 356KB is ok. I have compare them, nothing is special. ╮(╯▽╰)╭ I have no idea, maybe just out of memory? ps: how I run cppcheck: cppcheck --enable=all -f -q -v --xml . 2>cppcheck.xml
          Hide
          mixalturek Michal Turek added a comment -

          Hi, this looks more like issue of Cppcheck tool itself and not Cppcheck Plugin. The tool outputs a XML file and specifies encoding="UTF-8" so it is responsible for the content to be indeed utf-8. The plugin loads the file header, sees utf-8 encoding and tries to load the file with it. But there is probably a broken byte sequence that can't occur in utf-8 so it will throw MalformedByteSequenceException exception.

          If you use --enable=style or --enable=all, the tool will probably find more issues and one of the additional one contains the broken character. Can you attach your report to be able to verify this theory, please?

          I have just tried to generate all possible issue types that can occur in the output but the plugin read the report successfully. I used Cppcheck 1.61 and 1.63 (the latest one), plugin 1.15-SNAPSHOT, Debian GNU/Linux.

          cppcheck --xml --xml-version=2 --errorlist > ../all_1.63.xml
          
          Show
          mixalturek Michal Turek added a comment - Hi, this looks more like issue of Cppcheck tool itself and not Cppcheck Plugin. The tool outputs a XML file and specifies encoding="UTF-8" so it is responsible for the content to be indeed utf-8. The plugin loads the file header, sees utf-8 encoding and tries to load the file with it. But there is probably a broken byte sequence that can't occur in utf-8 so it will throw MalformedByteSequenceException exception. If you use --enable=style or --enable=all, the tool will probably find more issues and one of the additional one contains the broken character. Can you attach your report to be able to verify this theory, please? I have just tried to generate all possible issue types that can occur in the output but the plugin read the report successfully. I used Cppcheck 1.61 and 1.63 (the latest one), plugin 1.15-SNAPSHOT, Debian GNU/Linux. cppcheck --xml --xml-version=2 --errorlist > ../all_1.63.xml
          Hide
          mixalturek Michal Turek added a comment -

          Cannot reproduce, no answer, please reopen if you can provide additional information.

          Show
          mixalturek Michal Turek added a comment - Cannot reproduce, no answer, please reopen if you can provide additional information.

            People

            • Assignee:
              mixalturek Michal Turek
              Reporter:
              hsnnn Eric Brito
            • Votes:
              0 Vote for this issue
              Watchers:
              3 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved: