FreeBSDDesktop/libudev-devd

multimedia/gstreamer1 + devel/libudev-devd: Segmentation fault

h4ckee opened this issue · 8 comments

Hello.

Hi.
I'm using www/surf browser which leverages www/webkit2-gtk3 and multimedia/gstreamer1 as a backend. I get a segfault when I install multimedia/gstreamer1-vaapi (I use Thinkpad T430), without it videos plays fine.

$ surf youtube.com
ERROR: Caught a segmentation fault while loading plugin file:
/usr/local/lib/gstreamer-1.0/libgstvaapi.so

Please either:
- remove it and restart.
- run with --gst-disable-segtrap --gst-disable-registry-fork and debug.
$ uname -a
FreeBSD KPECT 12.1-STABLE FreeBSD 12.1-STABLE GENERIC  amd64

For additional debug info you can also check these links:
https://gitlab.freedesktop.org/gstreamer/gstreamer-vaapi/-/issues/241
https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=245722
BR,
Sergey.

Which version of udev-devd are you using?

Which version of udev-devd are you using?

0.4.2

Can you provide a simple way to reproduce this, including which packages to install and so on?

First off just check if www/surf + multimedia/gstreamer1-vaapi starts without Segfault. If you can, for example, watch YouTube with vaapi, this means that the problem is on my side, and I have to check my OS / port configurations, the differences from the default settings.

I found out one very interesting ?bug?
gstreamer1-vaapi when installed from precompiled package don't have libudev.so:devel/libudev-devd as a dependency (can be checked with ldd), but when you build it from ports this library is installed as a dependency (check Makefile).
I've removed this library from a Makefile and rebuilt gstreamer1-vaapi after that I can view videos without a Segfaults!

libudev.so is pulled in when DRM option is enabled. It is disabled by default, and you seem to have it enabled. As a workaround, rebuild gstreamer1-vaapi with DRM set to OFF.

I debugged this a bit. It turns out that udev_device_get_parent() should return some sensible device given a udev_device representing /dev/dri/card0.

I suspect, it should be either "pci" or "platform".

Once this bug is fixed, the patch added in https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=245722 should be removed from the port.