Desktop freezes at random

I’m having a problem where the desktop will just lockup at random, although it usually seems to happen if I have a VM running under KVM.
I just experiences a lockup and rebooted to check the system logs, and it froze up again while I was trying to read through the logs. Right before it freezes, I get a message similar to this in the logs:

QXcbConnection: XCB error: 3 (BadWindow), sequence: 4103, resource id: 62914560, major code: 18 (ChangeProperty), minor code: 0

When I was running the VM, the error message was:

QXcbConnection: XCB error: 2 (BadValue), sequence: 26016, resource id: 67108972, major code: 142 (Unknown), minor code: 3

If anyone has any insight as to what might be causing this, please let me know, it’s getting frustrating. Also, I cannot open another tty instance when this happens either. Although, the pointer cursor is still visible and able to move, but everything else freezes. Thanks.

I experience something like that with Leap 42.3. It started happening after “firefox” updated to a quantum version (58.* or 59.* or similar). As best I could tell, firefox is now a memory hog.

Since then I have greatly reduced the problem by changing how I use my system. Mostly, I have reduced the amount of memory that I use. I’ll often shutdown a browser before I fire up a KVM virtual machine, so that I am less likely to run into memory problems.

In summary: “firefox” is a memory hog. A KVM virtual machine can also use a lot of memory (depending on the assigned memory size). To many heavy memory users at one time can cause problems.

I’m doubting that those XCB messages are important. I see a lot of those, and they do not seem to indicate problems.

My reply might solve your problem, but it at least gives a hint at what someone else is seeing.

Are you using Plasma? It sounds like the exact thing that inspired me try other desktop environments.
You could try IceWM or openBox for a day or two – or XFCE for a full lightweight alternative.

Yes I am using plasma. I haven’t had a problem with it until the last couple weeks, and I’ve been using plasma the entire time I’ve had Leap 15 installed. I don’t recall installing any new programs or anything over that time, and the error logs are not helpful. One thing I did notice though is that the systemd logs are about 6 minutes ahead of the time shown on the desktop. Any reason that would be the case?

Also, this problem mostly seems to occur when I’m running a 32bit version of windows in a VM. The 64bit guest OSes don’t appear to be causing a problem. Any idea why that might be the case? I have the guest architecture set to i686.

I may try xfce is the freezes continue, to see if it makes a difference. Xfce is probably my second favorite desktop behind plasma, I just tend to use aspects of plasma more often. Thanks for the input so far.

Those QXcbConnection: XCB errors are a known problem about which apparently nothing can be done except at the QT level:
https://bugs.kde.org/show_bug.cgi?id=366421
https://bugreports.qt.io/browse/QTBUG-55167.

This has happened a couple more times in the past two days, always with a 32bit windows 10 guest running. This time though, I just left the system a bit longer to see what would happen. First, only a few windows on the desktop (plasma) became unresponsive, then eventually they all froze with the exception of the mouse pointer. Then after about 1 or 2 minutes, the mouse pointer froze as well and the caps lock began flashing indicating a kernel panic. I powered off the computer and rebooted. Here is the log from before the freeze up to when I rebooted:


Aug 08 21:03:16 precision plasmashell[2013]: QXcbConnection: XCB error: 2 (BadValue), sequence: 58225, resource id: 67108869, major code: 142 (Unknown), minor code: 3
Aug 08 21:04:06 precision plasmashell[2013]: QXcbConnection: XCB error: 2 (BadValue), sequence: 59222, resource id: 44040197, major code: 142 (Unknown), minor code: 3
Aug 08 21:05:17 precision plasmashell[2013]: QXcbConnection: XCB error: 2 (BadValue), sequence: 59618, resource id: 81788945, major code: 142 (Unknown), minor code: 3
-- Reboot --

As you can see, there were no logs about anything other than the XCB connection prior to the kernel panic. Then, immediately after rebooting, I went to the logs to see if there was anything useful, and it froze again. This time, the only thing open was a Konsole window. This is the second time it has happened with exactly this same order of events. The last time I attempted to check the logs, it caused a system freeze also, but only after experiencing the first freeze with he VM running.

Here are the logs from the second freeze:

Aug 08 21:10:50 precision sudo[2386]:     me : TTY=pts/0 ; PWD=/home/me ; USER=root ; COMMAND=/usr/bin/journalctl --since 10 minutes ago
Aug 08 21:10:50 precision sudo[2386]: pam_unix(sudo:session): session opened for user root by me(uid=0)
-- Reboot --

Again, as you can see, some really useful stuff… The only difference with the second freeze is that it wasn’t a kernel panic like the first one. Subsequent boot is fine, no freezes so far.

Anyone have some ideas what would be causing a kernal panic with a 32bit guest OS in KVM? I have not noticed a freeze any other time, and I can leave my laptop on all day and it’s fine as long as I don’t fire up that VM. I even thought maybe there was something weird with that installation so I reinstalled it…same problem. 64bit guest OSes seem to run fine. Could this be a problem with windows 10 32bit? Is there a specific CPU architecture I should try for the guest, maybe?

