Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Eclipse hangs when opening a minified CSS file in CSS Editor #656

Open
meldorq opened this issue Mar 25, 2021 · 8 comments
Open

Eclipse hangs when opening a minified CSS file in CSS Editor #656

meldorq opened this issue Mar 25, 2021 · 8 comments

Comments

@meldorq
Copy link

meldorq commented Mar 25, 2021

When I open a minified CSS file, i.e. with one very long line (e.g. 80k characters), Eclipse hangs with 100% CPU load.

The severity is different for different files of similar length, probably depending on the content. For some, Eclipse hangs for about a minute, which allows you to close the editor without killing Eclipse, e.g. fontawesome.min.css from https://fontawesome.com/download .

Others, like a proprietary file that I can't share, make Eclipse sleep for at least one hour (maybe forever).

While I can consciously avoid opening these files, it is especially annoying in a global search, when clicking next takes you to such a file without a warning.

When I open the same file in the plain text file editor, the CPU load goes up to 100%, too, but Eclipse gets responsive again much faster.

@mickaelistria
Copy link
Contributor

I can easily reproduce it with fontawesome.min.css

The stack while this is frozen is

"main" #1 prio=6 os_prio=0 cpu=336570.90ms elapsed=8564.23s tid=0x00007f4bf8016a20 nid=0xf8e runnable  [0x00007f4bfe8b3000]
   java.lang.Thread.State: RUNNABLE
	at org.eclipse.swt.internal.gtk.OS.g_utf16_offset_to_pointer(Native Method)
	at org.eclipse.swt.graphics.TextLayout.computeRuns(TextLayout.java:199)
	at org.eclipse.swt.graphics.TextLayout.getBoundsInPixels(TextLayout.java:752)
	at org.eclipse.swt.graphics.TextLayout.getBounds(TextLayout.java:747)
	at org.eclipse.swt.custom.StyledTextRenderer.calculate(StyledTextRenderer.java:299)
	at org.eclipse.swt.custom.StyledTextRenderer.calculateClientArea(StyledTextRenderer.java:328)
	at org.eclipse.swt.custom.StyledText.resetCache(StyledText.java:8095)
	at org.eclipse.swt.custom.StyledText.setStyleRanges(StyledText.java:10301)
	at org.eclipse.swt.custom.StyledText.replaceStyleRanges(StyledText.java:8008)
	at org.eclipse.jface.text.TextViewer.addPresentation(TextViewer.java:4693)
	at org.eclipse.jface.text.TextViewer.changeTextPresentation(TextViewer.java:4770)
	at org.eclipse.tm4e.ui.text.TMPresentationReconciler.applyTextRegionCollection(TMPresentationReconciler.java:681)
	at org.eclipse.tm4e.ui.text.TMPresentationReconciler.colorize(TMPresentationReconciler.java:580)
	at org.eclipse.tm4e.ui.text.TMPresentationReconciler$InternalListener.textChanged(TMPresentationReconciler.java:309)
	at org.eclipse.jface.text.TextViewer.updateTextListeners(TextViewer.java:2709)
	at org.eclipse.jface.text.TextViewer.invalidateTextPresentation(TextViewer.java:3353)
	at org.eclipse.jface.text.source.AnnotationPainter.invalidateTextPresentation(AnnotationPainter.java:970)

@mickaelistria
Copy link
Contributor

See eclipse-tm4e/tm4e#274

@meldorq
Copy link
Author

meldorq commented Jan 5, 2022

No news on this one for a long time, it seems. Not even a reaction on the upstream report at tm4e.

I am really surprised, because it is the most annoying bug in eclipse IMHO. I wonder why nobody else seems to be minding at all.

I am working around it by setting the default editor for all css files to the plain eclipse text editor. That's not ideal because I lose syntax highlighting and the like, but better than waiting for eclipse to recover several times a day, or restarting it in the middle of a carefully crafted debugging session.

@mickaelistria
Copy link
Contributor

I am really surprised, because it is the most annoying bug in eclipse IMHO. I wonder why nobody else seems to be minding at all.

Probably other people have different opinion on what is the most annoying bug in Eclipse and have decided to place their efforts according to their own opinion.
Please consider contributing to TM4E to fix this.

@meldorq
Copy link
Author

meldorq commented Jan 12, 2022

