Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 678442 - app-misc/tracker-miners-2.1.5 fails to build due to sandbox error caused by gst-plugin-scanner
Summary: app-misc/tracker-miners-2.1.5 fails to build due to sandbox error caused by g...
Status: RESOLVED FIXED
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: Current packages (show other bugs)
Hardware: All Linux
: Normal normal (vote)
Assignee: Gentoo Linux Gnome Desktop Team
URL:
Whiteboard:
Keywords:
Depends on: 570624
Blocks:
  Show dependency tree
 
Reported: 2019-02-20 21:32 UTC by Pacho Ramos
Modified: 2019-03-02 19:18 UTC (History)
1 user (show)

See Also:
Package list:
Runtime testing required: ---


Attachments
build.log.gz (tracker-miners-2.1.5:20190220-212856.log.gz,4.82 KB, application/gzip)
2019-02-20 21:32 UTC, Pacho Ramos
Details
1.patch (1.patch,406 bytes, patch)
2019-02-23 08:55 UTC, Pacho Ramos
Details | Diff
build.log (build.log.gz,32.59 KB, application/gzip)
2019-02-23 09:39 UTC, Pacho Ramos
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Pacho Ramos gentoo-dev 2019-02-20 21:32:29 UTC
Created attachment 565970 [details]
build.log.gz

I am not sure why I am facing this with some packages, in all of them is due to gst-plugin-scanner being called and it trying to access some devices

Configuring configuration.json using configuration
 * ACCESS DENIED:  open_wr:      /dev/dri/renderD129
 * ACCESS DENIED:  open_wr:      /dev/dri/renderD128
 * ACCESS DENIED:  open_wr:      /dev/dri/card1
 * ACCESS DENIED:  open_wr:      /dev/dri/card0
Message: 
Build Configuration:
    Prefix:                                 /usr
    Source code location:                   /var/tmp/portage/app-misc/tracker-miners-2.1.5/work/tracker-miners-2.1.5
    Compiler:                               gcc

Feature Support:
    Battery/mains power detection:          upower
    Build with Journal support:             true

Data Miners / Writebacks:
    FS (File System):                       true
    Applications:                           true
    RSS:                                    true
   Extract (secondary extraction):     true
   Writeback (writing changes back):   true

Metadata Extractors:
    Support PNG:                            true
    Support PDF:                            true
    Support XPS:                            false
    Support GIF:                            true (xmp: false)
    Support JPEG:                           true (xmp: false, exif: true, iptc: false)
    Support RAW:                            false
    Support TIFF:                           true (xmp: false, exif: true, iptc: false)
    Support Vorbis (ogg/etc):               true
    Support Flac:                           true
    Support MS & Open Office:               false
    Support XML / HTML:                     true
    Support embedded / sidecar XMP:         false
    Support generic media formats:          gstreamer (backend: Discoverer)
    Support cue sheet parsing:              false
    Support playlists (w/ Totem):           true
    Support ISO image parsing:              true
    Support AbiWord document parsing:       true
    Support DVI parsing:                    true
    Support MP3 parsing:                    true
    Support MP3 tag charset detection:      icu
    Support PS parsing:                     true
    Support text parsing:                   true
    Support icon parsing:                   true

Writeback Formats:
    Audio files using Taglib:               true
    XMP:                                    false
Build targets in project: 59
Found ninja-1.8.2 at /usr/bin/ninja
>>> Source configured.
 * --------------------------- ACCESS VIOLATION SUMMARY ---------------------------
 * LOG FILE: "/var/log/sandbox/sandbox-4.log"
 * 
VERSION 1.0
FORMAT: F - Function called
FORMAT: S - Access Status
FORMAT: P - Path as passed to function
FORMAT: A - Absolute Path (not canonical)
FORMAT: R - Canonical Path
FORMAT: C - Command Line

F: open_wr
S: deny
P: /dev/dri/renderD129
A: /dev/dri/renderD129
R: /dev/dri/renderD129
C: /usr/lib64/gstreamer-1.0/gst-plugin-scanner -l /usr/bin/gst-inspect-1.0 

