Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Could not run cppcheck; Output Stream is closed #44

Closed
GoogleCodeExporter opened this issue Nov 15, 2015 · 10 comments
Closed

Could not run cppcheck; Output Stream is closed #44

GoogleCodeExporter opened this issue Nov 15, 2015 · 10 comments

Comments

@GoogleCodeExporter
Copy link

What steps will reproduce the problem?
1. Set Cpp Check to run on build of LibProject
2. Build another project that depends on LibProject

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.

There is no console output, there is an error in a dialog box:
Errors occurred during the build.
   Errors running builder 'cppcheck Project Builder' on project 'TestProject'.
      Could not run cppcheck
      Output Stream is closed
   Could not run cppcheck
   Output Stream is closed

I tried enabling --debug on cppcheck and the build hangs.

What version of the cppcheclipse, cppcheck, Eclipse and Java are you using?
cppcheclipse: 0.9.7.2001040922
Eclipse: Indigo
Java: OpenJDK Runtime Environment 1.6.0_23-b23
CppCheck 1.52


On what operating system?
Ubuntu 11.11

Please provide any additional information below.

Right clicking the project and running cppcheck works fine.

It seems to be a timing issue with access to the console during building.

Original issue reported on code.google.com by benpop...@gmail.com on 3 Jan 2012 at 3:46

@GoogleCodeExporter
Copy link
Author

[deleted comment]

1 similar comment
@GoogleCodeExporter
Copy link
Author

[deleted comment]

@GoogleCodeExporter
Copy link
Author

Actually, what it seems to be doing is running CppCheck over one file in the 
project, not all 4 of them (like it does when I call it from the menu), then 
trying to run CppCheck over that same file again a bit later, and it's this 
second run that is failing with the closed stream.

I will cautiously admit that the one file it runs over is a *.cc file, whilst 
the others are *.cpp.  Perhaps that is the cause, as other projects do seem to 
be working correctly.

Well, I renamed the .cc file to .cpp and now I cannot get any output from 
CppCheck for any project during a build.

This is on a clean installation of Eclipse 4.1.

Original comment by benpop...@gmail.com on 4 Jan 2012 at 10:33

@GoogleCodeExporter
Copy link
Author

I once in a while got this error as well. Unfortunately I have no reproducable 
use case. It definitely has nothing to do with extensions, I assume some kind 
of race condition.

Original comment by konra...@gmx.de on 10 Sep 2012 at 8:25

@GoogleCodeExporter
Copy link
Author

I have the same problem, sometimes it workes, sometimes not.
Eclipse Juno + CDT Version: 8.1.2.201302132326
cppcheclipse: 0.9.9

Original comment by bernhard...@gmail.com on 18 Apr 2013 at 12:09

@GoogleCodeExporter
Copy link
Author

Same error here.

Installed plugins:

