Bug 407429 - Copy&paste stops working after some longer uptime
Summary: Copy&paste stops working after some longer uptime
Status: RESOLVED UPSTREAM
Alias: None
Product: kate
Classification: Applications
Component: general (other bugs)
Version First Reported In: unspecified
Platform: Other Linux
: NOR normal
Target Milestone: ---
Assignee: KWrite Developers
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2019-05-11 13:48 UTC by nfxjfg
Modified: 2019-09-12 08:10 UTC (History)
2 users (show)

See Also:
Latest Commit:
Version Fixed In:
Sentry Crash Report:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description nfxjfg 2019-05-11 13:48:25 UTC
SUMMARY

After some longer uptime, copy&paste suddenly stops working. It gets into a state where you can observe the following things:
- copying text doesn't write it to the clipboard, the clipboard contents remain untouched (although the "copied" text is added to kate's clipboard history menu)
- pasting text from other applications still works

This just happens on its own after weeks of process uptime. I didn't try any version after 18.03.70 - because that's the build I use mainly, and I have no known or short way of reproducing. It happened in the past too, though I don'T know how far back.

It's entirely possible that updates in the background cause it. But from my vague memory, it seemed to be independent from that (I trigger updates manually; also I'm using debian unstable, which hadn't a lot of updates recently).

A new kate process is always fine. I work this issue around by closing the affected kate process, starting a new process, and loading the old session.

It doesn't seem to matter whether the process was used recently or whether it was just sitting somewhere minimized.

STEPS TO REPRODUCE
- Unknown.

OBSERVED RESULT


EXPECTED RESULT


SOFTWARE/OS VERSIONS
Windows: 
macOS: 
Linux/KDE Plasma: no/yes
(available in About System)
KDE Plasma Version: no
KDE Frameworks Version: 5.54.0
Qt Version: 5.11.3

ADDITIONAL INFORMATION

I'm not running a DE, just icewm on X11, with some standard debian session management scripts. Other non-KDE/Qt applications are never affected.
Comment 1 Christoph Cullmann 2019-05-22 15:07:25 UTC
Hmm, it is bad that this happens, thought I am not sure how we shall debug this.

We only call 

QApplication::clipboard()->setText(view()->selectionText(), QClipboard::Selection);

for selection

and

QApplication::clipboard()->setText(text, QClipboard::Clipboard);

for clipboard.

Without any large code around that e.g. would be "time" dependent or "count" stuff.
Comment 2 Christoph Feck 2019-05-22 21:57:29 UTC
Could be related to 32 bit overflow of X11 time handling. I think there is an open Qt bug about it.
Comment 3 Christoph Feck 2019-05-22 21:59:41 UTC
Correction: a fixed Qt bug. https://bugreports.qt.io/browse/QTBUG-65145

Please test Qt 5.12.3.
Comment 4 nfxjfg 2019-05-23 09:31:24 UTC
Looks like a good bet that it's exactly this bug. I don't normally run other Qt applications for so long, so I noticed it only on Kate.

Unfortunately, my distro (Debian unstable) is still on an old Qt version. I'll report back as soon as they update, and 50 days have passed. I don't mind if someone closes this bug before that.
Comment 5 Christoph Cullmann 2019-06-08 15:23:08 UTC
I will close this as fixed upstream.
If you encounter the issue again after you got an up-to-date version of Qt, feel free to reopen it.
Comment 6 ilisepe1 2019-09-12 08:10:00 UTC
A bit more information:
This problem is not only related with Kate, but basically with any other program. I can confirm that Konsole also has the same problem. But let me give describe the problem a bit more:

If you have a konsole running for a "long" period of time, for about 100 days, then copy/paste stops working, inside the konsole's tab AND to any konsole tab. If you start a new konsole window with keyboard shortcut (ctrl+shift+n), the problem is NOT resolved in this new konsole window. However if you start a new konsole (ie by clicking the konsole icon), copy/paste works in this new konsole window.

Above it tested on kubuntu 18.10, but same problem noticed for previous versions too.
Last known (to me) kubuntu version that this problem did NOT happen was 14.04.