F: open_wr
S: deny
P: /dev/dri/renderD128
A: /dev/dri/renderD128
R: /dev/dri/renderD128
C: /usr/lib64/gstreamer-1.0/gst-plugin-scanner -l /usr/bin/gst-inspect-1.0 

F: open_wr
S: deny
P: /dev/dri/card1
A: /dev/dri/card1
R: /dev/dri/card1
C: /usr/lib64/gstreamer-1.0/gst-plugin-scanner -l /usr/bin/gst-inspect-1.0 

F: open_wr
S: deny
P: /dev/dri/card0
A: /dev/dri/card0
R: /dev/dri/card0
C: /usr/lib64/gstreamer-1.0/gst-plugin-scanner -l /usr/bin/gst-inspect-1.0 
 * --------------------------------------------------------------------------------

Portage 2.3.62 (python 3.7.0-final-0, default/linux/amd64/17.0/desktop/gnome/systemd, gcc-7.3.0, glibc-2.27-r6, 4.19.17-gentoo x86_64)
=================================================================
System uname: Linux-4.19.17-gentoo-x86_64-Intel-R-_Core-TM-_i7-7700HQ_CPU_@_2.80GHz-with-gentoo-2.6
KiB Mem:    16131732 total,   2082852 free
KiB Swap:    5240828 total,   5240536 free
Timestamp of repository gentoo: Wed, 20 Feb 2019 21:00:01 +0000
Head commit of repository gentoo: b024a6a934288437431577db28c3a2bf5a0ddbf6
sh bash 4.4_p23-r1
ld GNU ld (Gentoo 2.30 p5) 2.30.0
ccache version 3.3.4 [enabled]
app-shells/bash:          4.4_p23-r1::gentoo
dev-java/java-config:     2.2.0-r4::gentoo
dev-lang/perl:            5.26.2::gentoo
dev-lang/python:          2.7.15::gentoo, 3.5.5-r1::gentoo, 3.6.6::gentoo, 3.7.0::gentoo
dev-util/ccache:          3.3.4-r1::gentoo
dev-util/cmake:           3.9.6::gentoo
dev-util/pkgconfig:       0.29.2::gentoo
sys-apps/baselayout:      2.6-r1::gentoo
sys-apps/openrc:          0.38.3-r1::gentoo
sys-apps/sandbox:         2.13::gentoo
sys-devel/autoconf:       2.13-r1::gentoo, 2.69-r4::gentoo
sys-devel/automake:       1.11.6-r3::gentoo, 1.16.1-r1::gentoo
sys-devel/binutils:       2.30-r4::gentoo
sys-devel/gcc:            7.3.0-r3::gentoo
sys-devel/gcc-config:     2.0::gentoo
sys-devel/libtool:        2.4.6-r3::gentoo
sys-devel/make:           4.2.1-r4::gentoo
sys-kernel/linux-headers: 4.14-r1::gentoo (virtual/os-headers)
sys-libs/glibc:           2.27-r6::gentoo
Repositories:

gentoo
    location: /usr/portage
    sync-type: rsync
    sync-uri: rsync://rsync.gentoo.org/gentoo-portage
    priority: -1000
    sync-rsync-verify-metamanifest: no
    sync-rsync-extra-opts: 
    sync-rsync-verify-max-age: 24
    sync-rsync-verify-jobs: 1

x-portage
    location: /usr/local/portage
    masters: gentoo
    priority: 0

ago
    location: /hdd/portage/local/layman/ago
    masters: gentoo
    priority: 50

