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

Bug 336104

Summary: Search results tree broken when displaying long lines
Product: [Eclipse Project] Platform Reporter: christophe.paris
Component: SWTAssignee: Platform-SWT-Inbox <platform-swt-inbox>
Status: CLOSED WORKSFORME QA Contact:
Severity: major    
Priority: P3 CC: daniel_megert, eclipse.felipe, mark.booth, peter, privat, timezra, xixiyan
Version: 3.6.1   
Target Milestone: ---   
Hardware: PC   
OS: Linux   
Whiteboard:
Attachments:
Description Flags
Search view before expansion (bug 336104)
none
Search view after expansion (bug 336104)
none
Long line file search good none

Description christophe.paris CLA 2011-02-02 12:16:37 EST
Build Identifier: 20100917-0705

When a file with a very long lines exists in you project and is included in your search results, the results tree is broken. The tree is build with white label and a huge horizontal scroll bar is displayed.
Any other search is broken after that, the only way to fix it is to restart eclipse.

Reproducible: Always

Steps to Reproduce:
1. Create a file with a very long line in your project (more than 6000 characters)
   eg: for i in $(seq 1 800) ; do echo -n "hello$i" >> hello.txt ; done
2. In the menu choose : "Search>File"
3. Search for some text included in the file just created (eg: hello)
Comment 1 Dani Megert CLA 2011-02-03 02:04:22 EST
Most likely an SWT issue or OS limitation.
Comment 2 Mark Booth CLA 2011-05-18 07:40:58 EDT
Created attachment 195952 [details]
Search view before expansion (bug 336104)
Comment 3 Mark Booth CLA 2011-05-18 07:41:23 EDT
Created attachment 195953 [details]
Search view after expansion (bug 336104)
Comment 4 Mark Booth CLA 2011-05-18 07:46:20 EDT
Note, the corruption only appears to occur when you expand the search element which contains the long line, see attached screen shots. 

Hopefully this will help in tracking down this problem. On average, this problem causes me to have to restart Helios 2 to 3 times per day, which is rather annoying.
Comment 5 Felipe Heidrich CLA 2011-05-18 09:50:03 EDT
This is an OS limitation.
Comment 6 Mark Booth CLA 2011-05-18 10:55:36 EDT
Does that mean this can't be fixed, won't be fixed, or that we need to report this as a bug elsewhere? If so, where?
Comment 7 Timo A. Hummel CLA 2011-08-23 04:39:10 EDT
Even if it is an OS limitation, which I doubt, a workaround should be easy: Don't put the whole line length into the tree.

Instead of writing megabytes of data in the search results, strip the search results to a specific length (probably append something like [long line has been stripped].

Also, trying to open a file with a very long line also causes eclipse to hang. No matter if this is an OS issue or not, this needs to be adressed in whatever way. Hangs are a no-go in any case!
Comment 8 Dani Megert CLA 2012-07-05 04:03:35 EDT
*** Bug 384296 has been marked as a duplicate of this bug. ***
Comment 9 Dani Megert CLA 2014-05-07 17:00:54 EDT
*** Bug 434360 has been marked as a duplicate of this bug. ***
Comment 10 Dani Megert CLA 2014-05-28 03:43:59 EDT
*** Bug 436004 has been marked as a duplicate of this bug. ***
Comment 11 Xi Yan CLA 2018-08-24 16:32:35 EDT
Created attachment 275531 [details]
Long line file search good

I cannot reproduce the issue. Please reopen this ticket if the issue reoccurs. 

Eclipse SDK
Version: 2018-09 (4.9)
Build id: I20180823-0450
OS: Linux, v.4.17.12-200.fc28.x86_64, x86_64 / gtk 3.22.30
Java version: 1.8.0_181