Bug 447455 - Blocks processes producing too much output when window not in active tty
Summary: Blocks processes producing too much output when window not in active tty
Status: REPORTED
Alias: None
Product: konsole
Classification: Applications
Component: emulation (show other bugs)
Version: 22.04.3
Platform: Gentoo Packages Linux
: NOR normal
Target Milestone: ---
Assignee: Konsole Developer
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2021-12-24 03:44 UTC by Daniel Dawson
Modified: 2022-12-18 13:02 UTC (History)
0 users

See Also:
Latest Commit:
Version Fixed In:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Daniel Dawson 2021-12-24 03:44:31 UTC
SUMMARY
If I switch to a different tty from the one a Konsole window is on, I find that any child processes producing output get blocked after a certain amount is produced.

STEPS TO REPRODUCE
1. Login on a virtual console (e.g. tty1).
2. Prepare a way to get output from a process. The way I did this was:
  $ mknod /tmp/test.pipe p
  $ cat /tmp/test.pipe
3. Start a graphical session, or switch back to one.
4. Start a terminal emulator, such as Konsole, and do something in it that both produces output on stdout, and sends it to the VC:
  $ for ((i=0;;i++)); do echo $i; sleep 0.005; done | tee /tmp/test.pipe  # sleep is optional, but recommended.
5. Switch back to the VC, and watch the output.

OBSERVED RESULT
When using Konsole, after a couple thousand lines, the output pauses. Only once I switch back to the graphical session, does output continue. I tried this also with xterm and LXTerminal (since they happen to be installed), and this behavior does not occur with them (unless their buffers are just really huge).

EXPECTED RESULT
Not being in the active tty should, I believe, not affect child processes simply because of their terminal output. This is a problem if running an application under Konsole that's doing something important while writing to stderr/stdout.

SOFTWARE/OS VERSIONS
Linux/KDE Plasma: 5.15.0-gentoo (64-bit) [custom config]
(available in About System)
KDE Plasma Version: 5.23.4
KDE Frameworks Version: 5.89.0
Qt Version: 5.15.2

ADDITIONAL INFORMATION
A workaround seems to be to run things that need to avoid being blocked under something like screen or tmux, since they take over as the controlling terminal, and keep running even if their front-end disappears.
Comment 1 Daniel Dawson 2021-12-27 15:09:32 UTC
Correction: kernel version is 5.15.10-gentoo.
Comment 2 shfbsdbvf 2022-12-18 13:02:39 UTC
I have the same problem, but I'm not sure if it's related to output. I start a build, switch to tty, running compiler processes work fine till they finish building file, but new processes are not started by "make". If I switch back to desktop, (amount of cpu cores) compiler processes are immediately started and building proceeds fine. Checked it in xterm on plasma and xterm on openbox and everything was fine. In konsole on plasma and konsole on openbox the issue was happening, so I think the problem is with konsole. The workaround is to minimize konsole window before switching to tty.