Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!

Bug 665008

Summary: media-gfx/gimp-2.10.4 : sandbox issue (mkostemp in /usr/share/fonts/) due to media-libs/gegl and media-fonts/x11fonts-jmk
Product: Gentoo Linux Reporter: Toralf Förster <toralf>
Component: Current packagesAssignee: Sebastian Pipping <sping>
Status: RESOLVED FIXED    
Severity: normal CC: fonts, gem, phantom4, x11
Priority: Normal    
Version: unspecified   
Hardware: All   
OS: Linux   
See Also: https://bugs.gentoo.org/show_bug.cgi?id=679858
Whiteboard:
Package list:
Runtime testing required: ---
Attachments: emerge-info.txt
emerge-history.txt
etc.portage.tbz2
logs.tbz2
media-gfx:gimp-2.10.4:20180831-230734.log.bz2
sandbox-30155.log

Description Toralf Förster gentoo-dev 2018-09-01 07:04:16 UTC
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: mkostemp
S: deny

  -------------------------------------------------------------------

  This is an unstable amd64 chroot image at a tinderbox (==build bot)
  name: 17.0-desktop_libressl_20180820-195837

  -------------------------------------------------------------------

gcc-config -l:
 [1] x86_64-pc-linux-gnu-7.3.1
 [2] x86_64-pc-linux-gnu-8.2.0 *

Available Python interpreters, in order of preference:
  [1]   python3.7
  [2]   python3.6
  [3]   python2.7 (fallback)
Available Ruby profiles:
  [1]   ruby23 (with Rubygems)
  [2]   ruby25 (with Rubygems) *
java-config:
The following VMs are available for generation-2:
1)	IcedTea JDK 3.8.0 [icedtea-8]
*)	IcedTea JDK 3.8.0 [icedtea-bin-8]
Available Java Virtual Machines:
  [1]   icedtea-8 
  [2]   icedtea-bin-8  system-vm

emerge -qpv media-gfx/gimp
[ebuild     UD] media-gfx/gimp-2.10.4 [2.10.6] USE="alsa mng udev -aalib (-altivec) (-aqua) -debug -doc -gnome -jpeg2k -openexr -postscript -python -smp -test -vector-icons -webp -wmf -xpm" CPU_FLAGS_X86="mmx sse" PYTHON_TARGETS="python2_7"
Comment 1 Toralf Förster gentoo-dev 2018-09-01 07:04:20 UTC
Created attachment 545680 [details]
emerge-info.txt
Comment 2 Toralf Förster gentoo-dev 2018-09-01 07:04:23 UTC
Created attachment 545682 [details]
emerge-history.txt
Comment 3 Toralf Förster gentoo-dev 2018-09-01 07:04:26 UTC
Created attachment 545684 [details]
etc.portage.tbz2
Comment 4 Toralf Förster gentoo-dev 2018-09-01 07:04:29 UTC
Created attachment 545686 [details]
logs.tbz2
Comment 5 Toralf Förster gentoo-dev 2018-09-01 07:04:32 UTC
Created attachment 545688 [details]
media-gfx:gimp-2.10.4:20180831-230734.log.bz2
Comment 6 Toralf Förster gentoo-dev 2018-09-01 07:04:36 UTC
Created attachment 545690 [details]
sandbox-30155.log
Comment 7 Gary E. Miller 2018-09-19 18:20:49 UTC
Same for me.
Comment 8 Gary E. Miller 2018-09-19 19:15:28 UTC
In make.conf I tried FEATURES="-sandbox" and FEATURES="-sandbox userpriv".  

Same failure.
Comment 9 Sebastian Pipping gentoo-dev 2018-09-20 12:21:52 UTC
That's a tricky one.

The related path caught my eye:

  F: mkostemp
  S: deny
  P: /usr/share/fonts/jmk/.uuid.TMP-XXXXXX
  A: /usr/share/fonts/jmk/.uuid.TMP-XXXXXX
  R: /usr/share/fonts/jmk/.uuid.TMP-XXXXXX
  C: /usr/bin/gegl-0.4 ../../icons/Symbolic/12/gimp-attach.png -o 12/gimp-attach.png -- gegl:invert-gamma 

