Bug 548600 - Console view stops updating randomly processing large input
Summary: Console view stops updating randomly processing large input
Status: CLOSED WONTFIX
Alias: None
Product: Platform
Classification: Eclipse Project
Component: Debug (show other bugs)
Version: 4.12   Edit
Hardware: PC Linux
: P3 major (vote)
Target Milestone: ---   Edit
Assignee: Platform-Debug-Inbox CLA
QA Contact:
URL:
Whiteboard: stalebug
Keywords: needinfo
Depends on:
Blocks:
 
Reported: 2019-06-25 02:40 EDT by Bing-Yi Wong CLA
Modified: 2021-06-24 00:11 EDT (History)
3 users (show)

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Bing-Yi Wong CLA 2019-06-25 02:40:38 EDT
Sometimes the console view just stops updating.  Seems like the console view does not flush out the stdout somehow.  My application writes a log file, and I can see the log file is still being written continuously.  And if I terminate my application, the remaining stdout is then flushed out to the console view.

I have tried different version of gdb and/or java.  Doesn't look relevant.

I can reproduce this bug almost every time on a certain test data, but I can't  use it here.  Alternatively, it may be reproduced by an infinite loop like this (limit a console buffer size if necessary):

    for (int i = 0; ; ++i) {
        printf("%d", i);
        for (int j = 0; j < 90; ++j) printf("0");
        printf("\n");
    }

On my machine, it stops updating at about 18000000 loops.  I guess it will stop eventually if you just let it run and wait for a while.

The system is CentOS x64 7.1.1503, glibc 2.17, and GTK 3.22.30.

I don't see this bug in 2019-03.
Comment 1 Bing-Yi Wong CLA 2019-06-25 02:48:18 EDT
gdb function works as usual after the console view stops updating.  I can still do pause, next, step, check call stack, etc.
Comment 2 Jonah Graham CLA 2019-06-25 16:08:08 EDT
I have tried running this with eclipse for C/C++ from EPP on Linux with all the defaults (including default 80000 character console limit) but I have show heap status on. I am running on Ubuntu 18.04 with GNU gdb (Ubuntu 8.1-0ubuntu3) 8.1.0.20180409-git. After 36563765 iterations it is still working. I'll leave it running longer to see what happens - but if you have anymore details on what you did that could be helpful.
Comment 3 Jonah Graham CLA 2019-06-25 22:08:45 EDT
I am now at 1498106970 iterations and all is good. I will follow up when I can get some more info.
Comment 4 Bing-Yi Wong CLA 2019-06-25 22:12:30 EDT
I also have show heap status on.  I tried gdb 7.10, 7.12, and 8.1.  And system default java openjdk 1.8.0_191-b12, and OpenJ9 java 11.0.3+7 and 12.0.1+12 with -Xms256m -Xmx2048m -Xquickstart -XX:+IdleTuningGcOnIdle .  Same setting on 2019-03.

Curiously, when I pause this simple application, the stack seems always here:
Thread #1 [helloworld] 14595 [core: 3] (Suspended : Signal : SIGINT:Interrupt)	
	__write_nocancel() at 0x7ffff7268840	
	_IO_new_file_write() at 0x7ffff71f4fb3	
	__GI__IO_do_write() at 0x7ffff71f641c	
	__GI__IO_file_overflow() at 0x7ffff71f67f3	
	putchar() at 0x7ffff71edc6e	
	main() at helloworld.cpp:18 0x400702	

I am thinking, is it possible that the console view serves the application as its stdout, and some error happens during high speed IO and then this redirection is stuck?

Is there any change on console view from 2019-03 to 2019-06 which may affect this part?
Comment 5 Bing-Yi Wong CLA 2019-06-25 22:15:14 EDT
I just have another two runs, one stoped at 18xxxxxx, one stoped at 39096407.
Comment 6 Bing-Yi Wong CLA 2019-06-25 22:28:28 EDT
It is not even relevant to gdb.  I tried using just Run rather than Debug, it still stopped at 9312359 iterations.
Comment 7 Bing-Yi Wong CLA 2019-06-25 22:40:09 EDT
I closed eclipse after the application was stopped updating console.  Then I found the java and eclipse processes are still running, and java is even consuming 100% CPU.  pstack java shows many threads in this stack:

#0  0x00007ff24dee7945 in pthread_cond_wait@@GLIBC_2.3.2 () at /lib64/libpthread.so.0
#1  0x00007ff24cdc757b in os::PlatformEvent::park() () at /usr/lib/jvm/java-1.8.0-openjdk-1.8.0.191.b12-1.el7_6.x86_64/jre/lib/amd64/server/libjvm.so
#2  0x00007ff24cdace2d in ObjectMonitor::wait(long, bool, Thread*) () at /usr/lib/jvm/java-1.8.0-openjdk-1.8.0.191.b12-1.el7_6.x86_64/jre/lib/amd64/server/libjvm.so
#3  0x00007ff24cf38c0e in ObjectSynchronizer::wait(Handle, long, Thread*) () at /usr/lib/jvm/java-1.8.0-openjdk-1.8.0.191.b12-1.el7_6.x86_64/jre/lib/amd64/server/libjvm.so
#4  0x00007ff24cbc1d36 in JVM_MonitorWait () at /usr/lib/jvm/java-1.8.0-openjdk-1.8.0.191.b12-1.el7_6.x86_64/jre/lib/amd64/server/libjvm.so
Comment 8 Jonah Graham CLA 2019-06-26 11:42:52 EDT
Since you are hitting a problem even when using Run, can you reproduce the problem with a similar Java program. The console is something provided by the Eclipse Platform, and I don't know what changes are in there. If you can reproduce withouth CDT involved that would be great.

If the Java is a problem, can you reproduce like this. Build your program, make sure it works past the failure point you are observing fully outside of Eclipse (e.g. in a terminal). And if so, run the program as an External Tool (let me know if you need instructions for any of this).
Comment 9 Bing-Yi Wong CLA 2019-06-26 22:45:03 EDT
I just reproduced this with a Java application!  It can be reproduced using Run or External Tool.  Not sure how often it can be reproduced...

The code is like this:
	for (int i = 0; ; ++i) {
		System.out.print(i);
		for (int j = 0; j < 90; ++j) System.out.print('0');
		System.out.println();
	}

I'll change the Product field to Platform.
Comment 10 Jonah Graham CLA 2019-06-27 07:29:15 EDT
Thanks for continuing to investigate. I have reset assignees.
Comment 11 Andrey Loskutov CLA 2019-07-03 09:16:08 EDT
I can't reproduce with 4.13 master. How long your endless example should run to break console?
Do you have set any limits on the console output?
Comment 12 Bing-Yi Wong CLA 2019-07-04 22:56:38 EDT
Sometimes it begins to hang very quickly, while sometimes it takes a long time.  The fastest one I got was at only about 40000 loops (the java example).

I set console limit to 80000 as default.  Not sure if this is necessary.

It usually happens when console update getting slow.  On my machine, using OpenJ9 java 12 is much easier to reproduce than 11 or system default 1.8, as OpenJ9 12 is somehow slower.

I suspect the issue happens when java cannot flush out stdout quickly enough.  It probably yields a buffer overflow error or something and then it just stops flushing.
Comment 13 Bing-Yi Wong CLA 2019-07-04 23:05:04 EDT
I just tried again and it hanged at loop 79161 in less than 1 minute. Using system default openjdk 1.8.0.191 for both eclipse and the java example.
Comment 14 Eclipse Genie CLA 2021-06-24 00:11:34 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. As such, we're closing this bug.

If you have further information on the current state of the bug, please add it and reopen this bug. 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.