Probably other people have different opinion on what is the most annoying bug in Eclipse and have decided to place their efforts according to their own opinion. Please consider contributing to TM4E to fix this.

True, I didn't want to sound harsh.

Anyway, I looked into my error logs and believe it might not be an issue with TM4E, because the same issue occurs with two different CSS editors with similar but different stack traces, and only one involves TM4E.
My eclipse installation offers 2 editors to open CSS files: a "Generic Text Editor" with a CSS decoration, and a "CSS Editor". I can't tell which plugin provides which, but I believe the former comes with Wild Web Developer.

These are the stack traces:
Generic Text Editor:
Thread 'main' tid=1 (RUNNABLE) !STACK 0 Stack Trace at org.eclipse.swt.internal.gtk.OS.g_utf16_offset_to_pointer(Native Method) at org.eclipse.swt.graphics.TextLayout.computeRuns(TextLayout.java:199) at org.eclipse.swt.graphics.TextLayout.getLineCount(TextLayout.java:1011) at org.eclipse.swt.custom.StyledTextRenderer.getTextLayout(StyledTextRenderer.java:1270) at org.eclipse.swt.custom.StyledTextRenderer.getTextLayout(StyledTextRenderer.java:908) at org.eclipse.swt.custom.StyledTextRenderer.calculate(StyledTextRenderer.java:298) at org.eclipse.swt.custom.StyledText.redraw(StyledText.java:7846) at org.eclipse.swt.custom.StyledText.updateCaretVisibility(StyledText.java:11278) at org.eclipse.swt.custom.StyledText.setCaretLocations(StyledText.java:9055) at org.eclipse.swt.custom.StyledText.setCaretLocations(StyledText.java:8949) at org.eclipse.swt.custom.StyledText.setStyleRanges(StyledText.java:10718) at org.eclipse.swt.custom.StyledText.replaceStyleRanges(StyledText.java:8239) at org.eclipse.jface.text.TextViewer.addPresentation(TextViewer.java:4773) at org.eclipse.jface.text.TextViewer.changeTextPresentation(TextViewer.java:4850) at org.eclipse.tm4e.ui.text.TMPresentationReconciler.applyTextRegionCollection(TMPresentationReconciler.java:673) at org.eclipse.tm4e.ui.text.TMPresentationReconciler.colorize(TMPresentationReconciler.java:572) at org.eclipse.tm4e.ui.text.TMPresentationReconciler$InternalListener.textChanged(TMPresentationReconciler.java:310) at org.eclipse.jface.text.TextViewer.updateTextListeners(TextViewer.java:2785) at org.eclipse.jface.text.TextViewer.invalidateTextPresentation(TextViewer.java:3429) at org.eclipse.jface.text.source.AnnotationPainter.invalidateTextPresentation(AnnotationPainter.java:970) at org.eclipse.jface.text.source.AnnotationPainter.updatePainting(AnnotationPainter.java:952) at org.eclipse.jface.text.source.AnnotationPainter.lambda$0(AnnotationPainter.java:1075) at org.eclipse.jface.text.source.AnnotationPainter$$Lambda$1415/0x00000008015eec40.run(Unknown Source) at org.eclipse.swt.widgets.RunnableLock.run(RunnableLock.java:40) at org.eclipse.swt.widgets.Synchronizer.runAsyncMessages(Synchronizer.java:185) at org.eclipse.swt.widgets.Display.runAsyncMessages(Display.java:5101) at org.eclipse.swt.widgets.Display.readAndDispatch(Display.java:4584) at org.eclipse.e4.ui.internal.workbench.swt.PartRenderingEngine$5.run(PartRenderingEngine.java:1154) at org.eclipse.core.databinding.observable.Realm.runWithDefault(Realm.java:338) at org.eclipse.e4.ui.internal.workbench.swt.PartRenderingEngine.run(PartRenderingEngine.java:1045) at org.eclipse.e4.ui.internal.workbench.E4Workbench.createAndRunUI(E4Workbench.java:155) at org.eclipse.ui.internal.Workbench.lambda$3(Workbench.java:644) at org.eclipse.ui.internal.Workbench$$Lambda$245/0x000000080049e040.run(Unknown Source) at org.eclipse.core.databinding.observable.Realm.runWithDefault(Realm.java:338) at org.eclipse.ui.internal.Workbench.createAndRunWorkbench(Workbench.java:551) at org.eclipse.ui.PlatformUI.createAndRunWorkbench(PlatformUI.java:156) at org.eclipse.ui.internal.ide.application.IDEApplication.start(IDEApplication.java:152) at org.eclipse.equinox.internal.app.EclipseAppHandle.run(EclipseAppHandle.java:203) at org.eclipse.core.runtime.internal.adaptor.EclipseAppLauncher.runApplication(EclipseAppLauncher.java:136) at org.eclipse.core.runtime.internal.adaptor.EclipseAppLauncher.start(EclipseAppLauncher.java:104) at org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseStarter.java:401) at org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseStarter.java:255) at [email protected]/jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at [email protected]/jdk.internal.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62) at [email protected]/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) at [email protected]/java.lang.reflect.Method.invoke(Method.java:566) at app//org.eclipse.equinox.launcher.Main.invokeFramework(Main.java:659) at app//org.eclipse.equinox.launcher.Main.basicRun(Main.java:596) at app//org.eclipse.equinox.launcher.Main.run(Main.java:1467) at app//org.eclipse.equinox.launcher.Main.main(Main.java:1440)
CSS Editor:
Thread 'main' tid=1 (RUNNABLE) !STACK 0 Stack Trace at org.eclipse.swt.internal.gtk.OS.g_utf16_offset_to_pointer(Native Method) at org.eclipse.swt.graphics.TextLayout.computeRuns(TextLayout.java:199) at org.eclipse.swt.graphics.TextLayout.getLineCount(TextLayout.java:1011) at org.eclipse.swt.custom.StyledTextRenderer.getTextLayout(StyledTextRenderer.java:1270) at org.eclipse.swt.custom.StyledTextRenderer.getTextLayout(StyledTextRenderer.java:908) at org.eclipse.swt.custom.StyledTextRenderer.calculate(StyledTextRenderer.java:298) at org.eclipse.swt.custom.StyledText.redraw(StyledText.java:7846) at org.eclipse.swt.custom.StyledText.updateCaretVisibility(StyledText.java:11278) at org.eclipse.swt.custom.StyledText.handleResize(StyledText.java:6534) at org.eclipse.swt.custom.StyledText.lambda$28(StyledText.java:5939) at org.eclipse.swt.custom.StyledText$$Lambda$658/0x0000000800b21c40.handleEvent(Unknown Source) at org.eclipse.swt.widgets.EventTable.sendEvent(EventTable.java:89) at org.eclipse.swt.widgets.Display.sendEvent(Display.java:5895) at org.eclipse.swt.widgets.Widget.sendEvent(Widget.java:1515) at org.eclipse.swt.widgets.Widget.sendEvent(Widget.java:1541) at org.eclipse.swt.widgets.Widget.sendEvent(Widget.java:1520) at org.eclipse.swt.widgets.Control.setBounds(Control.java:1210) at org.eclipse.swt.widgets.Composite.setBounds(Composite.java:1657) at org.eclipse.swt.widgets.Canvas.setBounds(Canvas.java:459) at org.eclipse.swt.widgets.Control.setBounds(Control.java:1018) at org.eclipse.jface.text.source.SourceViewer$RulerLayout.layout(SourceViewer.java:163) at org.eclipse.swt.widgets.Composite.updateLayout(Composite.java:1876) at org.eclipse.swt.widgets.Composite.setBounds(Composite.java:1660) at org.eclipse.swt.widgets.Canvas.setBounds(Canvas.java:459) at org.eclipse.swt.widgets.Control.setBounds(Control.java:1018) at org.eclipse.swt.layout.FillLayout.layout(FillLayout.java:216) at org.eclipse.swt.widgets.Composite.updateLayout(Composite.java:1876) at org.eclipse.swt.widgets.Composite.setBounds(Composite.java:1660) at org.eclipse.swt.widgets.Control.setBounds(Control.java:978) at org.eclipse.swt.custom.StackLayout.layout(StackLayout.java:124) at org.eclipse.swt.widgets.Composite.updateLayout(Composite.java:1876) at org.eclipse.swt.widgets.Composite.setBounds(Composite.java:1660) at org.eclipse.swt.widgets.Control.setBounds(Control.java:1018) at org.eclipse.swt.layout.FillLayout.layout(FillLayout.java:216) at org.eclipse.swt.widgets.Composite.updateLayout(Composite.java:1876) at org.eclipse.swt.widgets.Composite.setBounds(Composite.java:1660) at org.eclipse.swt.widgets.Control.setBounds(Control.java:1018) at org.eclipse.swt.layout.FillLayout.layout(FillLayout.java:231) at org.eclipse.swt.widgets.Composite.updateLayout(Composite.java:1876) at org.eclipse.swt.widgets.Composite.updateLayout(Composite.java:1882) at org.eclipse.swt.widgets.Composite.updateLayout(Composite.java:1882) at org.eclipse.swt.widgets.Composite.updateLayout(Composite.java:1882) at org.eclipse.swt.widgets.Composite.updateLayout(Composite.java:1882) at org.eclipse.swt.widgets.Composite.updateLayout(Composite.java:1882) at org.eclipse.swt.widgets.Composite.updateLayout(Composite.java:1882) at org.eclipse.swt.widgets.Composite.updateLayout(Composite.java:1882) at org.eclipse.swt.widgets.Composite.updateLayout(Composite.java:1882) at org.eclipse.swt.widgets.Composite.updateLayout(Composite.java:1882) at org.eclipse.swt.widgets.Composite.setLayoutDeferred(Composite.java:1719) at org.eclipse.swt.widgets.Display.runDeferredLayouts(Display.java:5150) at org.eclipse.swt.widgets.Display.readAndDispatch(Display.java:4569) at org.eclipse.e4.ui.internal.workbench.swt.PartRenderingEngine$5.run(PartRenderingEngine.java:1154) at org.eclipse.core.databinding.observable.Realm.runWithDefault(Realm.java:338) at org.eclipse.e4.ui.internal.workbench.swt.PartRenderingEngine.run(PartRenderingEngine.java:1045) at org.eclipse.e4.ui.internal.workbench.E4Workbench.createAndRunUI(E4Workbench.java:155) at org.eclipse.ui.internal.Workbench.lambda$3(Workbench.java:644) at org.eclipse.ui.internal.Workbench$$Lambda$245/0x000000080049e040.run(Unknown Source) at org.eclipse.core.databinding.observable.Realm.runWithDefault(Realm.java:338) at org.eclipse.ui.internal.Workbench.createAndRunWorkbench(Workbench.java:551) at org.eclipse.ui.PlatformUI.createAndRunWorkbench(PlatformUI.java:156) at org.eclipse.ui.internal.ide.application.IDEApplication.start(IDEApplication.java:152) at org.eclipse.equinox.internal.app.EclipseAppHandle.run(EclipseAppHandle.java:203) at org.eclipse.core.runtime.internal.adaptor.EclipseAppLauncher.runApplication(EclipseAppLauncher.java:136) at org.eclipse.core.runtime.internal.adaptor.EclipseAppLauncher.start(EclipseAppLauncher.java:104) at org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseStarter.java:401) at org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseStarter.java:255) at [email protected]/jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at [email protected]/jdk.internal.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62) at [email protected]/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) at [email protected]/java.lang.reflect.Method.invoke(Method.java:566) at app//org.eclipse.equinox.launcher.Main.invokeFramework(Main.java:659) at app//org.eclipse.equinox.launcher.Main.basicRun(Main.java:596) at app//org.eclipse.equinox.launcher.Main.run(Main.java:1467) at app//org.eclipse.equinox.launcher.Main.main(Main.java:1440)

@MathiasZaja
Copy link

The problem exists with Eclipse 2021-06 too.
Eclipse hangs for about 10 - 15 minutes when I try to open bootstrap.min.css
It is really ennoying.
I hope one day it will be fixed.
Regards

@brbog
Copy link

brbog commented Jun 2, 2022

+1, I found this thread after running into the problem with opening a bootstrap.min.css as well.
Eclipse:
Version: 2022-03 (4.23.0)
Build id: 20220310-1457

org.eclipse.wildwebdeveloper.feature.feature.group:
Version: 0.10.12.202202041634

Also going for the workaround: "I am working around it by setting the default editor for all css files to the plain eclipse text editor."

@michael-knapp-j4care
Copy link

Still an annoying issue in

Eclipse IDE for Enterprise Java and Web Developers (includes Incubating components)
Version: 2023-12 (4.30.0)
Build id: 20231201-2043

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

5 participants