ACCEPT_KEYWORDS="amd64"
ACCEPT_LICENSE="*"
CBUILD="x86_64-pc-linux-gnu"
CFLAGS="-O2 -pipe -march=native -fno-stack-protector"
CHOST="x86_64-pc-linux-gnu"
CONFIG_PROTECT="/etc /etc/stunnel/stunnel.conf /usr/lib64/libreoffice/program/sofficerc /usr/share/gnupg/qualified.txt"
CONFIG_PROTECT_MASK="/etc/ca-certificates.conf /etc/dconf /etc/env.d /etc/fonts/fonts.conf /etc/gconf /etc/gentoo-release /etc/revdep-rebuild /etc/sandbox.d /etc/terminfo /etc/texmf/language.dat.d /etc/texmf/language.def.d /etc/texmf/updmap.d /etc/texmf/web2c"
CXXFLAGS="-O2 -pipe -march=native -fno-stack-protector"
DISTDIR="/hdd/distfiles"
EMERGE_DEFAULT_OPTS="--quiet-build=n --autounmask-write --keep-going"
ENV_UNSET="DBUS_SESSION_BUS_ADDRESS DISPLAY GOBIN PERL5LIB PERL5OPT PERLPREFIX PERL_CORE PERL_MB_OPT PERL_MM_OPT XAUTHORITY XDG_CACHE_HOME XDG_CONFIG_HOME XDG_DATA_HOME XDG_RUNTIME_DIR"
FCFLAGS="-O2 -pipe"
FEATURES="assume-digests binpkg-docompress binpkg-dostrip binpkg-logs ccache cgroup compress-build-logs compressdebug config-protect-if-modified distlocks ebuild-locks fixlafiles ipc-sandbox merge-sync multilib-strict network-sandbox news parallel-fetch parallel-install pid-sandbox preserve-libs protect-owned sandbox sfperms sign split-log strict unknown-features-warn unmerge-logs unmerge-orphans userfetch userpriv usersandbox usersync xattr"
FFLAGS="-O2 -pipe"
GENTOO_MIRRORS="ftp://ftp.free.fr/mirrors/ftp.gentoo.org/"
LANG="es_ES.utf8"
LDFLAGS="-Wl,-O1 -Wl,--as-needed -Wl,--hash-style=gnu"
LINGUAS="es es_ES en en_US fr fr_FR"
MAKEOPTS="-j9"
PKGDIR="/hdd/packages"
PORTAGE_CONFIGROOT="/"
PORTAGE_RSYNC_OPTS="--recursive --links --safe-links --perms --times --omit-dir-times --compress --force --whole-file --delete --stats --human-readable --timeout=180 --exclude=/distfiles --exclude=/local --exclude=/packages --exclude=/.git"
PORTAGE_TMPDIR="/var/tmp"
USE="X a52 aac acl acpi alsa amd64 applet avahi avx avx256 bash-completion berkdb bluetooth branding bzip2 cairo ccache cdda cddb cdr chm chromecast cli colord crypt cups cvs cxx dbus djvu dri dts dvd dvdr dvi ebook eds emboss enchant encode evo exif fam fat ffmpeg flac fortran fuse gdbm gif git glamor gnome gnome-keyring gnome-online-accounts google googledrive gphoto2 gpm gromacs gstreamer gtk gtk3 gtkstyle hfs http iconv infinality inotify introspection ios irc jabber jpeg kpathsea latex lcms ldap libass libnotify libsecret libtirpc libvisual lyx mad microdns mms mmx mmxext mng mobi monolithic-build mp3 mp4 mpeg mtp multilib musicbrainz nautilus ncurses network-cron networkmanager nls nptl ntfs ntp numa nvidia offensive ogg opengl openmp optimized-qmake pam pango pch pdf pdfimport png policykit ppds pulseaudio qt5 readline reiserfs scanner sdl seccomp sendto smp sna snmp spell squashfs sse sse2 sse3 sse4 sse4_1 ssl ssse3 startup-notification svg systemd t1lib tcpd test theora threads tiff tracker truetype udev udisks unicode upnp upnp-av upower usb v4l vaapi vala vcd vdpau vlc vorbis wifi wxwidgets x264 x265 xattr xcb xfs xml xmpp xv xvid youtube zeroconf zlib" ABI_X86="64" ALSA_CARDS="hda-intel" APACHE2_MODULES="authn_core authz_core socache_shmcb unixd actions alias auth_basic authn_alias authn_anon authn_dbm authn_default authn_file authz_dbm authz_default authz_groupfile authz_host authz_owner authz_user autoindex cache cgi cgid dav dav_fs dav_lock deflate dir disk_cache env expires ext_filter file_cache filter headers include info log_config logio mem_cache mime mime_magic negotiation rewrite setenvif speling status unique_id userdir usertrack vhost_alias" CALLIGRA_FEATURES="karbon sheets words" COLLECTD_PLUGINS="df interface irq load memory rrdtool swap syslog" CPU_FLAGS_X86="aes avx avx2 fma3 mmx mmxext popcnt sse sse2 sse3 sse4_1 sse4_2 ssse3" ELIBC="glibc" GPSD_PROTOCOLS="ashtech aivdm earthmate evermore fv18 garmin garmintxt gpsclock isync itrax mtk3301 nmea ntrip navcom oceanserver oldstyle oncore rtcm104v2 rtcm104v3 sirf skytraq superstar2 timing tsip tripmate tnt ublox ubx" INPUT_DEVICES="libinput keyboard mouse" KERNEL="linux" L10N="es es-ES en en-US fr fr-FR" LCD_DEVICES="bayrad cfontz cfontz633 glk hd44780 lb216 lcdm001 mtxorb ncurses text" LIBREOFFICE_EXTENSIONS="presenter-console presenter-minimizer" NETBEANS_MODULES="apisupport cnd groovy gsf harness ide identity j2ee java mobility nb php profiler soa visualweb webcommon websvccommon xml" OFFICE_IMPLEMENTATION="libreoffice" PHP_TARGETS="php5-6 php7-1" POSTGRES_TARGETS="postgres9_5 postgres10" PYTHON_SINGLE_TARGET="python3_6" PYTHON_TARGETS="python2_7 python3_6 python3_7" RUBY_TARGETS="ruby24" USERLAND="GNU" VIDEO_CARDS="fbdev vesa intel i965 nouveau" XTABLES_ADDONS="quota2 psd pknock lscan length2 ipv4options ipset ipp2p iface geoip fuzzy condition tee tarpit sysrq steal rawnat logmark ipmark dhcpmac delude chaos account"
Unset:  CC, CPPFLAGS, CTARGET, CXX, INSTALL_MASK, LC_ALL, PORTAGE_BINHOST, PORTAGE_BUNZIP2_COMMAND, PORTAGE_COMPRESS, PORTAGE_COMPRESS_FLAGS, PORTAGE_RSYNC_EXTRA_OPTS
Comment 1 Mart Raudsepp gentoo-dev 2019-02-20 21:50:26 UTC
If tests are enabled, then functional tests are configured and build.
This will launch tests/functional-tests/detect-h264-codec.sh, which runs gst-inspect-1.0, which triggers the issue.
We need to avoid the inspect call by either making it always think it's not available, or ensuring the dep is there and forcing it on or something. Though for the latter, I'm not sure it still won't trigger the sandbox issue.

