Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.

Bug 436762

Summary: Eclipse hangs when Ant Builder prints long line with Exception subclasses
Product: [Eclipse Project] JDT Reporter: Timo Kinnunen <timo.kinnunen>
Component: DebugAssignee: JDT-Debug-Inbox <jdt-debug-inbox>
Status: CLOSED WONTFIX QA Contact:
Severity: normal    
Priority: P3    
Version: 4.4   
Target Milestone: ---   
Hardware: PC   
OS: Windows 8   
Whiteboard: stalebug
Attachments:
Description Flags
Ant build-file showing the problem
none
Annotated Java VisualVM screenshot of the bug none

Description Timo Kinnunen CLA 2014-06-05 19:24:55 EDT
Created attachment 244022 [details]
Ant build-file showing the problem

A Worker thread takes a long time to finish processing if a long line containing a classpath-like string of paths to classes is output to the console. The lines that show the problem look like these, expect much longer:

        [echo] final   : test-3\plugins\plugin-2\org\p2\Plugin2.class
        [echo] final2  : test-0\plugin-2\src\org\p2\Plugin2.java;test-3\plugins\plugin-2\org\p2\Plugin2.class;test-9\plugins\plugin-2\org\p2\Plugin2.class

With about 600 class names on one line the thread takes almost 2 minutes to complete on my computer.

If Ant Builder is the one doing the console output then in addition the whole UI freezes for the duration, which is how I discovered the problem. The stack trace looks like this:


"Worker-17" - Thread t@57
   java.lang.Thread.State: RUNNABLE
	at java.util.regex.Pattern$CharProperty.match(Unknown Source)
	at java.util.regex.Pattern$Curly.match0(Unknown Source)
	at java.util.regex.Pattern$Curly.match(Unknown Source)
	at java.util.regex.Pattern$BmpCharProperty.match(Unknown Source)
	at java.util.regex.Pattern$Start.match(Unknown Source)
	at java.util.regex.Matcher.search(Unknown Source)
	at java.util.regex.Matcher.find(Unknown Source)
	at org.eclipse.ui.internal.console.ConsolePatternMatcher$MatchJob.run(ConsolePatternMatcher.java:131)
	at org.eclipse.core.internal.jobs.Worker.run(Worker.java:54)

I took a memory dump at the time, too. Examining the memory dump revealed that only 2 Matchers were alive at the time, one of them containing this regular expression: \w[^\(\s]+Exception[\s|:]

To reproduce, execute the attached Ant build-file and observe the executing threads in Java VisualVM.

There is also Bug 298122 - Exceptions in Console view are incorrectly underlined
Comment 1 Timo Kinnunen CLA 2014-06-05 19:42:36 EDT
Created attachment 244023 [details]
Annotated Java VisualVM screenshot of the bug
Comment 2 Eclipse Genie CLA 2019-07-08 03:23:22 EDT
This bug hasn't had any activity in quite some time. Maybe the problem got resolved, was a duplicate of something else, or became less pressing for some reason - or maybe it's still relevant but just hasn't been looked at yet.

If you have further information on the current state of the bug, please add it. The information can be, for example, that the problem still occurs, that you still want the feature, that more information is needed, or that the bug is (for whatever reason) no longer relevant.

--
The automated Eclipse Genie.