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

Bug 87299

Summary: Eclipse crashes when to much is written to a single line of the Console
Product: [Eclipse Project] Platform Reporter: Kevin Stedman <kstedman9>
Component: SWTAssignee: Felipe Heidrich <eclipse.felipe>
Status: RESOLVED WONTFIX QA Contact:
Severity: normal    
Priority: P3 CC: alexeys, andreas, billy.biggs, c1234, cedster, daniel_megert, david.perez.ingeniero, eric, fvogt, gheorghe, hauser, hendrik, jed, karltk, kleinhenz, milianwolff, mlists, muntyan, snorthov, snpe, tim.morrow, u1305_00, veronika_irvine, zorzella
Version: 3.1   
Target Milestone: ---   
Hardware: PC   
OS: Linux-GTK   
Whiteboard:
Attachments:
Description Flags
Screenshot of console with very long line.
none
threaddump during 100%cpu usage when outputting long line to console
none
same phenomenon in text editor none

Description Kevin Stedman CLA 2005-03-07 13:31:52 EST
When using System.out.print to write to the Console tab in Eclipse, if you write
to many characters (approximately 200,000)  it will crash Eclipse with a
Segmentation Fault.

Here is a simple example that crashes my Eclipse everytime:

for (int y = 0; y < 20000; y++) {
	for (int x = 0; x < 10; x++ ) {
		System.out.print(x);
	}
}

The core file from the crash shows it received a Segmentation Fault in the
function "fribidi_analyse_string".   If you need a core file I can repeat the
problem and provide it at anytime.
Comment 1 Kevin Barnes CLA 2005-03-07 14:49:37 EST
possibly a bug in Text? Code doesn't crash Eclipse on mac. Don't have a Solaris box to test on. Moving 
to SWT for comment.
Comment 2 Veronika Irvine CLA 2005-03-08 16:04:20 EST
Billy, please investigate and advise.
Comment 3 Karl Trygve Kalleberg CLA 2005-11-05 08:07:33 EST
This also happens on my x86 laptop running Ubuntu breezy, xorg-x11 6.8.2-77, Sun
JDK 1.5.0_05, gtk 2.8.6-0ubuntu2, while running some JUnit test which produce a
lot of output to the Console. Problem persists with JDK 1.5.0_05, and is
reproducible with both Eclipse 3.1 and 3.1.1

Closing the Console before running the JUnit tests does not help, as it is
automatically reopened, but minimizing it avoids the problem. The instant before
crashing, the second line of the Console is overwritten multiple times with
text, as if proper line breaking does not take place. 

The problem is quite recent for me, and may coincide with an upgrade I did from
 Hoary to Breezy.

Comment 4 Karl Trygve Kalleberg CLA 2005-11-05 08:30:38 EST
If I limit myself to less than about 100000 characters per line, I get the
following error. If I print significantly more than 100000 characters per line,
I only get the two first lines of this error:

The program 'Eclipse' received an X Window System error.
This probably reflects a bug in the program.
The error was 'BadDrawable (invalid Pixmap or Window parameter)'.
  (Details: serial 440174 error_code 9 request_code 66 minor_code 0)
  (Note to programmers: normally, X errors are reported asynchronously;
   that is, you will receive the error a while after causing it.
   To debug your program, run it with the --sync command line
   option to change this behavior. You can then get a meaningful
   backtrace from your debugger if you break on the gdk_x_error() function.)