Can you locally try this? For example like this:

Ensure `gst-inspect-1.0 -t decoder |grep h264` returns something (should if gst-plugins-libav and/or gst-plugins-openh264 is installed)

ebuild tracker-miners-2.1.5 prepare

in another tab go and edit $S/tests/functional-tests/detect-h264-codec.sh to just do

exit 0

instead of that gst-inspect stuff, then continue to the rest in the original terminal tab with e.g.

ebuild tracker-miners-2.1.5 compile


Does it not trip up then? If not, it still does if cleaning up tmpdir and doing it in steps without the inbetween modification (just to ensure sandbox is still effective when step-by-step)?

Based on that info I can try to come up with some workaround for this without disabling those tests altogether. If not, we can just skip the detection and the related tests and at least it won't fail.

Fortunately this can only be triggered for those that do FEATURES=test (or USE=test)
Comment 2 Pacho Ramos gentoo-dev 2019-02-23 08:55:49 UTC
Created attachment 566186 [details, diff]
1.patch

I have edited the ebuild and applied the attached patch (to skip the detection) and it looks to work fine for me.

My only wonder if that I have still another two packages affected by this, then, I am not sure if a more general solution would be possible to not get this issues reappearing from time to time :/
Comment 3 Mart Raudsepp gentoo-dev 2019-02-23 09:10:15 UTC
OK, so the problem doesn't happen if it doesn't inspect all plugins, but just uses h264 decoder. Can you please attach the build.log with that patch to check out what it says about those h264 tests then, etc?
I think tracker-miners-2.1.6 will come out soon with some of my patches and backports included, so I'll think of something for these tests for that bump.
Comment 4 Pacho Ramos gentoo-dev 2019-02-23 09:39:48 UTC
Created attachment 566188 [details]
build.log

