Bug 220565 - net/libvncserver (was x11-servers/xorg-server): incompatible ABI change crashes VirtualBox
Summary: net/libvncserver (was x11-servers/xorg-server): incompatible ABI change crash...
Status: Closed FIXED
Alias: None
Product: Ports & Packages
Classification: Unclassified
Component: Individual Port(s) (show other bugs)
Version: Latest
Hardware: Any Any
: --- Affects Only Me
Assignee: Marcelo Araujo
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2017-07-08 16:43 UTC by Martin Birgmeier
Modified: 2017-07-12 02:42 UTC (History)
4 users (show)

See Also:
bugzilla: maintainer-feedback? (x11)
jbeich: maintainer-feedback? (vbox)


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Martin Birgmeier 2017-07-08 16:43:08 UTC
Scenario:
- Latest Virtualbox running on FreeBSD 11 p8 host
- FreeBSD 11 p8 client (both i386 and amd64 affected)
- KDE installed in client, kdm4 used to start X
- X using vboxvideo driver

Result:
- Starting X in a VirtualBox VM instantly crashes the VM.
- I suspect change r445076, the same behavior persists with r445323

VirtualBox log file entries at the time of the crash:

00:32:48.976072 VBVA: InfoScreen: [0] @0,0 800x600, line 0x1fff8, BPP 32, flags 0x1
00:32:48.988325 VBVA: InfoScreen: [0] @0,0 800x600, line 0xc80, BPP 32, flags 0x1
00:32:48.988382 Display::handleDisplayResize: uScreenId=0 pvVRAM=000000081280a000 w=800 h=600 bpp=32 cbLine=0xC80 flags=0x1
00:32:48.988682 VNCServerImpl::VRDEResize to 800x600x32bpp
00:32:51.625182 VBVA: InfoScreen: [0] @0,0 800x600, line 0xc80, BPP 32, flags 0x1
00:32:51.625239 Display::handleDisplayResize: uScreenId=0 pvVRAM=000000081280a000 w=800 h=600 bpp=32 cbLine=0xC80 flags=0x1
00:32:51.625289 VNCServerImpl::VRDEResize to 800x600x32bpp
Comment 1 Martin Birgmeier 2017-07-08 16:55:46 UTC
Hmmm... seeing that r445323 undoes the previous change, maybe libxshmfence-1.2_2 is the culprit?

Recompiling virtualbox-ose-additions-5.1.22_1 did not help.
Comment 2 Jan Beich freebsd_committer freebsd_triage 2017-07-08 17:16:07 UTC
Can you restart bisecting while skiping both of those commits? Perhaps, the issue is caused by upgraded packages on the host such as mesa-dri which trigger a bug in virtualbox. If so you need to describe which driver is used on the host and client, so downstream maintainer can try reproduce. Otherwise, get a backtrace from the crash after building virtualbox with debugging symbols.
Comment 3 Martin Birgmeier 2017-07-08 18:39:54 UTC
Thank you for the quick reply.

These are the packages (created using portmaster) which, after upgrading to them on both client and host, led to the problem:

    1284376 Jul  7 14:39 geckodriver-0.17.0_1.txz
     192748 Jul  7 14:40 pciids-20170701.txz
    1679048 Jul  7 14:41 gsl-2.4.txz
    1257192 Jul  7 14:44 texinfo-6.4_1,1.txz
     985012 Jul  7 14:47 enblend-4.1.4_9.txz
     699872 Jul  7 14:48 libgcrypt-1.7.8.txz
      50112 Jul  7 14:48 libpci-3.5.5.txz
     113068 Jul  7 14:49 libva-1.8.3.txz
     274244 Jul  7 14:50 libvncserver-0.9.11_1.txz
       4836 Jul  7 14:50 libxshmfence-1.2_2.txz
    4605108 Jul  7 14:59 mesa-dri-17.1.4.txz
    4756088 Jul  7 15:08 node-8.1.3.txz
     150708 Jul  7 15:08 p5-IO-Socket-SSL-2.044_1.txz
      17044 Jul  7 15:08 p5-Try-Tiny-0.28.txz
    2040124 Jul  7 15:10 php56-5.6.31.txz
      10984 Jul  7 15:10 php56-bz2-5.6.31.txz
       6468 Jul  7 15:11 php56-ctype-5.6.31.txz
      27220 Jul  7 15:11 php56-curl-5.6.31.txz
      55660 Jul  7 15:11 php56-dom-5.6.31.txz
      24936 Jul  7 15:11 php56-exif-5.6.31.txz
     195732 Jul  7 15:11 php56-fileinfo-5.6.31.txz
      19728 Jul  7 15:11 php56-filter-5.6.31.txz
     147892 Jul  7 15:12 php56-gd-5.6.31.txz
       6944 Jul  7 15:12 php56-gettext-5.6.31.txz
     122140 Jul  7 15:12 php56-hash-5.6.31.txz
      18580 Jul  7 15:12 php56-iconv-5.6.31.txz
      17884 Jul  7 15:12 php56-json-5.6.31.txz
      20824 Jul  7 15:12 php56-ldap-5.6.31.txz
     727356 Jul  7 15:13 php56-mbstring-5.6.31.txz
      17840 Jul  7 15:13 php56-mysql-5.6.31.txz
      41028 Jul  7 15:13 php56-mysqli-5.6.31.txz
      44748 Jul  7 15:13 php56-openssl-5.6.31.txz
      44600 Jul  7 15:13 php56-pdo-5.6.31.txz
      16364 Jul  7 15:13 php56-pdo_mysql-5.6.31.txz
      18276 Jul  7 15:13 php56-pdo_pgsql-5.6.31.txz
      43140 Jul  7 15:13 php56-pgsql-5.6.31.txz
      11068 Jul  7 15:14 php56-posix-5.6.31.txz
      13456 Jul  7 15:14 php56-readline-5.6.31.txz
      31640 Jul  7 15:14 php56-session-5.6.31.txz
      22648 Jul  7 15:14 php56-simplexml-5.6.31.txz
      35160 Jul  7 15:14 php56-sockets-5.6.31.txz
      20120 Jul  7 15:14 php56-xml-5.6.31.txz
      15872 Jul  7 15:14 php56-wddx-5.6.31.txz
      12700 Jul  7 15:14 php56-xmlreader-5.6.31.txz
      12968 Jul  7 15:14 php56-xmlwriter-5.6.31.txz
      15336 Jul  7 15:15 php56-xsl-5.6.31.txz
      19968 Jul  7 15:15 php56-zip-5.6.31.txz
      14692 Jul  7 15:15 php56-zlib-5.6.31.txz
     497488 Jul  7 15:16 py27-gdal-2.2.1.txz
    2797428 Jul  7 15:17 sane-backends-1.0.27.txz
     515512 Jul  7 15:18 sdl-1.2.15_10,2.txz
     708536 Jul  7 15:18 sdl2-2.0.5_2.txz
     600364 Jul  7 15:19 step-4.14.3_4.txz
   18444540 Jul  7 16:35 webkit2-gtk3-2.16.5.txz
    2953160 Jul  7 16:39 GraphicsMagick-1.3.26,1.txz
    6611436 Jul  7 16:41 bind910-9.10.5P2.txz
   32076980 Jul  7 17:05 calligra-3.0.1_1.txz
      34136 Jul  7 17:05 convmv-2.03.txz
   11342844 Jul  7 17:10 hugin-2017.0.0.txz
   28337964 Jul  7 17:33 krita-3.1.2.1_1.txz
    3248044 Jul  7 17:34 mercurial-4.2.2.txz
    1118892 Jul  7 17:35 mod_php56-5.6.31.txz
    3118196 Jul  7 17:35 npm-5.0.4.txz
      49160 Jul  7 17:35 pciutils-3.5.5.txz
   35383092 Jul  7 18:08 qgis-2.18.7_2.txz
    4766672 Jul  8 18:05 qemu-user-static-2.9.50.g20170707.txz
      92496 Jul  8 18:05 libuv-1.13.1.txz
    1509900 Jul  8 18:07 xorg-server-1.18.4_3,1.txz
   19175312 Jul  8 18:23 qemu-sbruno-2.9.50.g20170707.txz
     751716 Jul  8 18:24 xorg-vfbserver-1.19.1_3,1.txz

All other packages are older and also up-to-date as of r445339.

For bisecting, can you give advice which of them I should roll back first to their previous version, and on host or client?

I already tried rolling back libxshmfence to libxshmfence-1.2_1.txz and mesa-dri to mesa-dri-17.1.1.txz on the client, to no avail.

