Konsole only redraws the terminal if the mouse is moving.

Bug #840708 reported by Robert Simmons
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
KDE Base
Fix Released
Medium
konsole (Ubuntu)
Confirmed
Undecided
Unassigned

Bug Description

Version: 2.7 (using KDE 4.7.0)
OS: Linux

If you have text constantly scrolling down a terminal window in Konsole, the
screen only redraws the scrolling text while there is mouse movement.

If you stop moving the mouse, the text stops.

On another machine that I tried this on, it is less pronounced, but still
happens off and on. On that machine, it will stop if you click outside the
window and only start again after moving the mouse over Konsole's window.

Reproducible: Always

Steps to Reproduce:
I have written a small c program that displays integers in sequence in an
infinite loop. You can seen the problem if you compile this program and run
the a.out in a konsole window.

Actual Results:
The text freezes and the Konsole window is not redrawn until you move the
mouse.

Expected Results:
Constantly scrolling text with no interuption.

OS: Linux (x86_64) release 2.6.38-11-generic
Compiler: gcc

I'm using Kubuntu 11.04 with KDE 4.7.0

Revision history for this message
In , Stefan Westerfeld (stefan-space) wrote :

Version: Konsole: 2.3.3 (using KDE 4.3.4)
OS: Linux
Installed from: Debian testing/unstable Packages

Running the following program within konsole:

#include <stdio.h>

int
main()
{
  for (int i = 0; i < 100000000; i++)
    {
      fprintf (stderr, "foo %d\n", i);
    }
}

leads to a freeze - not single message is printed - no reaction on return. Only after a long time (30 seconds) something happens.

If I run the same program in an xterm, the messages are scrolling through, as I would expect from that kind of output.

Revision history for this message
In , adaptee (adaptee) wrote :

*** Bug 253314 has been marked as a duplicate of this bug. ***

Revision history for this message
In , adaptee (adaptee) wrote :

In my observation, 'hang/freeze' is not quite accurate. Konsole will update its display, but not in a smooth and continuous way. Periodicaly, the display will pause for a few seconds , then it resumes with contents not continuous with previous one. And konsole will take high percent of CPU, 80% in my case.

That also applies to stdout.

Revision history for this message
In , adaptee (adaptee) wrote :

*** Bug 240561 has been marked as a duplicate of this bug. ***

Revision history for this message
Robert Simmons (rsimmons0) wrote :
Revision history for this message
In , Robert Simmons (rsimmons0) wrote :

*** Bug 281299 has been marked as a duplicate of this bug. ***

Revision history for this message
Robert Simmons (rsimmons0) wrote :

My original bug was a duplicate. This one is the main bug.

Changed in kde-baseapps:
importance: Unknown → Medium
status: Unknown → Confirmed
Revision history for this message
In , adaptee (adaptee) wrote :

might be related with bug 154550. See its comment #4.

adaptee (adaptee)
Changed in konsole (Ubuntu):
status: New → Confirmed
Revision history for this message
In , Simon Oosthoek (simon-margo) wrote :

I see this kind of behaviour too, but then specifically with very long lines (a sipXproxy.log). The lines span about 5-6 rows of my very wide konsole window. The same file scrolls very quickly in xterm.

It seems that konsole is taking up the entiry CPU and given the modern cgroup configuration in ubuntu 12.04, the remaining cpu doesn't get used for other windows... :-(

/Simon

Changed in kde-baseapps:
status: Confirmed → Unknown
Revision history for this message
In , Dv-b (dv-b) wrote :

I also see this. Using Kubuntu 16.04 here. For example, if GStreamer is installed, when I run this in konsole:

GST_DEBUG=2,*src*:9 gst-launch-1.0 fakesrc ! fakesink silent=false

then output will eventually no longer be printed. For a while, I can press the return key to manually "advance" the log output (perhaps this flushes something inside konsole?), but eventually, it reaches a point where the tab is completely frozen - I can scroll back, and copy text, but keyboard input no longer does anything, and the output is still. The only thing I can do then is to close that tab. This is highly annoying when debugging code, because sometimes, there can be lots of log output, which in turn sometimes triggers this bug.

Revision history for this message
In , Martin-sandsmark (martin-sandsmark) wrote :

Traced it down to QTimer stopping emiting timeout() after getting (re)start()-ed around 600-700 times on my system.

Revision history for this message
In , Martin-sandsmark (martin-sandsmark) wrote :

Looking at the Qt source, it might be a glib bug. Could maybe someone try with a non-glib Qt?

Revision history for this message
In , Martin-sandsmark (martin-sandsmark) wrote :

this is a glib bug (or less probably in the qt glib event thing), I'm unable to reproduce it with «QT_NO_GLIB=1 konsole»

Revision history for this message
In , Martin-sandsmark (martin-sandsmark) wrote :
Changed in kde-baseapps:
status: Unknown → Won't Fix
Revision history for this message
In , Martin-sandsmark (martin-sandsmark) wrote :

Git commit ac59cc7e007a3ef73a07f3d31d4a9516fd5f56f5 by Martin T. H. Sandsmark.
Committed on 16/07/2018 at 11:46.
Pushed by sandsmark into branch 'master'.

Fix hang on a lot of output from a program

Summary:
There is a bug in the Qt glib event loop leading to timers never being
able to deliver signals.

Work around this by disabling the glib event loop.

References:
http://lists.qt-project.org/pipermail/interest/2015-September/018846.html
https://bugreports.qt.io/browse/QTBUG-48344

Test plan:
>From the referenced bug:
    Stefan Westerfeld 2010-03-10 11:40:24 UTC
    Running the following program within konsole:

        #include <stdio.h>

        int
        main()
        {
          for (int i = 0; i < 100000000; i++)
            {
              fprintf (stderr, "foo %d\n", i);
            }
        }

    leads to a freeze - not single message is printed - no reaction on
    return. Only after a long time (30 seconds) something happens.

    If I run the same program in an xterm, the messages are scrolling
    through, as I would expect from that kind of output.

Reviewers: #konsole, hindenburg

Reviewed By: #konsole, hindenburg

Subscribers: hindenburg

Tags: #konsole

Differential Revision: https://phabricator.kde.org/D6078

M +8 -0 src/main.cpp
A +15 -0 tests/spam-stderr.c [License: UNKNOWN] *

The files marked with a * at the end have a non valid license. Please read: https://community.kde.org/Policies/Licensing_Policy and use the headers which are listed at that page.

https://commits.kde.org/konsole/ac59cc7e007a3ef73a07f3d31d4a9516fd5f56f5

Changed in kde-baseapps:
status: Won't Fix → Fix Released
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Bug attachments

Remote bug watches

Bug watches keep track of this bug in other bug trackers.