Toralf's emerge history shows that he does have media-fonts/x11fonts-jmk-3.0-r1 installed so uninstalling that may or may not be a workaround.

Gegl does not call mkostemp directly, so we have a library layer in between.
Can someone else take over hunting down what part of the stack thinks it's a good idea to create tempfiles in /usr/share/fonts/ (in GDB?)?
Comment 10 Sebastian Pipping gentoo-dev 2018-09-20 13:48:47 UTC
Found a helpful hint at (the very last post of) https://forums.gentoo.org/viewtopic-p-8261480.html#8261480 now.  The JMK font is at fault, at least in part.  More in a minute. Fix upcoming.
Comment 11 Larry the Git Cow gentoo-dev 2018-09-20 14:01:37 UTC
The bug has been closed via the following commit(s):

https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=341377acab7338c419f4494d29dcac44685007a4

commit 341377acab7338c419f4494d29dcac44685007a4
Author:     Sebastian Pipping <sping@gentoo.org>
AuthorDate: 2018-09-20 13:55:11 +0000
Commit:     Sebastian Pipping <sping@gentoo.org>
CommitDate: 2018-09-20 14:01:17 +0000

    media-fonts/x11fonts-jmk: Turn into well-behaved font
    
    Lack of file /usr/share/fonts/jmk/.uuid
    causes sandbox violation issues in other packages.
    font_pkg_postinst take care of its creation now.
    Also bumped to EAPI 7 and "Unquoted Variable" warnings addressed.
    
    Closes: https://bugs.gentoo.org/665008
    
    Package-Manager: Portage-2.3.49, Repoman-2.3.10

 media-fonts/x11fonts-jmk/files/gzip.patch          |  4 +--
 .../x11fonts-jmk/x11fonts-jmk-3.0-r2.ebuild        | 38 ++++++++++++++++++++++
 2 files changed, 40 insertions(+), 2 deletions(-)