Autotools support for 
CDT 3.0.1.201302132326  org.eclipse.cdt.autotools.feature.group Eclipse CDT
  C/C++ Debugger Services Framework (DSF) Examples  2.1.0.201302132326  org.eclipse.cdt.examples.dsf.feature.group  Eclipse CDT
  C/C++ Development Platform    8.1.2.201302132326  org.eclipse.cdt.platform.feature.group  Eclipse CDT
  C/C++ Development Tools   8.1.2.201302132326  org.eclipse.cdt.feature.group   Eclipse CDT
  C/C++ DSF GDB Debugger Integration    4.0.1.201302132326  org.eclipse.cdt.gnu.dsf.feature.group   Eclipse CDT
  C/C++ GCC Cross Compiler Support  1.1.0.201302132326  org.eclipse.cdt.build.crossgcc.feature.group    Eclipse CDT
  C/C++ GDB Hardware Debugging  7.0.0.201302132326  org.eclipse.cdt.debug.gdbjtag.feature.group Eclipse CDT
  C/C++ GNU Toolchain Build Support 8.1.1.201302132326  org.eclipse.cdt.gnu.build.feature.group Eclipse CDT
  C/C++ GNU Toolchain Debug Support 7.1.1.201302132326  org.eclipse.cdt.gnu.debug.feature.group Eclipse CDT
  C/C++ Library API Documentation Hover Help    1.0.0.201302051708  org.eclipse.linuxtools.cdt.libhover.feature.feature.group   Eclipse Linux Tools
  C/C++ Memory View Enhancements    2.2.0.201302132326  org.eclipse.cdt.debug.ui.memory.feature.group   Eclipse CDT
  C/C++ Multicore Visualizer    1.0.0.201302132326  org.eclipse.cdt.gnu.multicorevisualizer.feature.group   Eclipse CDT
  C/C++ Unit Testing Support    7.0.0.201302132326  org.eclipse.cdt.testsrunner.feature.feature.group   Eclipse CDT
  CDT Common GDB Support    7.0.0.201302132326  org.eclipse.cdt.gdb.feature.group   Eclipse CDT
  CDT Visual C++ Support    1.0.0.201302132326  org.eclipse.cdt.msw.feature.group   Eclipse CDT
  CDT Visualizer Framework  1.0.0.201302132326  org.eclipse.cdt.visualizer.feature.group    Eclipse CDT
  cppcheclipse  0.9.9   com.googlecode.cppcheclipse.feature.feature.group   Konrad Windszus
  Dynamic Languages Toolkit - Mylyn Integration 4.0.0.201206120848  org.eclipse.dltk.mylyn.feature.group    Eclipse.org
  Eclipse Platform  4.2.0.M20130320-1959    org.fedoraproject.eclipse.platform  null
  EMF Common UI 2.7.0.v20120911-0500    org.eclipse.emf.common.ui.feature.group Eclipse Modeling Project
  EMF Data Binding  1.2.0.v20120911-0500    org.eclipse.emf.databinding.feature.group   Eclipse Modeling Project
  EMF Ecore Edit    2.8.0.v20120911-0500    org.eclipse.emf.ecore.edit.feature.group    Eclipse Modeling Project
  EMF Ecore Mapping 2.7.0.v20120911-0500    org.eclipse.emf.mapping.ecore.feature.group Eclipse Modeling Project
  EMF Ecore Mapping Editor  2.7.0.v20120911-0500    org.eclipse.emf.mapping.ecore.editor.feature.group  Eclipse Modeling Project
  EMF Edit Data Binding 1.2.0.v20120911-0500    org.eclipse.emf.databinding.edit.feature.group  Eclipse Modeling Project
  EMF Edit UI   2.8.0.v20120911-0500    org.eclipse.emf.edit.ui.feature.group   Eclipse Modeling Project
  EMF Mapping   2.7.0.v20120911-0500    org.eclipse.emf.mapping.feature.group   Eclipse Modeling Project
  EMF Mapping UI    2.7.0.v20120911-0500    org.eclipse.emf.mapping.ui.feature.group    Eclipse Modeling Project
  EMF Sample Ecore Editor   2.8.0.v20120911-0500    org.eclipse.emf.ecore.editor.feature.group  Eclipse Modeling Project
  Library Hover help for devhelp documentation  1.0.0.201302051708  org.eclipse.linuxtools.cdt.libhover.devhelp.feature.feature.group   Eclipse Linux Tools
  Miscellaneous C/C++ Utilities 5.1.0.201302132326  org.eclipse.cdt.util.feature.group  Eclipse CDT
  Mylyn Context Connector: C/C++ Development    5.4.3.v20130107-0100    org.eclipse.cdt.mylyn.feature.group Eclipse Mylyn
  Mylyn Context Connector: Eclipse IDE  3.8.3.v20130107-0100    org.eclipse.mylyn.ide_feature.feature.group Eclipse Mylyn
  Mylyn Context Connector: Team Support 3.8.3.v20130107-0100    org.eclipse.mylyn.team_feature.feature.group    Eclipse Mylyn
  Mylyn Task List   3.8.3.v20130107-0100    org.eclipse.mylyn_feature.feature.group Eclipse Mylyn
  Mylyn Task-Focused Interface  3.8.3.v20130107-0100    org.eclipse.mylyn.context_feature.feature.group Eclipse Mylyn
  Mylyn Tasks Connector: Mantis 3.9.0.201206242005  com.itsolut.mantis_feature.feature.group    ITSOLUT
  PHP Development Tools (PDT)   3.1.2.201212211235  org.eclipse.php.feature.group   Eclipse.org
  Remote System Explorer User Actions   1.1.400.201205300905-31FBV773573D933L3D org.eclipse.rse.useractions.feature.group   Eclipse TM Project
  RSE Core  3.4.0.201205300905-7a7NFm-7sResSX4RTNSW org.eclipse.rse.core.feature.group  Eclipse TM Project
  RSE Core Source   3.4.0.201205300905-7a7NFm-7sResSX4RTNSW org.eclipse.rse.core.source.feature.group   Eclipse TM Project
  RSE DStore Services   3.4.0.201205300905-7L79FYw7VFNVFscFGMFs org.eclipse.rse.dstore.feature.group    Eclipse TM Project
  RSE DStore Services Source    3.4.0.201205300905-7L79FYw7VFNVFscFGMFs org.eclipse.rse.dstore.source.feature.group Eclipse TM Project
  RSE FTP Service Source    3.1.0.201205300905-791FBV773573D933L3D  org.eclipse.rse.ftp.source.feature.group    Eclipse TM Project
  RSE Local Services    2.1.400.201205300905-7B4FSg7J9EJ9YO99r9Y    org.eclipse.rse.local.feature.group Eclipse TM Project
  RSE Local Services Source 2.1.400.201205300905-7B4FSg7J9EJ9YO99r9Y    org.eclipse.rse.local.source.feature.group  Eclipse TM Project
  RSE SSH Services  3.0.400.201205300905-7A4FEc7F7BF7RJ77g7R    org.eclipse.rse.ssh.feature.group   Eclipse TM Project
  RSE SSH Services Source   3.0.400.201205300905-7A4FEc7F7BF7RJ77g7R    org.eclipse.rse.ssh.source.feature.group    Eclipse TM Project
  RSE Telnet Service Source 2.3.0.201205300905-784FD37B58B5KE55W5K  org.eclipse.rse.telnet.source.feature.group Eclipse TM Project
  RSE Terminals UI  1.2.0.201205300905-773Eo7H89G8OJ8Db8NB27    org.eclipse.rse.terminals.feature.group Eclipse TM Project
  RSE Terminals UI Source   1.2.0.201205300905-773Eo7H89G8OJ8Db8NB27    org.eclipse.rse.terminals.source.feature.group  Eclipse TM Project
  Target Management Terminal Widget 3.2.0.201205300905-41-312316411A16  org.eclipse.tm.terminal.feature.group   Eclipse TM Project
  TeXlipse  1.5.0   net.sourceforge.texlipse.feature.group  texlipse.sf.net
  Valgrind Tools Integration    1.1.0.201302051708  org.eclipse.linuxtools.valgrind.feature.group   Eclipse Linux Tools

Original comment by ablu.eri...@gmail.com on 28 Apr 2013 at 9:39

@GoogleCodeExporter
Copy link
Author

I could reproduce by selecting two C projects and run cppcheck on those.

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

  • Changed state: Accepted

@GoogleCodeExporter
Copy link
Author

The problem is as following:
If two projects are selected RunCodeAnalysisJob.runResource is being executed 
on both projects consecutively. Both are triggering 
Builder.ResourceVisitor.runChecker and Builder.processResource. In both methods 
checker.run is executed. This method can currently be executed only once on the 
same Checker instance, because it closes the underlying output streams.

Bugfix: Prevent Checker.run being executed twice.

Original comment by konra...@gmx.de on 21 Dec 2013 at 10:54

@GoogleCodeExporter
Copy link
Author

Original comment by konra...@gmx.de on 21 Dec 2013 at 10:54

  • Added labels: Milestone-1.0.0

@GoogleCodeExporter
Copy link
Author

This issue was closed by revision r296.

Original comment by konra...@gmx.de on 22 Dec 2013 at 3:15

  • Changed state: Fixed

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant