VirtualBox

Opened 8 years ago

Closed 8 years ago

Last modified 8 years ago

#15511 closed defect (invalid)

Screen refresh only when loosing focus -> X server bug, fixed upstream, work-around in versions higher than 5.1.2

Reported by: Peter van Nes Owned by:
Component: guest additions/x11/graphics Version: VirtualBox 5.0.20
Keywords: screen refresh focus Cc: KennyDr
Guest type: Linux Host type: Mac OS X

Description

After installing a Oracle Virtual Box with Oracle Linux 6.8 and Oracle JDeveloper the screen in the VM is not refreshed after starting JDeveloper. The screen in the preview pane shows the output of the screen as it should be. After the VM looses focus it updates the screen again.

See youtube video for clarification; https://www.youtube.com/watch?v=58Q-SEjGM9k&feature=youtu.be

Reproduced in VirtualBox 5.1.0_BETA2 r107840 also.

Machine is configured exactly as documented here; http://www.reddipped.com/2016/01/virtualbox-with-soa-12cr2-and-streamexplorer-in-33-minutes/ Network configuration; http://www.reddipped.com/2015/10/setting-up-a-nat-network-in-virtualbox-5/

Attachments (8)

VBox.log (81.6 KB ) - added by Peter van Nes 8 years ago.
VBox.log
Xorg.0.log (142.8 KB ) - added by Peter van Nes 8 years ago.
VBox.2.log (76.9 KB ) - added by ChadACrawford 8 years ago.
Lubuntu VM log
modesetting_drv.so.unpatched (294.6 KB ) - added by Michael Thayer 8 years ago.
Unpatched modesetting driver
modesetting_drv.so.patched (294.8 KB ) - added by Michael Thayer 8 years ago.
Patched modesetting driver. Note: only compatible with X.Org Server 1.17.x
Xorg.0.2.log (43.1 KB ) - added by Peter van Nes 8 years ago.
modesetting_drv.so.2.unpatched (282.8 KB ) - added by Michael Thayer 8 years ago.
Unpatched test modesetting driver
modesetting_drv.so.2.patched (283.0 KB ) - added by Michael Thayer 8 years ago.
Patched test modesetting driver

Download all attachments as: .zip

Change History (35)

by Peter van Nes, 8 years ago

Attachment: VBox.log added

VBox.log

comment:1 by Peter van Nes, 8 years ago

Could be duplicate of Ticket #2985. Found in Xorg.0.log the entry "[ 267.961] (II) modeset(0): Disabling kernel dirty updates, not required." at the exact time when JDeveloper is started.

by Peter van Nes, 8 years ago

Attachment: Xorg.0.log added

comment:2 by Peter van Nes, 8 years ago

Probably found a workaround by pressing fn+ctrl+alt+f7 followed by fn+ctrl+alt+f1 to refresh the screen.

comment:3 by ChadACrawford, 8 years ago

Having this same issue on a Windows host with a Lubuntu guest in 5.0.20 and 5.0.22. It's usually happening when emacs is printing a lot of text to a buffer at once. However, mine reports "Lagging too far behind, not trying to catch up anymore. Expect glitches with USB devices" at the time that the screen freezes.

by ChadACrawford, 8 years ago

Attachment: VBox.2.log added

Lubuntu VM log

comment:4 by Michael Thayer, 8 years ago

The message in the X.Org log file - "Disabling kernel dirty updates, not required" - definitely looks related to the issue. However, when I look at the X server sources (checked in Ubuntu 16.04), that message can only trigger when the kernel driver dirty update handler returns ENOSYS or EINVAL, which our one never does, so this clearly needs investigation.

comment:5 by Michael Thayer, 8 years ago

I took a look at the Linux kernel code between the X server and the driver. That code path could be triggered if there is a bug in the X server causing it to call the kernel wrong.

comment:6 by Michael Thayer, 8 years ago

Or if the X server submits too many updates at one time. I suspect that is what is happening from looking at the X server code. This is somewhat annoying, because if the X server does that it misinterprets the result as meaning that the driver does not need update information, and stops providing it altogether. This is a bug in the X server of course, and will affect other virtual graphics drivers, but that does not help us much.

comment:7 by Michael Thayer, 8 years ago

Component: GUIguest additions/x11/graphics
Keywords: screen added; scree removed

comment:8 by Michael Thayer, 8 years ago

Is anyone watching this bug up to playing with the guest X server a bit? For example,

  • getting the X server source code
  • editing the file hw/xfree86/drivers/modesetting/driver.c
  • finding the block containing the text "Disabling kernel dirty updates, not required.\n"
  • removing the code snippet a few lines above reading "ret == -EINVAL || " (on Ubuntu, that would leave the whole line looking like: "if (ret == -ENOSYS) {")
  • and finally rebuilding and reinstalling the X server package, or at least the modesetting driver in it?

I think that should fix it. I am tending towards submitting a patch to the X server doing this.

comment:9 by OveE, 8 years ago

Recompiled X server on Oracle Linux 72 (OL72) guest and can confirm that the trigger I have for this issue no longer triggers.

My environment is OL72 host running VBOX 5.0.22 and OL72 guest. Host graphics card is Nvidia GeForce 960 and the Nvidia driver.

My trigger is to do any "drag-and-drop" of a firefox menu entry when using the KDE desktop.

Below is a cut-n-paste of the method used to recompile, might help some if you want to do it yourself. Warning, it removes ~/rpmbuild directory.

I've just tested by installing recompiled RPMs and could not reproduce doing 30+ drags, and then;

yum reinstall 'xorg-x11-server*'

reboot and the issue triggers on the first menu entry drag. Will need to work with a fixed desktop for a day trying to trigger the issue a couple of times to "feel" sure about this.

Thanks for the detective work on this ticket.

/Ove