Comment 12 Gary E. Miller 2018-09-20 18:20:49 UTC
I do not have the x11fonts-jmk font installed.  I am blocking on a bunch of other fonts.  So just fixing x11fonts-jmk is not enough.
Comment 13 Sebastian Pipping gentoo-dev 2018-09-20 18:32:31 UTC
(In reply to Gary E. Miller from comment #12)
> I do not have the x11fonts-jmk font installed.  I am blocking on a bunch of
> other fonts.  So just fixing x11fonts-jmk is not enough.

Can you help out with finding the packages that fail to genenrate .uuid files?
Commands that may help:

# Find installed packages that contain fonts
find /usr/share/fonts/ -type f -exec qfile {} + | awk '{print $1}' | sort -u

# Find all UUID files
ls -1 /usr/share/fonts/*/.uuid

Thanks in advance!
Comment 14 Gary E. Miller 2018-09-20 19:12:34 UTC
blondie # find /usr/share/fonts/ -type f -exec qfile {} + | awk '{print $1}' | sort -u
app-misc/cmatrix
media-fonts/clearsans
media-fonts/corefonts
media-fonts/dejavu
media-fonts/encodings
media-fonts/font-adobe-100dpi
media-fonts/font-adobe-75dpi
media-fonts/font-adobe-utopia-100dpi
media-fonts/font-adobe-utopia-75dpi
media-fonts/font-adobe-utopia-type1
media-fonts/font-alias
media-fonts/font-arabic-misc
media-fonts/font-bh-100dpi
media-fonts/font-bh-75dpi
media-fonts/font-bh-lucidatypewriter-100dpi
media-fonts/font-bh-lucidatypewriter-75dpi
media-fonts/font-bh-ttf
media-fonts/font-bh-type1
media-fonts/font-bitstream-100dpi
media-fonts/font-bitstream-75dpi
media-fonts/font-bitstream-speedo
media-fonts/font-bitstream-type1
media-fonts/font-cronyx-cyrillic
media-fonts/font-cursor-misc
media-fonts/font-daewoo-misc
media-fonts/font-dec-misc
media-fonts/font-ibm-type1
media-fonts/font-isas-misc
media-fonts/font-jis-misc
media-fonts/font-micro-misc
media-fonts/font-misc-cyrillic
media-fonts/font-misc-ethiopic
media-fonts/font-misc-meltho
media-fonts/font-misc-misc
media-fonts/font-mutt-misc
media-fonts/font-schumacher-misc
media-fonts/font-screen-cyrillic
media-fonts/font-sony-misc
media-fonts/font-sun-misc
media-fonts/font-util
media-fonts/font-winitzki-cyrillic
media-fonts/font-xfree86-type1
media-fonts/liberation-fonts
media-fonts/libertine
media-fonts/sil-charis
media-fonts/sil-gentium
media-fonts/source-pro
media-fonts/stix-fonts
media-fonts/urw-fonts

blondie /usr/local/src/GPS/gpsd # # Find all UUID files
blondie /usr/local/src/GPS/gpsd # ls -1 /usr/share/fonts/*/.uuid
/usr/share/fonts/100dpi/.uuid
/usr/share/fonts/75dpi/.uuid
/usr/share/fonts/clearsans/.uuid
/usr/share/fonts/corefonts/.uuid
/usr/share/fonts/cyrillic/.uuid
/usr/share/fonts/dejavu/.uuid
/usr/share/fonts/encodings/.uuid
/usr/share/fonts/liberation-fonts/.uuid
/usr/share/fonts/libertine/.uuid
/usr/share/fonts/misc/.uuid
/usr/share/fonts/OTF/.uuid
/usr/share/fonts/sil-charis/.uuid
/usr/share/fonts/sil-gentium/.uuid
/usr/share/fonts/source-pro/.uuid
/usr/share/fonts/Speedo/.uuid
/usr/share/fonts/stix-fonts/.uuid
/usr/share/fonts/TTF/.uuid
/usr/share/fonts/Type1/.uuid
/usr/share/fonts/urw-fonts/.uuid
/usr/share/fonts/util/.uuid


I looked at it a different way:
# ls /usr/share/fonts
100dpi     cyrillic          libertine   sil-gentium  TTF
75dpi      dejavu            misc        source-pro   Type1
clearsans  encodings         OTF         Speedo       urw-fonts
corefonts  liberation-fonts  sil-charis  stix-fonts   util

blondie # ls /usr/share/fonts/*/.uuid
/usr/share/fonts/100dpi/.uuid            /usr/share/fonts/OTF/.uuid
/usr/share/fonts/75dpi/.uuid             /usr/share/fonts/sil-charis/.uuid
/usr/share/fonts/clearsans/.uuid         /usr/share/fonts/sil-gentium/.uuid
/usr/share/fonts/corefonts/.uuid         /usr/share/fonts/source-pro/.uuid
/usr/share/fonts/cyrillic/.uuid          /usr/share/fonts/Speedo/.uuid
/usr/share/fonts/dejavu/.uuid            /usr/share/fonts/stix-fonts/.uuid
/usr/share/fonts/encodings/.uuid         /usr/share/fonts/TTF/.uuid
/usr/share/fonts/liberation-fonts/.uuid  /usr/share/fonts/Type1/.uuid
/usr/share/fonts/libertine/.uuid         /usr/share/fonts/urw-fonts/.uuid
/usr/share/fonts/misc/.uuid              /usr/share/fonts/util/.uuid

Seems like my installed ones have .uuid now.  And gimp now compiles on that host.  I'll go look at some other hosts that also had issues.
Comment 15 Gary E. Miller 2018-09-20 19:31:17 UTC
I can't make it fail anywhere today.  Must be fixed.  Thanks!

RGDS
GARY
Comment 16 Sebastian Pipping gentoo-dev 2018-09-20 19:46:22 UTC
Thanks for that list of packages!

I took that list, remove all that inherit eclass font and all that inherit the xorg-2 eclass that match name pattern media-fonts/font* (as xorg-2 inherits font for those).  Three packages remain:

  app-misc/cmatrix
  media-fonts/encodings
  media-fonts/source-pro

Will have a closer look at these soon.
Comment 17 Sebastian Pipping gentoo-dev 2018-09-20 19:48:08 UTC
(In reply to Gary E. Miller from comment #15)
> I can't make it fail anywhere today.

That's probably because the fixing code fixes it for all fonts at once so the issue can only be observed when the last font installed is one of the troublemakers, which makes it a bit harder to spot.
Comment 18 Sebastian Pipping gentoo-dev 2018-09-20 22:10:28 UTC
I believe I have found all left troublemakers installing fonts without updating the cache, properly.  They are:

  - media-fonts/encodings
  - media-fonts/mplus-fonts
  - (app-misc/cmatrix)

Related commits in a few seconds.
Comment 19 Larry the Git Cow gentoo-dev 2018-09-20 22:10:54 UTC
The bug has been closed via the following commit(s):

https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=126125a0696c9bb4d8ca488aed5fef56c45748fe

commit 126125a0696c9bb4d8ca488aed5fef56c45748fe
Author:     Sebastian Pipping <sping@gentoo.org>
AuthorDate: 2018-09-20 22:04:28 +0000
Commit:     Sebastian Pipping <sping@gentoo.org>
CommitDate: 2018-09-20 22:10:43 +0000

    app-misc/cmatrix: Waterproof font .uuid file creation
    
    Lack of file /usr/share/fonts/misc/.uuid
    would cause sandbox violation issues in other packages.
    font_pkg_postinst take care of its creation now.
    
    Closes: https://bugs.gentoo.org/665008
    
    Package-Manager: Portage-2.3.49, Repoman-2.3.10

 app-misc/cmatrix/cmatrix-1.2a-r4.ebuild | 55 +++++++++++++++++++++++++++++++++
 1 file changed, 55 insertions(+)

Additionally, it has been referenced in the following commit(s):

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

commit e92658356c92d1bee109ebce19d60e7ab51269e5
Author:     Sebastian Pipping <sping@gentoo.org>
AuthorDate: 2018-09-20 21:50:21 +0000
Commit:     Sebastian Pipping <sping@gentoo.org>
CommitDate: 2018-09-20 22:10:43 +0000

    media-fonts/mplus-fonts: Turn into well-behaved font + EAPI 6
    
    Lack of file /usr/share/fonts/mplus/.uuid
    causes sandbox violation issues in other packages.
    font_pkg_postinst take care of its creation now.
    
    Bug: https://bugs.gentoo.org/665008
    
    Package-Manager: Portage-2.3.49, Repoman-2.3.10

 .../mplus-fonts/mplus-fonts-2.2.4-r1.ebuild        | 32 ++++++++++++++++++++++
 1 file changed, 32 insertions(+)

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

commit b9d7af55d844b0ba0da7030fc84283a94d7d2a8a
Author:     Sebastian Pipping <sping@gentoo.org>
AuthorDate: 2018-09-20 21:29:03 +0000
Commit:     Sebastian Pipping <sping@gentoo.org>
CommitDate: 2018-09-20 22:10:43 +0000

    media-fonts/encodings: Turn into well-behaved font
    
    Lack of file /usr/share/fonts/encodings/.uuid
    causes sandbox violation issues in other packages.
    font_pkg_postinst take care of its creation now.
    
    eclass xorg-2.eclass would inherit font.eclass for us
    but package "media-fonts/encodings" does not pass the guard
    for pattern media-fonts/font* in xorg-2.eclass, so we need
    to inherit font.eclass, explicitly.
    
    Bug: https://bugs.gentoo.org/665008
    
    Package-Manager: Portage-2.3.49, Repoman-2.3.10

 media-fonts/encodings/encodings-1.0.4-r2.ebuild | 15 +++++++++++++++
 1 file changed, 15 insertions(+)
Comment 20 Arfrever Frehtes Taifersar Arahesis 2018-09-21 09:49:53 UTC
font.eclass has 'EXPORT_FUNCTIONS pkg_setup src_install pkg_postinst pkg_postrm'.
Blindly inheriting font.eclass at the end of 'inherit' line results in losing exported functions from other eclasses.


media-fonts/encodings-1.0.4-r2 is missing calls to xorg-2_src_install, xorg-2_pkg_postinst and xorg-2_pkg_postrm.
Not calling xorg-2_src_install means that no "fonts" are actually installed.


(app-misc/cmatrix, media-fonts/mplus-fonts and media-fonts/x11fonts-jmk are not affected by this problem.)
Comment 21 Larry the Git Cow gentoo-dev 2018-09-21 11:21:57 UTC
The bug has been closed via the following commit(s):

https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=76860aa860c8656ca8d14b81b6327d4116324eff

commit 76860aa860c8656ca8d14b81b6327d4116324eff
Author:     Sebastian Pipping <sping@gentoo.org>
AuthorDate: 2018-09-21 11:18:12 +0000
Commit:     Sebastian Pipping <sping@gentoo.org>
CommitDate: 2018-09-21 11:21:16 +0000

    media-fonts/encodings: Fix xorg-2_src_install shadowing regression
    
    xorg-2_pkg_post* are called to be future proof, only.
    
    Closes: https://bugs.gentoo.org/665008
    Package-Manager: Portage-2.3.49, Repoman-2.3.10

 ...ncodings-1.0.4-r2.ebuild => encodings-1.0.4-r3.ebuild} | 15 ++++++++++++++-
 1 file changed, 14 insertions(+), 1 deletion(-)
Comment 22 Mart Raudsepp gentoo-dev 2018-10-06 19:19:38 UTC
Sebastian, you've now made media-fonts/encodings[X] depend on media-fonts/encodings, apparently without review by the maintainers of the package.
Comment 23 Larry the Git Cow gentoo-dev 2018-10-06 21:26:16 UTC
The bug has been referenced in the following commit(s):

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

commit a1e6953a95b26a413efdb5a3ab3da661140d5552
Author:     Chí-Thanh Christopher Nguyễn <chithanh@gentoo.org>
AuthorDate: 2018-10-06 21:25:21 +0000
Commit:     Chí-Thanh Christopher Nguyễn <chithanh@gentoo.org>
CommitDate: 2018-10-06 21:25:21 +0000

    profiles/base/package.use.mask: mask X flag for media-fonts/encodings
    
    Bug: https://bugs.gentoo.org/show_bug.cgi?id=665008
    Signed-off-by: Chí-Thanh Christopher Nguyễn <chithanh@gentoo.org>

 profiles/base/package.use.mask | 4 ++++
 1 file changed, 4 insertions(+)
Comment 24 Larry the Git Cow gentoo-dev 2019-06-17 17:15:34 UTC
The bug has been closed via the following commit(s):

https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=983b6aa3d9ea6b265442cd149801a4f8959b4cc7

commit 983b6aa3d9ea6b265442cd149801a4f8959b4cc7
Author:     Matt Turner <mattst88@gentoo.org>
AuthorDate: 2019-06-17 16:20:49 +0000
Commit:     Matt Turner <mattst88@gentoo.org>
CommitDate: 2019-06-17 17:13:45 +0000

    font.eclass: Don't set IUSE=X for media-fonts/encodings
    
    Closes: https://bugs.gentoo.org/665008
    Signed-off-by: Matt Turner <mattst88@gentoo.org>

 eclass/font.eclass | 13 +++++++------
 1 file changed, 7 insertions(+), 6 deletions(-)