leemoa / cppcheclipse

Automatically exported from code.google.com/p/cppcheclipse
0 stars 0 forks source link

NullPointerException running cppcheck #54

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
What steps will reproduce the problem?
1. Right click on project
2. Select cppcheck->run cppcheck

Note that my project is generated using Cmake and the Eclipse generator. I get 
the following errors in my Error Log:

Error reading filename of appendage
java.io.EOFException
    at java.io.ObjectInputStream$PeekInputStream.readFully(Unknown Source)
    at java.io.ObjectInputStream$BlockDataInputStream.readShort(Unknown Source)
    at java.io.ObjectInputStream.readStreamHeader(Unknown Source)
    at java.io.ObjectInputStream.<init>(Unknown Source)
    at com.googlecode.cppcheclipse.core.utils.SerializeHelper.fromString(SerializeHelper.java:17)
    at com.googlecode.cppcheclipse.core.Appendages.load(Appendages.java:33)
    at com.googlecode.cppcheclipse.core.Appendages.<init>(Appendages.java:25)
    at com.googlecode.cppcheclipse.core.command.CppcheckCommand.<init>(CppcheckCommand.java:189)
    at com.googlecode.cppcheclipse.core.Checker.<init>(Checker.java:80)
    at com.googlecode.cppcheclipse.ui.Builder$ResourceVisitor.initChecker(Builder.java:161)
    at com.googlecode.cppcheclipse.ui.Builder$ResourceVisitor.processFile(Builder.java:196)
    at com.googlecode.cppcheclipse.ui.Builder$ResourceVisitor.visit(Builder.java:121)
    at org.eclipse.core.internal.resources.Resource$2.visit(Resource.java:126)
    at org.eclipse.core.internal.resources.Resource$1.visitElement(Resource.java:85)
    at org.eclipse.core.internal.watson.ElementTreeIterator.doIteration(ElementTreeIterator.java:82)
    at org.eclipse.core.internal.watson.ElementTreeIterator.doIteration(ElementTreeIterator.java:86)
    at org.eclipse.core.internal.watson.ElementTreeIterator.doIteration(ElementTreeIterator.java:86)
    at org.eclipse.core.internal.watson.ElementTreeIterator.doIteration(ElementTreeIterator.java:86)
    at org.eclipse.core.internal.watson.ElementTreeIterator.doIteration(ElementTreeIterator.java:86)
    at org.eclipse.core.internal.watson.ElementTreeIterator.iterate(ElementTreeIterator.java:127)
    at org.eclipse.core.internal.resources.Resource.accept(Resource.java:95)
    at org.eclipse.core.internal.resources.Resource.accept(Resource.java:52)
    at org.eclipse.core.internal.resources.Resource.accept(Resource.java:124)
    at org.eclipse.core.internal.resources.Resource.accept(Resource.java:108)
    at com.googlecode.cppcheclipse.ui.Builder.processResource(Builder.java:303)
    at com.googlecode.cppcheclipse.ui.commands.RunCodeAnalysis$RunCodeAnalysisJob.runResource(RunCodeAnalysis.java:27)
    at com.googlecode.cppcheclipse.ui.commands.ResourceSelectionJob.run(ResourceSelectionJob.java:44)
    at org.eclipse.core.internal.jobs.Worker.run(Worker.java:53)

Could not run cppcheck
        <truncated to remove private information>
    at com.googlecode.cppcheclipse.core.command.ProcessExecutionException.newException(ProcessExecutionException.java:14)
    at com.googlecode.cppcheclipse.core.command.AbstractCppcheckCommand.waitForExit(AbstractCppcheckCommand.java:252)
    at com.googlecode.cppcheclipse.core.command.CppcheckCommand.run(CppcheckCommand.java:253)
    at com.googlecode.cppcheclipse.core.Checker.run(Checker.java:108)
    at com.googlecode.cppcheclipse.ui.Builder$ResourceVisitor.runChecker(Builder.java:132)
    at com.googlecode.cppcheclipse.ui.Builder.processResource(Builder.java:306)
    at com.googlecode.cppcheclipse.ui.commands.RunCodeAnalysis$RunCodeAnalysisJob.runResource(RunCodeAnalysis.java:27)
    at com.googlecode.cppcheclipse.ui.commands.ResourceSelectionJob.run(ResourceSelectionJob.java:44)
    at org.eclipse.core.internal.jobs.Worker.run(Worker.java:53)
Caused by: org.apache.commons.exec.ExecuteException: Execution failed (Exit 
value: -559038737. Caused by java.io.IOException: Cannot run program 
"C:\Program Files (x86)\Cppcheck\cppcheck.exe" (in directory "D:\proj\"): 
CreateProcess error=206, The filename or extension is too long)
    at org.apache.commons.exec.DefaultExecutor$1.run(DefaultExecutor.java:193)

Error checking src
org.eclipse.core.runtime.CoreException: Could not run cppcheck
    at com.googlecode.cppcheclipse.ui.Builder$ResourceVisitor.runChecker(Builder.java:139)
    at com.googlecode.cppcheclipse.ui.Builder.processResource(Builder.java:306)
    at com.googlecode.cppcheclipse.ui.commands.RunCodeAnalysis$RunCodeAnalysisJob.runResource(RunCodeAnalysis.java:27)
    at com.googlecode.cppcheclipse.ui.commands.ResourceSelectionJob.run(ResourceSelectionJob.java:44)
    at org.eclipse.core.internal.jobs.Worker.run(Worker.java:53)

An internal error occurred during: "Running cppcheck".
java.lang.NullPointerException
    at com.googlecode.cppcheclipse.ui.Console.show(Console.java:116)
    at com.googlecode.cppcheclipse.ui.commands.RunCodeAnalysis$RunCodeAnalysisJob.runResource(RunCodeAnalysis.java:34)
    at com.googlecode.cppcheclipse.ui.commands.ResourceSelectionJob.run(ResourceSelectionJob.java:44)
    at org.eclipse.core.internal.jobs.Worker.run(Worker.java:53)

What is the expected output? What do you see instead? Please provide output
of the console view of cppcheclipse as well as the Eclipse error log.

What version of the cppcheclipse, cppcheck, Eclipse and Java are you using?
On what operating system?
- Windows
- cppcheclipse 0.9.9 
- cppcheck 1.56
- Java 1.7.0_09
- Eclipse Juno

Original issue reported on code.google.com by jonathan...@gmail.com on 9 Jan 2013 at 10:43

GoogleCodeExporter commented 9 years ago
I have excactly the same problem but with:

- Ubuntu
- cppcheclipse 0.9.9
- cppcheck 1.52
- Java 1.6
- Eclipse Juno

Original comment by dpcf...@gmail.com on 5 Nov 2013 at 9:48

GoogleCodeExporter commented 9 years ago
This issue was closed by revision r291.

Original comment by konra...@gmx.de on 21 Dec 2013 at 6:26

GoogleCodeExporter commented 9 years ago

Original comment by konra...@gmx.de on 21 Dec 2013 at 7:23

GoogleCodeExporter commented 9 years ago

Original comment by konra...@gmx.de on 21 Dec 2013 at 7:23