[root@ol7-obi-hv-a xorg]# diff driver.c.orig driver.c.changed
495c495
<     if (ret == -EINVAL || ret == -ENOSYS) {
---
>     if (ret == -ENOSYS) {
[root@ol7-obi-hv-a xorg]# cat doit.sh
#!/bin/bash

yumdownloader --source xorg-x11-server

# install all deps
# yum install '*devel' --exclude='mariadb*' --skip-broken # install too much
#yum install 'xorg*devel' '*GL*devel'

# needed to reinstall libGL (old libs present, compiled did not find libGL-1.2.0)
#yum reinstall -y mesa-libGL-10.6.5-3.20150824.el7.x86_64
# this must be a fluke on the OL72 I'm using


cat > /tmp/0001-driver-remove-einval.patch <<EOF
From: Ove Ewerlid <ove.ewerlid@oracle.com>
Date: Mon Jun 27 16:18:59 CEST 2016
Subject: [PATCH] remove EINVAL check from status of returned kernel call

EOF

diff -c driver.c.orig driver.c

rm -rf ~/rpmbuild/
rpm -i src/xorg-x11-server-1.17.2-10.el7.src.rpm

# Do this  hack rather then "git init; ..." to get the git diff from within a git tree
mkdir -p ~/rpmbuild/BUILD
( cd ~/rpmbuild/BUILD; tar -xjf ../SOURCES/xorg-server-1.17.2.tar.bz2 )
cp -p driver.c.orig  ~/rpmbuild/BUILD/xorg-server-1.17.2/hw/xfree86/drivers/modesetting/driver.c.orig
cp -p driver.c.changed  ~/rpmbuild/BUILD/xorg-server-1.17.2/hw/xfree86/drivers/modesetting/driver.c
( cd ~/rpmbuild/BUILD/xorg-server-1.17.2; git diff hw/xfree86/drivers/modesetting/driver.c.orig hw/xfree86/drivers/modesetting/driver.c >> /tmp/0001-driver-remove-einval.patch )
sed -i 's/.orig//' /tmp/0001-driver-remove-einval.patch
cp -p ~/rpmbuild/SPECS/xorg-x11-server.spec .
cp -p /tmp/0001-driver-remove-einval.patch ~/rpmbuild/SOURCES/

# add new diff to spec
sed -i 's/Patch9305: 0001-modesetting-Claim-PCI-devices-as-PCI-not-platform.patch/Patch9305: 0001-modesetting-Claim-PCI-devices-as-PCI-not-platform.patch\nPatch9990: 0001-driver-remove-einval.patch/' xorg-x11-server.spec
cp -p xorg-x11-server.spec ~/rpmbuild/SPECS/
rpmbuild -bs ~/rpmbuild/SPECS/xorg-x11-server.spec

# Remove to be  sure we use the newly build modified SRC rpm
rm -rf ~/rpmbuild/SOURCES
rm -rf ~/rpmbuild/BUILD

time rpmbuild --rebuild  ~/rpmbuild/SRPMS/xorg-x11-server-1.17.2-10.el7.src.rpm
rm -rf RPMS
mkdir -p RPMS
cp -a ~/rpmbuild/RPMS/* RPMS/
[root@ol7-obi-hv-a xorg]# 

comment:10 by Michael Thayer, 8 years ago

Thanks for investigating too. Then I will submit a patch to the X server and add an ugly work-around to our kernel driver to make them work with broken X servers.

comment:12 by Michael Thayer, 8 years ago

Ove, would you be able to test a slightly less crude patch?

https://lists.x.org/archives/xorg-devel/2016-July/050324.html

Thanks.

comment:13 by Peter van Nes, 8 years ago

Michael, i have an OL 6U8 machine an can test it. I have no experience with applying patches this way. Tried Ove's script but that one does not seem to work without adaption.

comment:14 by Michael Thayer, 8 years ago

reddipped, sadly I do not have much Fedora experience. You could try executing the script as individual commands, line-by-line and paste the results here and we can see if we can work it out.

comment:15 by Peter van Nes, 8 years ago

I already tried to fix it, but i do not understand the line 'diff -c driver.c.orig driver.c' because there is no driver.c or driver.c.orig yet. Yumdownlaoder just downloads the package. I could use one of the two suggested diff's and add this in to the tmp/0001-driver-remove-einval.patch fie, but this also does not create the missing files.

comment:16 by Michael Thayer, 8 years ago

I will see if I can reproduce this myself. Can anyone tell me what the quickest way is if I am creating a virtual machine from scratch?

comment:17 by Peter van Nes, 8 years ago

You can follow these steps. http://www.reddipped.com/2016/01/virtualbox-with-soa-12cr2-and-streamexplorer-in-33-minutes/ You could skip almost all steps except the installation of Oracle Linux and JDeveloper. I can reproduce it when using a high resolution (2560x1440) and starting/stopping JDeveloper a few times.

comment:18 by Michael Thayer, 8 years ago

Don't have time just now, so what I have done is to rebuild the modesetting driver from the upstream xorg-server-1.17.4 source, once without once with the patch applied. Please try both of them in the guest (replace the guest's modesetting driver with the file, without the ".patched" or ".unpatched" suffix). You should be able to reproduce the problem with the "unpatched" one but not with the "patched" one.

by Michael Thayer, 8 years ago

Unpatched modesetting driver

by Michael Thayer, 8 years ago

Attachment: modesetting_drv.so.patched added

Patched modesetting driver. Note: only compatible with X.Org Server 1.17.x

comment:19 by Michael Thayer, 8 years ago

Just to be clear, those files should only work with X.Org Server 1.17.x ("xorg -version"). I believe that this is the version shipped with Enterprise Linux 6u8.

comment:20 by Peter van Nes, 8 years ago

@michael i have 1.17.4 on Oracle Linux 6U8

comment:21 by Peter van Nes, 8 years ago

After replacing the modesetting_drv.so the resolution immediately changed to 800x600 (0Hz). Reinstalling Guest Additions and reboot did not resolve this. After restoring file and rebooting the resolution was normal again.

Cheers, Peter

comment:22 by Michael Thayer, 8 years ago

Could you please post an Xorg.0.log file so I can see what went wrong? And I will have another go.

by Peter van Nes, 8 years ago

Attachment: Xorg.0.2.log added

by Michael Thayer, 8 years ago

Unpatched test modesetting driver

by Michael Thayer, 8 years ago

Patched test modesetting driver

comment:23 by Michael Thayer, 8 years ago

Rebuilt the files, but on 64-bit CentOS 6.8. Hopefully they will work better this time.

comment:24 by Peter van Nes, 8 years ago

Hi Michael,

Great!

Installed the new driver version en restarted the VM. Working fine now, and have not been able to reproduce this issue till now.

Thanks, Peter

comment:25 by Michael Thayer, 8 years ago

Resolution: invalid
Status: newclosed
Summary: Screen refresh only when loosing focusScreen refresh only when loosing focus -> X server bug, fixed upstream

This has now been fixed in the upstream X server and should be in any future 1.18 and later releases. Unfortunately it could not be back-ported to 1.17, but the Redhat X server maintainer was the person who helped me get this fixed, so if you ask nicely it might be possible to get the RHEL 6 X server fixed.

comment:26 by Michael Thayer, 8 years ago

Cc: KennyDr added

Adding KennyDr to CC list.

comment:27 by Michael Thayer, 8 years ago

Summary: Screen refresh only when loosing focus -> X server bug, fixed upstreamScreen refresh only when loosing focus -> X server bug, fixed upstream, work-around in versions higher than 5.1.2
Note: See TracTickets for help on using tickets.

© 2023 Oracle
ContactPrivacy policyTerms of Use