sure
Comment 5 Mart Raudsepp gentoo-dev 2019-02-23 09:43:44 UTC
(In reply to Pacho Ramos from comment #2)
> My only wonder if that I have still another two packages affected by this,
> then, I am not sure if a more general solution would be possible to not get
> this issues reappearing from time to time :/

Yeah, bug 570624 still remains open either way. I guess we need to get gst-plugins-scanner to ignore v4l2 and co under portage somehow if they still insist on opening dri stuff in just probing (sort of makes sense they do it - the elements the plugin provides depends on what's there). Not sure if some env var honoring patches to plugins-scanner to just not scan them then, dropping in a plugin blacklist file in src_prepare or what.
Comment 6 Pacho Ramos gentoo-dev 2019-02-23 10:20:35 UTC
I guess trying to completely skip completely gst-inspect under portage in general is too risky?
Comment 7 Mart Raudsepp gentoo-dev 2019-02-23 10:46:08 UTC
How do you propose we do that, other than patching packages to not call it - just like we will be doing to tracker-miners to workaround it?
Comment 8 Pacho Ramos gentoo-dev 2019-02-23 11:25:12 UTC
I was thinking in trying to contact portage people to see if they have a way to do that (like an "alias"), but, before contacting them, I wanted to know if that would be wanted (like alias gst-inspect=true)
Comment 9 Pacho Ramos gentoo-dev 2019-02-23 11:28:29 UTC
other option could be to have a "portage PATH" that takes precedence and would allow to easily drop that "wrappers" there... I know there is a PORTAGE_BIN_PATH but I don't think it is allowed to be used for that
Comment 10 Larry the Git Cow gentoo-dev 2019-02-27 13:21:27 UTC
The bug has been closed via the following commit(s):

https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=29e83345c868ec128c9411452b2a03a6084d3b1b

commit 29e83345c868ec128c9411452b2a03a6084d3b1b
Author:     Mart Raudsepp <leio@gentoo.org>
AuthorDate: 2019-02-27 13:18:44 +0000
Commit:     Mart Raudsepp <leio@gentoo.org>
CommitDate: 2019-02-27 13:20:58 +0000

    app-misc/tracker-miners: bump to 2.1.6, workaround gst sandbox issues
    
    Disables guarantee_metadata option by default, otherwise mainly just
    most of the patches we needed for 2.1.5 are included now, plus
    translation updates.
    Workaround gstreamer sandbox issues by avoiding the gst-inspect
    checking and patching the detection result to true or false, depending
    on if gstreamer is used or not. Theoretically the test should succeed
    always with ffmpeg, but not bothering to figure out if there is some
    USE flags on ffmpeg needed to ensure that or not, etc, so just skipping
    them with ffmpeg for the time being.
    
    Closes: https://bugs.gentoo.org/678442
    Package-Manager: Portage-2.3.52, Repoman-2.3.12
    Signed-off-by: Mart Raudsepp <leio@gentoo.org>

 app-misc/tracker-miners/Manifest                   |   1 +
 .../files/2.1.6-cue-meson-fixes.patch              |  67 ++++++++++
 .../tracker-miners/tracker-miners-2.1.6.ebuild     | 146 +++++++++++++++++++++
 3 files changed, 214 insertions(+)
Comment 11 Mart Raudsepp gentoo-dev 2019-02-27 14:27:30 UTC
Is 2.1.6 good for you now without local patching?
Comment 12 Pacho Ramos gentoo-dev 2019-03-02 19:18:37 UTC
it works nice, thanks!