If I set the limit somewhat less than 30000, it stops crashing altogether. 
Comment 5 Stephen Summerfield CLA 2005-11-24 10:58:01 EST
(In reply to comment #1)
> possibly a bug in Text? Code doesn't crash Eclipse on mac. Don't have a Solaris
> box to test on. Moving 
> to SWT for comment.

I get weird things happening with the console on the Mac, when printing long lines eg:

    public static void main(String[] args)
    {
        System.out.print("Counting");
        StringBuffer buffer = new StringBuffer();
        for (int i=0; i<28504; i++)
        {
            buffer.append("*");
        }
        System.out.print(" some more");
        System.out.println(buffer);
        System.out.println("Complete");
    }

The output I get from this is as follows:
Counting some 
Complete

ie the long string of '*' isn't displayed and overwrites part of the preceding output.

Steve
Comment 6 Billy Biggs CLA 2006-01-12 03:11:14 EST
*** Bug 120983 has been marked as a duplicate of this bug. ***
Comment 7 Darin Wright CLA 2006-01-12 09:42:39 EST
*** Bug 123528 has been marked as a duplicate of this bug. ***
Comment 8 Darin Wright CLA 2006-01-18 10:53:37 EST
*** Bug 116596 has been marked as a duplicate of this bug. ***
Comment 9 Hendrik Maryns CLA 2006-02-22 05:25:08 EST
Can confirm this on Suse 10.0 with Version: 3.2.0 Build id: I20051215-1506 and java version "1.5.0_06"
Java(TM) 2 Runtime Environment, Standard Edition (build 1.5.0_06-b05)
Java HotSpot(TM) Client VM (build 1.5.0_06-b05, mixed mode, sharing)
A quick solution is to tell the console to break after a specific line width in the run menu.
Comment 10 Hendrik Maryns CLA 2006-03-08 07:47:50 EST
Created attachment 35904 [details]
Screenshot of console with very long line.

This is a screenshot of the console if I print a very large Collection to it.  If I make it even larger (i.e. from a set which contains 1024 elements, each of string length about 16 chars, so a total length of about 18450, to a set of 3515), it crashes.
Some quick testing gave me that a string of length 8000 gives no problem, whereas 8500 makes the chars to become scrambled (written over each other).  Then until 21000 the same, and from 22000, Eclipse crashes.
Comment 11 Billy Biggs CLA 2006-03-23 14:44:11 EST
There are clearly a couple of ways we can crash on long strings, potentially bugs in pango/fribidi (the original report), and also through crashing X due to creating widgets past the maximum size constraints.  I'm using this bug to track both issues.
Comment 12 Billy Biggs CLA 2006-03-23 14:44:36 EST
*** Bug 23270 has been marked as a duplicate of this bug. ***
Comment 13 Billy Biggs CLA 2006-03-23 14:45:31 EST
*** Bug 132710 has been marked as a duplicate of this bug. ***
Comment 14 Konrad Steinmuller CLA 2006-03-23 17:32:13 EST
A workaround if this is annoying the hell out you!

Open up Window -> Preferences
Run/Debug -> Console

Select fixed width console, Maximum character width 80 (or whatever is appropriate).

Stops the worst of the problem, but I don't think the problem is confined to the console. Same issue happens everywhere eclipse tries to print really long strings.
Comment 15 Billy Biggs CLA 2006-04-04 16:31:19 EDT
*** Bug 124789 has been marked as a duplicate of this bug. ***
Comment 16 Billy Biggs CLA 2006-04-04 16:33:31 EDT
*** Bug 128649 has been marked as a duplicate of this bug. ***
Comment 17 Milian Wolff CLA 2006-06-27 11:14:15 EDT
I'm not sure if I should create a new bug report but I encounter just the same bug but in a normal editor (not the console), when I open a file with lots of contents in one line.

First I see it normally but as soon as I try to scroll my system crashes completly (hard freeze, restart required).

These are the last few lines in my .metadata/.log: http://nopaste.php-q.net/221891

I'm using 3.1.2 with some plugins (subclipse, php and webdev mainly) and this bug happens in different editors in eclipse. System: kubuntu dapper with java-sun-1.5.0_06
Comment 18 Jed Wesley-Smith CLA 2006-07-03 22:44:10 EDT
(In reply to comment #14)
> A workaround if this is annoying the hell out you!
> 
> Open up Window -> Preferences
> Run/Debug -> Console
> 
> Select fixed width console, Maximum character width 80 (or whatever is
> appropriate).

running Eclipse v3.2 on Ubuntu (dapper drake) I can confirm that this still exists and that this workaround fixes the hang. For me Eclipse consumes 100% cpu and never returns. Will attach a thread dump.

cheers,
- jed.
Comment 19 Jed Wesley-Smith CLA 2006-07-03 22:50:11 EDT
Created attachment 45684 [details]
threaddump during 100%cpu usage when outputting long line to console

first time I tried to attach this it ended up on another bug entirely :-(
Comment 20 Jed Wesley-Smith CLA 2006-07-04 22:27:00 EDT
Not entirely sure, but http://bugzilla.gnome.org/show_bug.cgi?id=127731 would seem to be the problem. I get the same behaviour in gedit with long lines. It seems longer lines show exponentially worse behaviour.
Comment 21 Veronika Irvine CLA 2006-07-05 16:19:30 EDT
Moving to Felipe to investigate.
Comment 22 Steve Northover CLA 2006-07-06 13:51:00 EDT
This looks like a WONTFIX to me.  I can't see how we can know in advance which operating systems crash when passed a long line.
Comment 23 Grant Gayed CLA 2006-09-25 15:22:25 EDT
*** Bug 158289 has been marked as a duplicate of this bug. ***
Comment 24 Grant Gayed CLA 2006-09-25 15:23:29 EDT
from bug 159289:

This only happens with the nvidia-drivers in eclipse. When I am using the
vesa-driver, this doesn't happen, although the debug-line doesn't get displayed
correctly either. It also doesn't happen, when running the application
standalone and watching the output in a shell window.

Here is some information about my setup.
OS:      Gentoo Linux
Kernel:  Linux 2.6.17-gentoo-r4
X:       xorg-x11 7.1
nVidia:  nvidia-drivers 1.0.8774
Eclipse: Version: 3.2.0 Build id: M20060629-1905
Comment 25 Andreas Schildbach CLA 2006-09-25 15:43:59 EDT
I am using Ubuntu with an Intel i915GMS, so it can't be limited to NVidia.
Comment 26 Felipe Heidrich CLA 2006-09-26 11:26:05 EDT
On my machine it draws garbage but it doesn't crash.
It is a Fedora Core 5, gtk 2.8.20, video card NVIDIA Quadro FX 1400, I'm using the "nv" driver from the dist (not "nvidia" from Nvidia).

I'll do some work search in this area but probably this problem will be marked as WONTFIX.
Comment 27 Felipe Heidrich CLA 2006-09-26 16:39:29 EDT
I installed the "nvidia" drive from NVIDIA and now it crashes.
Comment 28 Ismael Juma CLA 2006-10-22 05:10:59 EDT
The following seems to explain the issue(s):
 http://nvidia.custhelp.com/cgi-bin/nvidia.cfg/php/enduser/std_adp.php?p_faqid=1971
Comment 29 Felipe Heidrich CLA 2006-10-23 10:52:22 EDT
Thanks for the link Ismael.
Comment 30 Andreas Schildbach CLA 2006-10-23 13:08:01 EDT
As I wrote, this problem is not dependant on the chipset or graphics driver used. Why is this bug marked WONTFIX? It should certainly be fixed!
Comment 31 Ismael Juma CLA 2006-10-23 23:53:42 EDT
The nvidia link explained that there were two separate issues that caused similar behaviour. One was an XFree86/X.Org server bug and another was an nvidia driver's bug. In the former case, you don't need an nvidia driver at all. Having said this, it could be that you're seeing a third problem with the same symptoms. The easiest way to check is to see if the X.Org server version you are using already contains the fix for the problem mentioned on that link.
Comment 32 Heinz Stüßer CLA 2006-10-28 07:40:43 EDT
(In reply to comment #25 and comment #30)

I've had the same problem (on Suse 9.1) but could fix it (the crash of the X-Server) by upgrading the nvidia-driver to 1.0.8776.

Nevertheless I propose to reopen the issue (and maybe to change the severity to "enhancement"). 
The behavior of the console and editor windows in the present isn't really acceptable. IMHO both should insert some linebreaks, because the garbage produced in the output by very long lines isn't readable and that should be fixed.

Heinz

P.S.: Thanks to Ismael for the link in comment #28.
Comment 33 Grant Gayed CLA 2006-11-03 09:42:50 EST
*** Bug 163299 has been marked as a duplicate of this bug. ***
Comment 34 Hendrik Maryns CLA 2007-05-24 11:35:18 EDT
Created attachment 68593 [details]
same phenomenon in text editor

I propose to reopen this as well, since not only the console seems to have this problem.  If I save/redirect the console output which shows this behavior to a file and open that file with eclipse, the text editor has the same problem.

Versie: 3.2.0
Build-ID: M20070212-1330
Comment 35 Hendrik Maryns CLA 2007-05-25 03:44:19 EDT
I also noticed that the editor quit with an OOME when I tried to open a similar file as in the screenshot above.  It only has 70Mb, but very long lines.
Comment 36 Dani Megert CLA 2007-05-25 03:52:53 EDT
> It only has 70Mb, but very long lines.
Sorry, but that's not "only". It's quite big and I wonder how you would edit such a large file. This is currently not well supported (see related bugs in Platform Text).
Comment 37 Steve Northover CLA 2007-05-25 16:18:29 EDT
*** Bug 122964 has been marked as a duplicate of this bug. ***
Comment 38 Eric Bodden CLA 2007-05-25 16:36:06 EDT
For me things seem to be even worse, not just crashing Eclipse but the whole X server. This is on Ubuntu and occurs when I select certain objects in the debugger  that happen to print lots of output using their toString() method.
Comment 39 Yevgen Muntyan CLA 2007-11-22 19:00:13 EST
Can someone still reproduce this bug? If yes, could you please get a backtrace and post it at http://bugzilla.gnome.org/show_bug.cgi?id=127731
Comment 40 Felipe Heidrich CLA 2009-08-28 09:21:46 EDT
*** Bug 287924 has been marked as a duplicate of this bug. ***