Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.
Bug 328343 - [contentassist] 100% cpu on large javadoc
Summary: [contentassist] 100% cpu on large javadoc
Status: CLOSED WORKSFORME
Alias: None
Product: Platform
Classification: Eclipse Project
Component: SWT (show other bugs)
Version: 3.6   Edit
Hardware: PC Linux
: P3 normal with 1 vote (vote)
Target Milestone: ---   Edit
Assignee: Platform-SWT-Inbox CLA
QA Contact:
URL:
Whiteboard:
Keywords: triaged
: 385980 (view as bug list)
Depends on:
Blocks:
 
Reported: 2010-10-21 08:44 EDT by P.V. Goddijn CLA
Modified: 2018-07-04 11:15 EDT (History)
6 users (show)

See Also:


Attachments
stack trace at beginning of problem (cpu @100%) (21.99 KB, text/plain)
2010-10-21 08:47 EDT, P.V. Goddijn CLA
no flags Details
stack trace 2 minutes later (cpu @100%) (21.99 KB, text/plain)
2010-10-21 08:47 EDT, P.V. Goddijn CLA
no flags Details
offending java file (generated by Jaxb) (749.89 KB, text/plain)
2010-10-21 08:50 EDT, P.V. Goddijn CLA
no flags Details
new stacktrace for eclipse 3.7.0 (26.89 KB, text/plain)
2011-09-09 07:54 EDT, P.V. Goddijn CLA
no flags Details
Stacktrace when Eclipse does not respond (14.47 KB, text/plain)
2011-10-12 13:01 EDT, Dominik Stadler CLA
no flags Details
Javascript File which is minified (i.e. has all newlines removed) (158.66 KB, application/javascript)
2011-10-12 13:02 EDT, Dominik Stadler CLA
no flags Details

Note You need to log in before you can comment on or make changes to this bug.
Description P.V. Goddijn CLA 2010-10-21 08:44:28 EDT
Build Identifier: 20100617-1415

when the contentassist tries to display an item with a very large javadoc,
CPU usage goes to 100% for several minutes.

eventualy the the porcess finishes and the tooltip is shown.
the tooltip is regular size and the contains the large amount of javadoc

jstack shows the offending process is:
org.eclipse.swt.internal.gtk.OS._pango_layout_get_line_count(Native Method)


Reproducible: Always

Steps to Reproduce:
1. Type name of offending class(non-unique)
2. use arrow key to scroll down to the offending class
3. when offending class is highlighted cpu --> 100%
Comment 1 P.V. Goddijn CLA 2010-10-21 08:47:15 EDT
Created attachment 181386 [details]
stack trace at beginning of problem (cpu @100%)
Comment 2 P.V. Goddijn CLA 2010-10-21 08:47:56 EDT
Created attachment 181387 [details]
stack trace 2 minutes later (cpu @100%)
Comment 3 P.V. Goddijn CLA 2010-10-21 08:50:39 EDT
Created attachment 181388 [details]
offending java file (generated by Jaxb)
Comment 4 Terry Parker CLA 2011-09-08 22:34:19 EDT
FYI

This sounds like a dup of 329288, but the attached stack traces don't line up with that.  Is this fixed in Eclpse 3.6.2 or 3.7.0?
Comment 5 P.V. Goddijn CLA 2011-09-09 07:53:14 EDT
this is still present in eclipse 3.7.0

i'll upload a stacktrace for 3.7.0.
Comment 6 P.V. Goddijn CLA 2011-09-09 07:54:09 EDT
Created attachment 203051 [details]
new stacktrace for eclipse 3.7.0
Comment 7 Dominik Stadler CLA 2011-10-12 13:00:39 EDT
I have the same behavior with a minified .js file that has one very long line, stacktrace and js-file attached. This one takes half a minute on my machine to display and as soon as you do the slightest thing in Eclipse hangs again until the offending file is closed.
Comment 8 Dominik Stadler CLA 2011-10-12 13:01:15 EDT
Created attachment 205051 [details]
Stacktrace when Eclipse does not respond
Comment 9 Dominik Stadler CLA 2011-10-12 13:02:08 EDT
Created attachment 205052 [details]
Javascript File which is minified (i.e. has all newlines removed)
Comment 10 Alexander Kurtakov CLA 2017-01-05 17:40:09 EST
Is this bug still reproducible for you? I can't reproduce here.
Comment 11 Andrey Loskutov CLA 2017-05-16 02:53:27 EDT
*** Bug 385980 has been marked as a duplicate of this bug. ***
Comment 12 Andrey Loskutov CLA 2017-05-16 02:59:40 EDT
(In reply to Alexander Kurtakov from comment #10)
> Is this bug still reproducible for you? I can't reproduce here.

I've just seen exact this on 4.6.3 RHEL 7.2 GTK3.14, 100% screen scaling. Eclipse froze forever with 100% CPU load (I've killed it after 5 minutes) trying to display a huge man page entry in opened shell script file editor.

