Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.

Bug 313431

Summary: The Binaries folder in the C/C++ view disappears sometime
Product: [Tools] CDT Reporter: Dobrin Alexiev <dalexiev>
Component: cdt-coreAssignee: Anton Leherbauer <aleherb+eclipse>
Status: RESOLVED FIXED QA Contact: Doug Schaefer <cdtdoug>
Severity: normal    
Priority: P3 CC: aleherb+eclipse, evil_bandit_betamax, yevshif
Version: 7.0   
Target Milestone: 8.7.0   
Hardware: PC   
OS: Windows XP   
See Also: https://git.eclipse.org/r/45560
https://git.eclipse.org/c/cdt/org.eclipse.cdt.git/commit/?id=c0ce0a2b8cfc581d5f39c05009dfba5ab5905059
Whiteboard:

Description Dobrin Alexiev CLA 2010-05-18 16:09:45 EDT
Build Identifier: Version: 3.6.0, Build id: I20100429-1549

Sometime when I change my project’s options its “Binaries” folder disappears from the “C/C++ View”. 

Reproducible: Always

Steps to Reproduce:
One semi consistent way to reproduce it 

- In the project view select a project and context.
- In the Properties dialog navigate to C/C++ Build Behaviour tab and uncheck the option “Build (Incremental build). 

Now when I close the dialog the Binaries folder of my project has disappeared. 

If I close and open the project it will reappear, or if I change a project option again it might reappear too.
Comment 1 Dobrin Alexiev CLA 2010-05-18 16:22:26 EDT
If I use sometihng like this make the binary folder appears again: 

 ICProject cproject = CoreModel.getDefault().getCModel().getCProject(project);
 CModelManager.getDefault().removeBinaryRunner(cproject);
 CModelManager.getDefault().getBinaryRunner(cproject).start();
 cproject.getBinaryContainer().getBinaries();
Comment 2 Anton Leherbauer CLA 2010-05-20 03:27:35 EDT
Which exact version of CDT does this relate to?  Is this 6.0 as bugzilla says?
Comment 3 Dobrin Alexiev CLA 2010-05-21 17:21:21 EDT
It happends in head.
Comment 4 John Moule CLA 2014-09-24 10:26:45 EDT
I too see this.

Reproduced using Kepler SR2
C/C++ Development Tools 8.3.0.201402142303	
Eclipse Platform 4.3.2.v20140221-1852	

I haven't been able to characterise exactly what causes it to happen, but when it does its really annoying. I seem to have seen this behaviour come and go throughout my career using CDT (since 2006). Is a fix on its way for this?

I've also updated the following case because it may be a duplicate:

Bug 387075 - Binary folder intermittently does not appear after a CDT project Build

cheers john
Comment 5 Eclipse Genie CLA 2015-04-09 10:28:08 EDT
New Gerrit change created: https://git.eclipse.org/r/45560
Comment 6 Anton Leherbauer CLA 2015-04-10 02:15:54 EDT
I think I have a fix for this. There is a race condition when creating the element info (cache) for the binary container element. The element info might be created twice by different threads and the later one will replace the other. If the binaries have already been collected for the first element info, the second one might stay empty (depends on subtle timing).
The fix is to make the creation of the element info an atomic operation.
Comment 8 Anton Leherbauer CLA 2015-04-13 11:09:39 EDT
Fixed in master.
Comment 9 John Moule CLA 2015-04-16 09:33:27 EDT
Hi Anton,

I look forward to trying your fix. Do you know if it addresses the following, possibly similar bugs?

Bug 349564 - The 'Binaries' node does not always disappear when project is cleaned

Bug 387075 - Binary folder intermittently does not appear after a CDT project Build
Comment 10 Anton Leherbauer CLA 2015-04-16 09:46:10 EDT
(In reply to John Moule from comment #9)
> Hi Anton,
> 
> I look forward to trying your fix. Do you know if it addresses the
> following, possibly similar bugs?
> 
> Bug 349564 - The 'Binaries' node does not always disappear when project is
> cleaned

I am not entirely sure about this one, but there is a good chance it is also fixed.

> Bug 387075 - Binary folder intermittently does not appear after a CDT
> project Build

This indeed looks like a duplicate, so it should be fixed as well.