Xpra-org / xpra

Persistent remote applications for X11; screen sharing for X11, MacOS and MSWindows.
https://xpra.org/
GNU General Public License v2.0
1.91k stars 164 forks source link

Server crash on Ubuntu 14.04 #1084

Closed totaam closed 8 years ago

totaam commented 8 years ago

Issue migrated from trac ticket # 1084

component: server | priority: major | resolution: invalid

2016-01-10 01:35:34: caspercg created the issue


Cannot start xpra on Ubuntu 14.04.

> uname -a
Linux 3.13.0-35-generic #62-Ubuntu SMP Fri Aug 15 01:58:42 UTC 2014 x86_64 x86_64 x86_64 GNU/Linux

Tried both xpra_0.15.10-1_amd64.deb and xpra_0.16.1-1_amd64.deb.

Example:

> xpra start :100 --start-child=xterm --daemon=no --no-mdns --encoding=png -d all
...lot of debug output...
2016-01-10 03:14:23,497 vpx returning vp8 image: 564 bytes
2016-01-10 03:14:23,497 vp9 codec defaults:
2016-01-10 03:14:23,497  target_bitrate=256
2016-01-10 03:14:23,497  min_quantizer=0
2016-01-10 03:14:23,498  max_quantizer=63
2016-01-10 03:14:23,498  undershoot_pct=100
2016-01-10 03:14:23,498  overshoot_pct=100
2016-01-10 03:14:23,498 initial_bitrate_per_pixel(320, 240, 256)=0.003
2016-01-10 03:14:23,498 update_cfg() bitrate(64,32,0.003)=16
2016-01-10 03:14:23,498 our configuration:
2016-01-10 03:14:23,498  target_bitrate=16
2016-01-10 03:14:23,498  min_quantizer=50
2016-01-10 03:14:23,498  max_quantizer=63
2016-01-10 03:14:23,498  undershoot_pct=100
2016-01-10 03:14:23,499  overshoot_pct=100
2016-01-10 03:14:23,516 vpx_codec_enc_init_ver for vp9 succeeded
2016-01-10 03:14:23,516 vp9 setting cpu speed to 8
2016-01-10 03:14:23,517 update_cfg() bitrate(64,32,0.003)=16
2016-01-10 03:14:23,517 vp9 setting lossless to 0
zsh: illegal hardware instruction (core dumped)  xpra start :100 .... 

Tried both with xvfb=Xorg and xvfb=Xvfb

Is there something else I can try to narrow down the problem?

I haven't been able to get it to start without crashing yet. Tried several encodings and different options but no go.

totaam commented 8 years ago

2016-01-10 02:00:34: antoine changed owner from antoine to caspercg

totaam commented 8 years ago

2016-01-10 02:00:34: antoine commented


illegal hardware instruction (core dumped)

is occurring in the vp9 sanity checks.

Your libvpx library is either broken or not compatible with your CPU. This is not an xpra bug I am afraid, calling a library should not cause a crash...

You could try to workaround it by listing all the encodings except vp9 (and maybe also vp8 - which also uses the same libvpx library), like so:

xpra start --encodings=rgb,h264,png,jpeg,webp ...

(or setting "encodings" in your global /etc/xpra/xpra.conf.

totaam commented 8 years ago

2016-01-10 09:01:38: caspercg changed owner from caspercg to antoine

totaam commented 8 years ago

2016-01-10 09:01:38: caspercg commented


Ok. This seems to be the bug: https://bugs.launchpad.net/ubuntu/+source/libvpx/+bug/1518933

..and it's not fixed on the latest 14.04 repository as I checked and have the newest version of libvpx installed.

-*So now the problem becomes how to start xpra without loading libvpx.**

I tried setting encodings in both xpra.conf and on the command line, but it still crashes at the same point.

....
2016-01-10 10:51:55,188 vp9 setting cpu speed to 8
2016-01-10 10:51:55,188 update_cfg() bitrate(64,32,0.003)=16
2016-01-10 10:51:55,188 vp9 setting lossless to 0
zsh: illegal hardware instruction (core dumped)  xpra start :100 --encodings=rgb,h264,png,jpeg --start-child=xterm 

How do I make it not load libvpx?

Thanks.

totaam commented 8 years ago

2016-01-10 09:05:49: antoine changed owner from antoine to caspercg

totaam commented 8 years ago

2016-01-10 09:05:49: antoine commented


Hah, I have a better solution, ignore what I said about encodings, it won't be needed. We have something designed just for this case (which I had forgotten about):

  • for the server:
    xpra start --video-encoders=x264,nvenc
  • for the client
    xpra attach --video-decoders=avcodec

You can use video-encoders=help or video-decoders=help to get a list of options.

totaam commented 8 years ago

2016-01-10 13:06:49: caspercg commented


Thanks antoine. I ended up compiling from source --without-vpx and it works now.

Btw. AV_PIX_FMT_0RGB and AV_PIX_FMT_BGR0 is missing from 14.04 pixfmt.h. Had to comment those out in the source of xpra to get it to compile.

To get Xdummy working on Ubuntu was another adventure, but it was resolved in the end by just installing the original Xdummy script (http://www.karlrunge.com/x11vnc/Xdummy). Much easier than fiddling with the /dev/tty|fd|card group permissions.

Thanks for your help. You can mark this resolved as far as I'm concerned. Now to do some testing...

totaam commented 8 years ago

2016-01-10 13:16:10: antoine changed status from new to closed

totaam commented 8 years ago

2016-01-10 13:16:10: antoine set resolution to invalid

totaam commented 8 years ago

2016-01-10 13:16:10: antoine commented


Btw. AV_PIX_FMT_0RGB and AV_PIX_FMT_BGR0 is missing from 14.04 [[BR]] You need one of those Debian specific patches for libav:

  • [/browser/xpra/tags/v0.15.x/debian/patches/new-libav-codec2.patch]
  • [/browser/xpra/tags/v0.15.x/debian/patches/new-libav-no0RGB.patch]

Closing as invalid because there's nothing we can do in xpra if the OS supplied libraries are buggy. In some other cases, we detect Ubuntu and skip whatever is broken there (ie: opengl drivers), but in this case we would also need to detect that the CPU doesn't support sse2 (or whatever it is)..