-- Martin
Comment 4 Jan Beich freebsd_committer freebsd_triage 2017-07-08 19:12:17 UTC
(In reply to Martin Birgmeier from comment #3)
>      192748 Jul  7 14:40 pciids-20170701.txz

Try downgrading on the *client*.

>      515512 Jul  7 15:18 sdl-1.2.15_10,2.txz

Try downgrading on the *host*.

>      708536 Jul  7 15:18 sdl2-2.0.5_2.txz

Can you check what requires this port? "pkg info -r sdl2". Try downgrading on the *client* if some KDE apps use it.

> I already tried rolling back libxshmfence to libxshmfence-1.2_1.txz and
> mesa-dri to mesa-dri-17.1.1.txz on the client, to no avail.

OpenGL pass-through requires cooperation between drivers on host *and* client. Try downgrading mesa-dri on the host as well unless the host uses nvidia-driver.
Comment 5 Martin Birgmeier 2017-07-08 19:28:50 UTC
I have a question here. Most of the time I am actually running VBoxHeadless, so there isn't even a visible GUI. What is more, I am running the amd64 client on an amd64 host with the X11 display (which is not really used because of VBoxHeadless) redirected to another machine (DISPLAY=othermachine:0), which, as far as I understand, completely disables GL passthrough.

The i386 client is run on an amd64 host locally (DISPLAY=:0).

On the other hand, the crash also happens when using VirtualBox, i.e., when the virtual display is actually being displayed.

So, given the above, is it likely that the problem lies with sdl?

Here the outputs of pkg info/pkg query:

[0]# pkg info -r sdl-1.2.15_10,2 
sdl-1.2.15_10,2:
        gegl-0.2.0_19
        virtualbox-ose-5.1.22_1
        qemu-sbruno-2.9.50.g20170707
[0]# pkg query %rn-%rv sdl-1.2.15_10,2
gegl-0.2.0_19
virtualbox-ose-5.1.22_1
qemu-sbruno-2.9.50.g20170707
[0]# pkg info -r sdl2-2.0.5_2         
sdl2-2.0.5_2:
        ffmpeg-3.3.2_1,1
[0]# pkg query %rn-%rv sdl2-2.0.5_2   
ffmpeg-3.3.2_1,1
[0]# 

Given this, might it be better to try downgrading sdl (not sdl2) on the host?

-- Martin
Comment 6 Jan Beich freebsd_committer freebsd_triage 2017-07-08 20:08:43 UTC
> Most of the time I am actually running VBoxHeadless

With VNC enabled? Try downgrading libvncserver on the host. ports r445054 changed ABI by adding new members in the middle of struct _rfbScreenInfo which may need bumping PORTREVISION in consumers.

> Given this, might it be better to try downgrading sdl (not sdl2) on the host?

Yes but ports r445140 is only risky if you have WITHOUT_NO_STRICT_ALIASING in /etc/make.conf.
Comment 7 Martin Birgmeier 2017-07-09 06:09:50 UTC
Yes, VNC is enabled, and rolling back to libvncserver-0.9.11 fixes the problem.

It's not very clever to hide an ABI-breaking change in a bugfix-only update - normally this warrants a bump of the library major version number.

I don't have WITHOUT_NO_STRICT_ALIASING enabled, so I won't pursue the sdl route any further.

Do you think that recompiling the ports dependent on libvncserver fixes the issue?

I am going to edit the PR subject so that the port maintainer is notified.

Thank you for your help.

-- Martin
Comment 8 Martin Birgmeier 2017-07-09 09:00:32 UTC
I recompiled virtualbox-ose-5.1.22_1 with libvncserver-0.9.11_1, and this also fixes the issue.

So basically, the recent change in libvncserver requires a version bump in all dependent ports.

I am keeping this PR open until that has been done.

-- Martin
Comment 9 Marcelo Araujo freebsd_committer freebsd_triage 2017-07-12 02:25:11 UTC
I'm taking this PR.
Comment 10 commit-hook freebsd_committer freebsd_triage 2017-07-12 02:40:09 UTC
A commit references this bug:

Author: araujo
Date: Wed Jul 12 02:39:37 UTC 2017
New revision: 445565
URL: https://svnweb.freebsd.org/changeset/ports/445565

Log:
  Bump PORTREVISION of several ports that depends of net/libvncserver to
  reflect the changes made on r445054.

  PR:			ports/220565 (based on)
  Submitted by:		Martin Birgmeier <la5lbtyi@aon.at>
  Sponsored by:		iXsystems, Inc.

Changes:
  head/emulators/aqemu/Makefile
  head/emulators/bochs/Makefile
  head/emulators/kcemu/Makefile
  head/emulators/virtualbox-ose/Makefile
  head/graphics/osg/Makefile
  head/graphics/osg-devel/Makefile
  head/net/krdc/Makefile
  head/net/libvncserver/Makefile
Comment 11 Marcelo Araujo freebsd_committer freebsd_triage 2017-07-12 02:42:44 UTC
Thanks!