Bug 543882 - First indexing after starting up Eclipse is wrong. Race condition? - keywords: ICLanguageSettingEntry getSettingEntries
Summary: First indexing after starting up Eclipse is wrong. Race condition? - keywor...
Status: NEW
Alias: None
Product: CDT
Classification: Tools
Component: cdt-indexer (show other bugs)
Version: Next   Edit
Hardware: PC Linux
: P3 major with 1 vote (vote)
Target Milestone: ---   Edit
Assignee: Project Inbox CLA
QA Contact: Jonah Graham CLA
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2019-01-28 03:06 EST by Oscar Asterkrans CLA
Modified: 2020-09-04 15:26 EDT (History)
3 users (show)

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Oscar Asterkrans CLA 2019-01-28 03:06:57 EST
First indexing after starting up Eclipse is wrong.

I see that includes and defines from Language Providers are fine. However the indexer does not seem to use these includes in the first run that is triggered on Eclipse startup. Everything works fine after a re-index.


Steps to reproduce:
1. Have a C/C++ project open.
2. Exit eclipse.
3. Make some changes and rebuild your project from command line.
4. Start eclipse again. Since files have changed Eclipse will trigger a re-index.
5. Indexer seem be unaware of system include paths even though they are present if I check the Language Settings Providers under project properties.
After another re-index, the indexing works as expected.

Maybe Eclipse starts the indexing too fast, before the indexer have set up the paths from the Language Providers?

I have NOT seen this issue in Oxygen, but happens all the time in Eclipse 2018-12 with CDT 9.6.0.201812111211.
Comment 1 Nathan Ridge CLA 2019-01-31 02:12:25 EST
(In reply to Oscar Asterkrans from comment #0)
> 1. Have a C/C++ project open.

What type of project are you using - Makefile? Managed build? New-style Core Build?

> 3. Make some changes and rebuild your project from command line.

Is the type of change here important? Does it have to be something major, like adding a new file, or is any modification to a file sufficient?

If possible, an example project and example change to it that trigger the issue would be helpful.
Comment 2 Gregory Kramida CLA 2019-02-01 08:39:15 EST
I'm not sure if my bug is the same, but I'm using cmake4eclipse and their as Indexer providers, and these seem to be working fine.

Until I restart Eclipse.
Then after I do something (again, not sure what yet -- might include rebuilding the index or the project), includes are resolved again.

I'm not 100% on this, but it feels like it might be this CDT bug, not a cmake4eclipse bug. I'll report back if I have more info that could be useful.

Eclipse: 2018/2019
CDT: 9.6
OS: Linux
Comment 3 Gregory Kramida CLA 2019-02-01 09:29:10 EST
P.S.

Just upgraded to:

Eclipse: 2018-12
CDT: 9.66.0.2018121112

Same bug.
Comment 4 Oscar Asterkrans CLA 2019-02-01 11:54:35 EST
I'm also using cmake4eclipse, and I think it is the same bug you are experiencing.

Please vote for the issue.
Comment 5 Gregory Kramida CLA 2019-02-07 09:31:44 EST
(Voted)
Also submitted here, since I'm not sure whether this is a CDT or a cmake4eclipse bug: https://github.com/15knots/cmake4eclipse/issues/109

Additional info:

cmake4eclipse version:   1.13.0.201901031836
CMake version: 3.12.3