Bug 548362 - Eclipse freezes on simple C file editing or saving
Summary: Eclipse freezes on simple C file editing or saving
Status: NEW
Alias: None
Product: CDT
Classification: Tools
Component: cdt-editor (show other bugs)
Version: 9.7.0   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: 2019-06-18 00:05 EDT by Dmitrii Vinokurov CLA
Modified: 2020-09-04 15:24 EDT (History)
6 users (show)

See Also:


Attachments
Trace when Eclipse freezed on saving (57.99 KB, application/octet-stream)
2019-06-18 00:05 EDT, Dmitrii Vinokurov CLA
no flags Details
Trace when Eclipse freezed on editing (48.42 KB, application/octet-stream)
2019-06-18 00:05 EDT, Dmitrii Vinokurov CLA
no flags Details
Screenshot of error after 5 minutes freezing on saving (240.96 KB, image/png)
2019-06-18 00:06 EDT, Dmitrii Vinokurov CLA
no flags Details

Note You need to log in before you can comment on or make changes to this bug.
Description Dmitrii Vinokurov CLA 2019-06-18 00:05:30 EDT
Created attachment 278979 [details]
Trace when Eclipse freezed on saving

Fresh Eclipse CDT 2019-03 (4.11.0) 20190314-1200 install. Trying to save existing file leads to freeze (trace from "kill -3" attached) and after few minutes it shows error message (screenshot attached). Successfully repeated it second time, at third - it freezed just on editing (trace attached too).

Could anybody help with it?
Comment 1 Dmitrii Vinokurov CLA 2019-06-18 00:05:58 EDT
Created attachment 278980 [details]
Trace when Eclipse freezed on editing
Comment 2 Dmitrii Vinokurov CLA 2019-06-18 00:06:41 EDT
Created attachment 278981 [details]
Screenshot of error after 5 minutes freezing on saving
Comment 3 Nathan Ridge CLA 2019-06-18 00:29:38 EDT
How large is the workspace in terms of number of files?

The traces show the UI thread blocked while another thread is spending time in code that iterates the workspace's resource model, which represents the tree of directories and files in the workspace.
Comment 4 Dmitrii Vinokurov CLA 2019-06-18 01:01:54 EDT
1021041 files and 67986 directories. I'd also like to add that I've worked with this workspace without any problems for about a month with CDT and PyDev, BashEditor addons and then, after something happened it started to freeze on any action. I've posted about it to https://www.eclipse.org/forums/index.php/t/1099270/, received suggestion to reinstall Eclipse to investigate this bug from the start, without addons. Then I posted about it here.
Comment 5 Nathan Ridge CLA 2019-06-18 02:15:36 EDT
I think the relevant part of the stack trace is this:
        
        at org.eclipse.core.internal.resources.Resource.accept(Resource.java:55)
        at org.eclipse.cdt.internal.core.resources.ResourceLookupTree.add(ResourceLookupTree.java:282)
        at org.eclipse.cdt.internal.core.resources.ResourceLookupTree.initializeProjects(ResourceLookupTree.java:370)
        at org.eclipse.cdt.internal.core.resources.ResourceLookupTree.findFilesForLocation(ResourceLookupTree.java:690)
        - locked <0x000000059cc19e28> (a java.lang.Object)
        at org.eclipse.cdt.internal.core.resources.ResourceLookupTree.findFilesForLocation(ResourceLookupTree.java:677)
        at org.eclipse.cdt.internal.core.resources.ResourceLookup.findFilesForLocation(ResourceLookup.java:69)
        at org.eclipse.cdt.internal.core.resources.ResourceLookup.selectFileForLocation(ResourceLookup.java:95)
        at org.eclipse.cdt.core.index.IndexLocationFactory.getIFLExpensive(IndexLocationFactory.java:95)

which then spends a lot of time iterating a large number of files.

This definitely rings a bell -- I feel like I've definitely seen a performance bug with a similar stack trace in recent months.
Comment 6 Dmitrii Vinokurov CLA 2019-06-18 02:21:54 EDT
Confirm that this is related to project indexing. After a couple of time with opened non freezed Eclipse I decided to check again whether bug exists - no more. Then I toggled project refresh and tried to save file again - same bug.
Comment 7 Nathan Ridge CLA 2019-06-18 02:27:55 EDT
(In reply to Nathan Ridge from comment #5)
> This definitely rings a bell -- I feel like I've definitely seen a
> performance bug with a similar stack trace in recent months.

Can't find it at the moment unfortunately. (It would be nice to have a way to search the contents of attachments...)

Bug 366570 might contain some relevant discussion.
Comment 8 Nathan Ridge CLA 2019-06-27 21:30:49 EDT
cc'ing a few people to see if anyone might be able to dig up the recent bug report (last year or so I think) that we've had about a performance problems with a stack trace similar to comment 5.