Thanks.

Strange – on this 8 GiB memory desktop machine, Firefox with 3 tabs open is using about 4% (342 MiB) of conventional memory and 6% (490 MiB) of RSS memory.

  • Firefox Add-Ons: Ghostery and KDE Plasma …

My personal preference for the VM running a Redmond system on a Linux platform is, Oracle’s VirtualBox.

  • The Oracle folks seem to be able to produce a more reliable VM for running the Redmond offerings …
  • Yes, yes, the Extension Packs and Redmond Guest Additions aren’t quite open source but, on the other hand, the Redmond offerings are also not open source …

@z2

If you can’t solve the problem and for some reason don’t want to dual boot, you can now buy a “mini pc” or “computer stick” with Windows installed for about the same price as a Windows license.

[HR][/HR]
@nrickert

The latest articles here are pretty informative about the memory situation with Firefox. http://www.erahm.org

@dcurtisfra

With Firefox Quantum I think we also need to consider the “Web Content” and “WebExtension” processes. Although, it’s probably easier to to just use free -h, then close Firefox and run it again to note the difference.

Thanks. That seems to be primarily about firefox 66. With Leap 15.1, I’m using 60.8.0esr

Thanks for the suggestions. Apparently KVM has difficulty running windows 10. I discovered that I could upgrade to the 64bit version for free, which I did, but that did not solve the problem. Searching the net for a while revealed that this is apparently a fairly common problem. As far as the complaints I’ve read, it seems to only affect windows 10 guests. I installed virtualbox and moved over the disk image and so far it seems to be working well. Boots up in about half the time it took using KVM also. No idea why, but running it in virtualbox seems to work just fine, at least so far, but it’s only been about an hour (I never made it anywhere near that long in KVM without a freeze). Now I just have to deal with that pesky reactivation problem…

Well, I just ran into this problem with virtualbox also. It appears windows guests cannot be run on openSUSE without causing system freezes. That’s a bit irritating…

I’ve decided to upgrade to the newest kernel, 5.2.8 to see if that fixes the problem. This laptop is fairly new, so I thought maybe the newer kernel might allow me to actually run windows. I’ll update this post with the results.

I’m back to square one. I think windows 10 KVM guests just hose up systems, or at least mine anyway. I upgraded to the newer kernel, and that did seem to improve things somewhat. The desktop never froze while running the guest, but the guest was very slow and sluggish. After about a day, the desktop just froze up when I hadn’t been running a VM at any point. No errors in the logs. I booted from a three week old read only snapshot of the root file system and that seemed to run fine for about six hours, so I did a rollback. I had no freezes at all for about a day until I fired up the windows 10 guest again. It ran fine initially, then I walked away and left it running for about an hour and when I came back it was locked up again.

I’ve decided this is basically an exercise in futility so I’ll just stick with dual booting, even though it’s a pain in the rear sometimes.

@z2:

BIOS/UEFI?

  • For an Intel CPU it’ll possibly something like “VT-d” or “VT-x” or “Virtualization Technology”.
  • For an AMD CPU it’s usually enabled and, there may be something such as “Secure Virtual Machine Mode” as well …

Virtualization is enabled. I can run a linux guest all day without issue, but if I boot up win10, it locks everything up within about 30 minutes, occasionally I can make it an hour before that happens. Also, after a lockup with the windows VM, the computer will usually freeze up on the subsequent boot or two regardless of whether or not I have booted up the VM during that session. It makes no sense, but that seems to be the pattern. I haven’t booted up that VM for the past three days and have had zero problems with freezing in that time.

I don’t know if this is relevant:

Bug 1103426 – Tumbleweed installation freezes when using QXL driver

It isn’t just Tumbleweed. I had to use the virtio video driver for KVM installs of Leap 15.1. And I occasionally saw freezes with a Leap 15.0 guest.

Now that I am using Leap 15.1 for the KVM host system, this problem has gone away.

Hi
Does it occur running specific apps or just random? Is this and Intel or AMD system?

I’m on Intel with gpu passthrough here and added a 10-kvm.conf file to avoid lockups in WinX;


cat /etc/modprobe.d/10-kvm.conf 

options kvm ignore_msrs=1

Switching the video driver is a good idea, I didn’t think to try that. I don’t know if the above is the same issue, but it looks pretty similar, in many respects. I’m planning to upgrade to 15.1 at some point in the near future, but it probably won’t happen until September. Hopefully that will help as well.

It happens at random even if I just have the win10 guest booted but not running any programs (or even on the subsequent boot, after locking up, even if I don’t run a VM). The system is intel 8th gen i5, integrated graphics only.
What does that config file do, exactly?

Hi
Enables the kvm kernel module option (/sbin/modinfo kvm), it ignores the guest request to access those registers.

If you google kvm+ignore_msrs you will see some posts about lockups etc.

It’s could also related to the libvirt version in leap 15.0, has some bugs that are fixed in the later release but may not be backported.