jstack:
"main" #1 prio=6 os_prio=0 tid=0x00007f702800b000 nid=0xa7f runnable [0x00007f7030c65000]
   java.lang.Thread.State: RUNNABLE
	at org.eclipse.swt.internal.gtk.OS._pango_layout_get_line_count(Native Method)
	at org.eclipse.swt.internal.gtk.OS.pango_layout_get_line_count(OS.java:16636)
	at org.eclipse.swt.graphics.TextLayout.getLineBoundsInPixels(TextLayout.java:1036)
	at org.eclipse.swt.graphics.TextLayout.getLineBounds(TextLayout.java:1031)
	at org.eclipse.swt.graphics.TextLayout.getBounds(TextLayout.java:803)
	at org.eclipse.jface.internal.text.html.BrowserInformationControl.computeSizeHint(BrowserInformationControl.java:446)
	at org.eclipse.jface.text.AbstractInformationControlManager.internalShowInformationControl(AbstractInformationControlManager.java:1217)
	at org.eclipse.jface.text.AbstractInformationControlManager.presentInformation(AbstractInformationControlManager.java:1163)
	at org.eclipse.jface.text.AbstractHoverInformationControlManager.presentInformation(AbstractHoverInformationControlManager.java:894)
	at org.eclipse.jface.text.TextViewerHoverManager.doPresentInformation(TextViewerHoverManager.java:244)
	at org.eclipse.jface.text.TextViewerHoverManager$5.run(TextViewerHoverManager.java:234)
	at org.eclipse.swt.widgets.RunnableLock.run(RunnableLock.java:35)
	at org.eclipse.swt.widgets.Synchronizer.runAsyncMessages(Synchronizer.java:182)
	- locked <0x000000079c2c42d0> (a org.eclipse.swt.widgets.RunnableLock)
	at org.eclipse.swt.widgets.Display.runAsyncMessages(Display.java:4536)
	at org.eclipse.swt.widgets.Display.readAndDispatch(Display.java:4154)

ptack:
#0  0x00007f700d8074be in g_slice_alloc () at /lib64/libglib-2.0.so.0
#1  0x00007f700d80799e in g_slice_alloc0 () at /lib64/libglib-2.0.so.0
#2  0x00007f700df7ce14 in itemize_state_process_run () at /lib64/libpango-1.0.so.0
#3  0x00007f700df7e2c8 in pango_itemize_with_base_dir () at /lib64/libpango-1.0.so.0
#4  0x00007f700df8546a in pango_layout_check_lines () at /lib64/libpango-1.0.so.0
#5  0x00007f700df8689e in pango_layout_get_line_count () at /lib64/libpango-1.0.so.0
#6  0x00007f6ff195ab84 in Java_org_eclipse_swt_internal_gtk_OS__1pango_1layout_1get_1line_1count () at /home/aloskuto/.eclipse_ide/advantest_ide_RH7-463/eclipse/configuration/org.eclipse.osgi/404/0/.cp/libswt-pi3-gtk-4629.so
#7  0x00007f7018c20971 in  ()
#8  0x00007f7030c655e0 in  ()
#9  0x0000000000000000 in  ()
Comment 13 Eric Williams CLA 2018-06-15 15:44:11 EDT
Sounds like a webkit1 hang. Is this still reproducible on GTK3.22 and 4.8?
Comment 14 Eric Williams CLA 2018-07-04 11:15:07 EDT
(In reply to Eric Williams from comment #13)
> Sounds like a webkit1 hang. Is this still reproducible on GTK3.22 and 4.8?

Closing on account of this. Andrey if you still experience this issue on GTK3.22 and 4.8, please reopen this ticket.