Bug 566289 - Duplicate entries are shown in C++ type hierarchry
Summary: Duplicate entries are shown in C++ type hierarchry
Status: NEW
Alias: None
Product: CDT
Classification: Tools
Component: cdt-core (show other bugs)
Version: 9.4.3   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: 2020-08-23 08:55 EDT by Gennady Gozman CLA
Modified: 2021-11-02 17:53 EDT (History)
5 users (show)

See Also:


Attachments
Type Hierarchy with duplicates (358.96 KB, image/jpeg)
2020-08-23 08:55 EDT, Gennady Gozman CLA
no flags Details
Duplicate entries example snapshot. (437.05 KB, image/jpeg)
2021-04-20 08:37 EDT, Gennady Gozman CLA
no flags Details

Note You need to log in before you can comment on or make changes to this bug.
Description Gennady Gozman CLA 2020-08-23 08:55:45 EDT
Created attachment 283942 [details]
Type Hierarchy with duplicates

Type hierarchy for C++ shows the same classes multiple times. The attached snapshot demonstrates the issue. The snapshot was taken for Eclipse Oxygen, 4.7.3a. However, the issue happens in other Eclipse versions, for example, in Eclipse Neon.3, 4.6.3, on Solaris 10.
I'm not sure regarding actual CDT component responsible for this. I selected cdt-core only because the component is mandatory.
Comment 1 Michael Woski CLA 2021-04-15 14:00:30 EDT
(In reply to Gennady Gozman from comment #0)

I suspect that these are class templates, right?
Comment 2 Gennady Gozman CLA 2021-04-18 10:02:00 EDT
No, this is not related to template classes. Actually, I think this is related to out of memory exceptions thrown during C++ parsing/indexing. I'm struggling with the problem for years without a significant success. One hierarchy of our classes produces the exceptions consistently when finding overrides of pure virtual functions. This looks like an endless recursion. I've tried to debug this in Eclipse and I found out that there are multiple records of the problematic class(es) in PDOM. However, I was not able to understand why.

I did not open a PR for the out of memory exceptions because there are already one or two and they are not solved.
Comment 3 Gennady Gozman CLA 2021-04-20 08:37:48 EDT
Created attachment 286175 [details]
Duplicate entries example snapshot.

Note, that method getIPAddr() causes an out of memory exception during parsing  of another file, where it is called. I found this by commenting out the code and the uncommenting it line by line until the exception. I'm pretty sure that this is related to the multiple entries of the classes in PDOM.
Comment 4 Gennady Gozman CLA 2021-04-20 08:38:53 EDT
I can try to send my PDOM, if necessary.
Comment 5 Ed Willink CLA 2021-10-30 04:16:33 EDT
Bug 576970 suggests that the problem may have spread to JDT.
Comment 6 Andrey Loskutov CLA 2021-11-02 17:53:44 EDT
(In reply to Ed Willink from comment #5)
> Bug 576970 suggests that the problem may have spread to JDT.

Both type hierarchies have nothing in common except view name. So it is unrelated for sure.