Bug 513797 - [Content Assist] Hangs frequently
Summary: [Content Assist] Hangs frequently
Status: NEW
Alias: None
Product: CDT
Classification: Tools
Component: cdt-editor (show other bugs)
Version: 9.2.0   Edit
Hardware: PC Linux
: P3 normal with 3 votes (vote)
Target Milestone: ---   Edit
Assignee: Project Inbox CLA
QA Contact: Jonah Graham CLA
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2017-03-17 05:01 EDT by Chip D CLA
Modified: 2021-03-07 14:56 EST (History)
5 users (show)

See Also:


Attachments
stack trace (27.54 KB, application/octet-stream)
2017-03-20 05:25 EDT, Chip D CLA
no flags Details
stack trace (27.63 KB, application/octet-stream)
2017-03-20 05:26 EDT, Chip D CLA
no flags Details
stack trace (30.00 KB, application/octet-stream)
2017-03-20 05:26 EDT, Chip D CLA
no flags Details
stack trace (29.61 KB, application/octet-stream)
2017-03-20 05:26 EDT, Chip D CLA
no flags Details
stack trace (32.23 KB, application/octet-stream)
2017-03-20 05:27 EDT, Chip D CLA
no flags Details
stack trace (31.96 KB, application/octet-stream)
2017-03-20 05:27 EDT, Chip D CLA
no flags Details
Thread-Dump of Eclipse hanging during content-assist. (47.98 KB, text/plain)
2020-08-03 09:32 EDT, Jörg Hohwiller CLA
no flags Details
Thread-Dump of Eclipse hanging during content-assist (2). (31.26 KB, text/plain)
2020-08-03 09:33 EDT, Jörg Hohwiller CLA
no flags Details
Thread-Dump of Eclipse hanging during content-assist (3). (31.17 KB, text/plain)
2020-08-03 09:33 EDT, Jörg Hohwiller CLA
no flags Details

Note You need to log in before you can comment on or make changes to this bug.
Description Chip D CLA 2017-03-17 05:01:27 EDT
While typing or when invoking the "content assist" command Eclipse may hang and never recover. For example, when typing "std::".

The hang makes all UI non-responsive, it doesn't even redraw when the window is resized.

Sometimes it recovers after a long time (about 15 seconds) and complains about the "Parsing-based proposals (Task-Focused)".

OS task manager shows a lot of I/O activity.

This hang wasn't occurring in Neon.1, it has appeared in Neon.2.
Comment 1 Nathan Ridge CLA 2017-03-17 21:46:33 EDT
Could you please follow the instructions here [1] to obtain a stack trace of all threads during the hang, and post it here as an attachment? Thanks!

[1] https://wiki.eclipse.org/How_to_report_a_deadlock
Comment 2 Chip D CLA 2017-03-20 05:25:42 EDT
Created attachment 267345 [details]
stack trace

stack trace during the hang
Comment 3 Chip D CLA 2017-03-20 05:26:09 EDT
Created attachment 267346 [details]
stack trace

stack trace during the hang
Comment 4 Chip D CLA 2017-03-20 05:26:28 EDT
Created attachment 267347 [details]
stack trace

stack trace during the hang
Comment 5 Chip D CLA 2017-03-20 05:26:54 EDT
Created attachment 267348 [details]
stack trace

stack trace during the hang
Comment 6 Chip D CLA 2017-03-20 05:27:22 EDT
Created attachment 267349 [details]
stack trace

stack trace during the hang
Comment 7 Chip D CLA 2017-03-20 05:27:38 EDT
Created attachment 267350 [details]
stack trace

stack trace during the hang
Comment 8 Chip D CLA 2017-03-20 05:28:57 EDT
These six stack traces are during the same content assist lookup.
Comment 9 Nathan Ridge CLA 2017-03-22 00:37:38 EDT
In each of the posted strack traces:

  - The main thread is running (as opposed to being blocked 
    on another thread).

  - It is reading from the disk, as part of doing an index
    lookup while running content assist.

This in and of itself does not indicate any problem, except of course that it shouldn't be taking so long.

