Bug 541131 - C++ indexer does not terminate when indexing gcc 8.2.0 or 8.2.1 source code
Summary: C++ indexer does not terminate when indexing gcc 8.2.0 or 8.2.1 source code
Status: NEW
Alias: None
Product: CDT
Classification: Tools
Component: cdt-indexer (show other bugs)
Version: 9.5.4   Edit
Hardware: PC Linux
: P3 normal (vote)
Target Milestone: ---   Edit
Assignee: Project Inbox CLA
QA Contact: Jonah Graham CLA
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2018-11-14 03:16 EST by Chris Ward CLA
Modified: 2020-09-04 15:27 EDT (History)
2 users (show)

See Also:


Attachments
Files showing eclipse indexer errors (3.91 KB, application/x-compress)
2018-11-28 09:07 EST, Chris Ward CLA
no flags Details

Note You need to log in before you can comment on or make changes to this bug.
Description Chris Ward CLA 2018-11-14 03:16:34 EST
Eclipse C++ indexer gets to 7% complete when attempting to index the gcc source, but makes no further progress.
I am running Eclipse on a RHEL7.5 system. I have given Eclipse 16GB of heap.
gcc source code is available here https://ftp.gnu.org/gnu/gcc/ ; versions 8.2.0 and 8.2.1 show the problem, maybe other versions show it too.
Comment 1 Chris Ward CLA 2018-11-14 06:24:51 EST
The indexer has the same problem with the code for gcc 7.3.1
Comment 2 Nathan Ridge CLA 2018-11-15 00:44:24 EST
Thanks for the report.

The next step to get this resolved is to reduce the problematic codebase to a minimal example that triggers the hang.

Unfortunately, I don't have the time to do that sort of thing any more, but if someone else does it, I'm happy to debug the resulting example.
Comment 3 Chris Ward CLA 2018-11-20 09:34:32 EST
How do I go about reducing the problematic codebase ? I have a little time which I could put to the effort, but I don't know how to go about it .
Comment 4 Nathan Ridge CLA 2018-11-20 19:12:22 EST
(In reply to Chris Ward from comment #3)
> How do I go about reducing the problematic codebase ? I have a little time
> which I could put to the effort, but I don't know how to go about it .

See e.g. bug 535548 comment 3.
Comment 5 Chris Ward CLA 2018-11-28 05:05:38 EST
I don't think a binary chop is practical; however I see https://www.eclipse.org/lists/cdt-dev/msg11365.html , which with any luck will indicate which file is causing the indexer to hang. I'll try following those instructions.
Comment 6 Chris Ward CLA 2018-11-28 05:26:17 EST
The indexer debug trace hangs with the last few lines being
Indexer: adding file:/home/tjcw/workspace/gcc-7.3.1-AME/gcc/testsuite/g++.dg/pr64688-2.C
Indexer: processed /gcc-7.3.1-AME/gcc/testsuite/g++.dg/pr64688-2.C [89 ms]
Indexer: parsing /gcc-7.3.1-AME/gcc/testsuite/g++.dg/pr64688.C

so I take it that the file causing the problem is pr64688.C .

Instructions for reproducing the problem are therefore:
 download the gcc source from https://ftp.gnu.org/gnu/gcc/ , select version 8.2.1
 attempt to index the file gcc/testsuite/g++.dg/pr64688.C in this package
 observe that the indexer hangs

This also gives me a workaround; I don't need the gcc testsuite to build my application, and if I move the testsuite out of the source tree, the indexer runs to completion.
Comment 7 Chris Ward CLA 2018-11-28 09:07:09 EST
Created attachment 276742 [details]
Files showing eclipse indexer errors

On further checking, there were several files giving indexer errors. I have attached a tarball of the failures. I don't know if the errors are caused by these source files or by files included by them.
Comment 8 Nathan Ridge CLA 2018-11-28 14:52:53 EST
(In reply to Chris Ward from comment #6)
> so I take it that the file causing the problem is pr64688.C .

Ah, yeah, compiler testcases causing problems for the indexer are somewhat expected.

See also bug 514035.

> This also gives me a workaround; I don't need the gcc testsuite to build my
> application, and if I move the testsuite out of the source tree, the indexer
> runs to completion.

You don't need to move the testsuite out of the source tree to avoid indexing it, you can just exclude it from the build via Properties.