A few questions:

  - You mentioned this is a regression from Neon.1 to Neon.2.
    Is it only content assist performance that has regressed,
    or has the performance of other things regressed as well,
    such as the amount of time it takes to rebuild the index?

  - Does increasing the cache limits near the bottom of
    Preferences -> C/C++ -> Indexer improve performance?

  - Is your workspace directory on a hard disk or SSD? If it's
    on a hard disk, and you have an SSD available, does
    moving it to the SSD improve performance?
Comment 10 Chip D CLA 2017-03-24 03:35:46 EDT
Index rebuild time is not affected.

Refactoring "rename variable" got worse, but it's probably a different bug that was present in Neon.1 too (there it was for "rename file" instead): the refactoring is stuck unless you jiggle the window - move/resize/minimize/maximize.

Increasing cache limits doesn't change the behavior (30%, 1024, 256, -Xms512m, -Xmx4096m). 

It's HDD, no SSD available.
Comment 11 Nathan Ridge CLA 2017-03-24 23:37:21 EDT
Very strange.

How large is your project (files / lines of code)? How large is your index database file (<workspace>/.metadata/.plugins/org.eclipse.cdt.core/<project>.<timestamp>.pdom)?
Comment 12 Chip D CLA 2017-03-27 02:27:10 EDT
DB is 2.7 GB, project is chromium (70k files, 675kloc). The other one is 40 MB (450 files, 35kloc).
Comment 13 Nathan Ridge CLA 2017-03-28 17:22:38 EDT
(In reply to Chip D from comment #12)
> project is chromium

Oh, that's interesting - since that's an open-source project, I may be able to replicate your problem.

Do you know if others using CDT to develop chromium are experiencing the same issue?

Anyways, if you describe how you set up CDT for working on chromium, and then an example of a place where content assist hangs for you, I can try to replicate your setup and see if the hang occurs for me.
Comment 14 Chip D CLA 2017-03-29 08:29:45 EDT
Getting the 'webrtc' repo via gclient:

 $ git clone https://chromium.googlesource.com/chromium/tools/depot_tools.git

 $ export PATH=`pwd`/depot_tools:"$PATH"

 $ mkdir webrtc-checkout

 $ cd webrtc-checkout

 $ fetch --nohooks webrtc

 $ gclient sync

That's from these two links:

http://dev.chromium.org/developers/how-tos/install-depot-tools

https://webrtc.org/native-code/development/

In short, this gets sources for the Google's native WebRTC. It takes a day to download, so I haven't actually repeated these steps.

Then create an empty Eclipse workspace and an "Empty C++ Project (Linux GCC)", link the webrtc-checkout/src directory via Project -> Properties -> Paths and Symbols -> Source Location -> Link Folder -> folder in the filesystem. Wait for the index to finish. (this part I've repeated)

Typing things like 'std::' and 'base::' may hang.
Comment 15 Jörg Hohwiller CLA 2020-08-03 09:31:40 EDT
I am facing the same problem with Eclipse 2020.03 but with JDT.
It may be the same or a similar problem or something entirely different. However, I will attach some thread-dumps for a single content-assist that never terminated and made Eclipse hang forever. Restarting Eclipse does not help. The next content-assist in JDT Editor is making it freeze again.
Maybe the problem goes away if I create a new workspace. I can test this if you like.
Comment 16 Jörg Hohwiller CLA 2020-08-03 09:32:57 EDT
Created attachment 283785 [details]
Thread-Dump of Eclipse hanging during content-assist.
Comment 17 Jörg Hohwiller CLA 2020-08-03 09:33:15 EDT
Created attachment 283786 [details]
Thread-Dump of Eclipse hanging during content-assist (2).
Comment 18 Jörg Hohwiller CLA 2020-08-03 09:33:35 EDT
Created attachment 283787 [details]
Thread-Dump of Eclipse hanging during content-assist (3).
Comment 19 Roman A. CLA 2021-03-07 14:02:06 EST
Hi, i have the same issue with Eclipse and java development
Comment 20 Jonah Graham CLA 2021-03-07 14:56:16 EST
(In reply to Roman A. from comment #19)
> Hi, i have the same issue with Eclipse and java development

Hi Roman - this bug covers content assist hanging in C/C++ development. The code of Java code completion is generally separate so if you have a test case it would be best to file a bug for the Java development team: https://bugs.eclipse.org/bugs/enter_bug.cgi?product=JDT