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

Bug 700830

Summary: Multiple packages w/ EAPI-7/ENV_UNSET: src_configure(): sandbox violation() in /proc/self/oom_score_adj by /usr/bin/dbus-daemon --syslog-only --fork --print-pid 5 --print-address 7 --session
Product: Gentoo Linux Reporter: Thomas Capricelli <orzel>
Component: Current packagesAssignee: Portage team <dev-portage>
Status: RESOLVED FIXED    
Severity: normal CC: abbat.2008, fatalerrors, josef64, kde, krinpaus, lowsfer
Priority: Normal Keywords: InVCS
Version: unspecified   
Hardware: All   
OS: Linux   
See Also: https://bugs.gentoo.org/show_bug.cgi?id=692178
https://bugs.gentoo.org/show_bug.cgi?id=678436
Whiteboard:
Package list:
Runtime testing required: ---
Bug Depends on:    
Bug Blocks: 706142, 711148    
Attachments: build.log
build.log for kde-frameworks/purpose-5.68.0 with Portage 2.3.96
environment for kde-frameworks/purpose-5.68.0 with Portage 2.3.96
build.log for a successful configure with 'env -u DISPLAY'
environment for a successful configure with 'env -u DISPLAY'

Description Thomas Capricelli 2019-11-20 23:51:21 UTC
Probably one of these is responsible, (full log attached):

-- The following RUNTIME packages have not been found:
 * Ubuntu.OnlineAccounts-QMLModule, Ubuntu.OnlineAccounts is a runtime dependency

 * --------------------------- ACCESS VIOLATION SUMMARY ---------------------------


Reproducible: Always
Comment 1 Thomas Capricelli 2019-11-20 23:51:45 UTC
Created attachment 596982 [details]
build.log
Comment 2 Thomas Capricelli 2019-11-21 21:59:16 UTC
I know have the exact same problem with other packages, such as kde-apps/akonadi, kde-aps/kimap, ..

It blocks my system update, and partial updates mean that most applications can't start anymore.
Comment 3 Thomas Capricelli 2019-11-22 03:29:11 UTC
I can turn around the problem by issueing this before emerging:

unsetenv KONSOLE_DBUS_SERVICE KONSOLE_DBUS_SESSION KONSOLE_DBUS_WINDOW DBUS_SESSION_BUS_ADDRESS DISPLAY KDEWM DESKTOP_SESSION  SESSION_MANAGER XDG_CURRENT_DESKTOP

Actually, it reminds me of a similar problem, but i can't find the gentoo ticket number. It was more kde than dbus, but still something similar where a gui-related thing was making the sandbox unhappy, and you could unset some variables to prevent this to happen.

Sorry to no be more precise :-(

I still consider this a bug though, so i leave the ticket open.
Comment 4 Andreas Sturmlechner gentoo-dev 2019-12-08 15:04:33 UTC
We need to find a standard way to disable use of qmlplugindump.

First step is to make purpose use the standard ECM module: https://cgit.kde.org/purpose.git/commit/?id=8d7123896b988384c756cb948667ea08b86533f4
Comment 5 Andreas Sturmlechner gentoo-dev 2019-12-08 15:31:27 UTC
Step two: Provide an option in extra-cmake-modules.
Comment 6 Andreas Sturmlechner gentoo-dev 2019-12-08 16:55:14 UTC
(In reply to Thomas Capricelli from comment #2)
> I know have the exact same problem with other packages, such as
> kde-apps/akonadi, kde-aps/kimap, ..

Can you please be more precise? It can't quite be the same problem, please file individual bugs for other packages.
Comment 7 Larry the Git Cow gentoo-dev 2019-12-08 17:14:11 UTC
The bug has been referenced in the following commit(s):

https://gitweb.gentoo.org/proj/kde.git/commit/?id=efa0fa211dbc67d3c0d7b8360d5b36ac49b4686e

commit efa0fa211dbc67d3c0d7b8360d5b36ac49b4686e
Author:     Andreas Sturmlechner <asturm@gentoo.org>
AuthorDate: 2019-12-08 16:54:19 +0000
Commit:     Andreas Sturmlechner <asturm@gentoo.org>
CommitDate: 2019-12-08 16:55:59 +0000

    kde-frameworks/purpose: Add more missing RDEPENDs, use ecm_find_qmlmodule
    
    Upstream commit 8d7123896b988384c756cb948667ea08b86533f4
    
    Bug: https://bugs.gentoo.org/700830
    Package-Manager: Portage-2.3.81, Repoman-2.3.20
    Signed-off-by: Andreas Sturmlechner <asturm@gentoo.org>

 .../files/purpose-5.64.0-ecmqmlmodules.patch       | 45 ++++++++++++++++++++++
 kde-frameworks/purpose/purpose-5.65.0.ebuild       |  5 +++
 kde-frameworks/purpose/purpose-9999.ebuild         |  3 ++
 3 files changed, 53 insertions(+)
Comment 8 Larry the Git Cow gentoo-dev 2019-12-08 17:24:58 UTC
The bug has been referenced in the following commit(s):

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

commit afdef498028112c60b29fd74c4eaec102c2a7dc8
Author:     Andreas Sturmlechner <asturm@gentoo.org>
AuthorDate: 2019-12-08 17:18:01 +0000
Commit:     Andreas Sturmlechner <asturm@gentoo.org>
CommitDate: 2019-12-08 17:24:18 +0000

    kde-frameworks/purpose: Add USE dolphin, RDEPENDs, ecm_find_qmlmodule
    
    Add USE dolphin and missing RDEPEND
    Upstream commit 8d7123896b988384c756cb948667ea08b86533f4
    
    Bug: https://bugs.gentoo.org/700830
    Package-Manager: Portage-2.3.81, Repoman-2.3.20
    Signed-off-by: Andreas Sturmlechner <asturm@gentoo.org>

 .../files/purpose-5.64.0-ecmqmlmodules.patch       | 32 ++++++++++++
 kde-frameworks/purpose/metadata.xml                |  1 +
 kde-frameworks/purpose/purpose-5.64.0-r2.ebuild    | 60 ++++++++++++++++++++++
 3 files changed, 93 insertions(+)
Comment 9 Thomas Capricelli 2019-12-09 13:44:13 UTC
(In reply to Andreas Sturmlechner from comment #6)
> (In reply to Thomas Capricelli from comment #2)
> > I know have the exact same problem with other packages, such as
> > kde-apps/akonadi, kde-aps/kimap, ..
> 
> Can you please be more precise? It can't quite be the same problem, please
> file individual bugs for other packages.

What do you want more ? akonadi and kimap have the same output. I can provide some more examples, such as net-analyzer/nmap-7.80 or media-gfx/gimp-2.10.14 (checked today with an up-to-date portage tree).

Common output ends exactly with:

 * --------------------------- 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: /proc/self/oom_score_adj
A: /proc/self/oom_score_adj
R: /proc/200/oom_score_adj
C: /usr/bin/dbus-daemon --syslog-only --fork --print-pid 5 --print-address 7 --session 

F: open_wr
S: deny
P: /proc/self/oom_score_adj
A: /proc/self/oom_score_adj
R: /proc/200/oom_score_adj
C: /usr/bin/dbus-daemon --syslog-only --fork --print-pid 5 --print-address 7 --session 
 * --------------------------------------------------------------------------------
Comment 10 Andreas Sturmlechner gentoo-dev 2019-12-09 14:17:54 UTC
(In reply to Thomas Capricelli from comment #9)
> What do you want more ? akonadi and kimap have the same output. I can
> provide some more examples, such as net-analyzer/nmap-7.80 or
> media-gfx/gimp-2.10.14 (checked today with an up-to-date portage tree).

Very weird. Then all I've been doing so far was well and good and for fixing the linked bugs, but actually not related to your issue.

Please add emerge --info.
Comment 11 Matt Whitlock 2019-12-10 20:28:11 UTC
ENV_UNSET does not appear to be working correctly, as this succeeds:

# env -u DISPLAY emerge -1 '=kde-frameworks/purpose-5.64.0-r2'

but this fails:

# emerge -1 '=kde-frameworks/purpose-5.64.0-r2'

with the aforementioned sandbox violation:

-- qmlplugindump failed for Ubuntu.OnlineAccounts.
-- Could NOT find Ubuntu.OnlineAccounts-QMLModule (missing: Ubuntu.OnlineAccounts-QMLModule_FOUND) 
 * ACCESS DENIED:  open_wr:      /proc/self/oom_score_adj
 * ACCESS DENIED:  open_wr:      /proc/self/oom_score_adj
Comment 12 Thomas Capricelli 2020-02-19 08:59:41 UTC
The workaround (env -u DISPLAY) works for me.
Comment 13 Andreas Sturmlechner gentoo-dev 2020-03-01 22:34:41 UTC
*** Bug 711248 has been marked as a duplicate of this bug. ***
Comment 14 josef.95 2020-03-01 23:25:17 UTC
Another "workaround" is probably, using emerge from a proper rot login shell, like
tty linux textconsole
or su -l
or sudo -i emerge ...
Comment 15 josef.95 2020-03-01 23:29:32 UTC
Sorry, "root login shell" was meant.
Comment 16 Matt Whitlock 2020-03-02 05:26:11 UTC
(In reply to josef.95 from comment #14)
> Another "workaround" is probably, using emerge from a proper rot login
> shell, like
> tty linux textconsole
> or su -l
> or sudo -i emerge ...

I typically run emerge from a root shell obtained by "exec su -". (The '-' argument is equivalent to '-l'.) That's not enough to unset DISPLAY from the environment. ('su' copies the DISPLAY variable into the target environment, with or without --preserve-environment.)
Comment 17 Andree Chea 2020-03-04 04:43:25 UTC
I experienced the same issue with purpose-5.64.0 last decade and was able to get past it by starting emerge in a root tty thanks to a few tips.  The issue came up again recently with purpose-5.67.0, so FWIW I'm coming here to put my two cents that the blank tty root login works for me.
Comment 18 Alexander 2020-03-20 04:42:06 UTC
(In reply to Matt Whitlock from comment #11)
> ENV_UNSET does not appear to be working correctly, as this succeeds:
> 
> # env -u DISPLAY emerge -1 '=kde-frameworks/purpose-5.64.0-r2'
> 
> but this fails:
> 
> # emerge -1 '=kde-frameworks/purpose-5.64.0-r2'
> 
> with the aforementioned sandbox violation:
> 
> -- qmlplugindump failed for Ubuntu.OnlineAccounts.
> -- Could NOT find Ubuntu.OnlineAccounts-QMLModule (missing:
> Ubuntu.OnlineAccounts-QMLModule_FOUND) 
>  * ACCESS DENIED:  open_wr:      /proc/self/oom_score_adj
>  * ACCESS DENIED:  open_wr:      /proc/self/oom_score_adj

kde-frameworks/purpose-5.68.0

Found Ubuntu.OnlineAccounts-QMLModule: TRUE (found version "")  
 * ACCESS DENIED:  open_wr:      /proc/self/oom_score_adj
 * ACCESS DENIED:  open_wr:      /proc/self/oom_score_adj
 * ACCESS DENIED:  open_wr:      /proc/self/oom_score_adj
 * ACCESS DENIED:  open_wr:      /proc/self/oom_score_adj
-- Found org.kde.kdeconnect-QMLModule: TRUE (found version "")  
-- Found org.kde.kquickcontrolsaddons-QMLModule: TRUE (found version "")  
-- Found PkgConfig: x86_64-pc-linux-gnu-pkg-config (found version "0.29.2")

The error is the same, Ubuntu.OnlineAccounts-QMLModule is present in the system, but for some reason the version number is not shown.

env -u DISPLAY emerge -1 kde-frameworks / purpose
helps.

And also disable sandbox FEATURES="-sandbox -usersandbox"
Comment 19 Matt Whitlock 2020-03-20 04:48:53 UTC
(In reply to Alexander from comment #18)

Disable sandbox is NOT A GOOD IDEA, as then you're opening up your whole system to whatever the upstream build process wants to do to it *as root*. Sandbox is there for very good reason.
Comment 20 Andreas Sturmlechner gentoo-dev 2020-03-25 17:09:37 UTC
Is it still happening with up to date versions of portage?
Comment 21 Andreas Sturmlechner gentoo-dev 2020-03-25 17:38:03 UTC
You don't have a custom /etc/portage/bashrc, by chance?
Comment 22 Matt Whitlock 2020-03-25 18:19:55 UTC
(In reply to Andreas Sturmlechner from comment #20)
> Is it still happening with up to date versions of portage?

Still happens with Portage 2.3.96.

(In reply to Andreas Sturmlechner from comment #21)
> You don't have a custom /etc/portage/bashrc, by chance?

It happens with an empty /etc/portage/bashrc.
Comment 23 Andreas Sturmlechner gentoo-dev 2020-03-26 13:58:04 UTC
Please attach `environment` from that build as well, same dir as build.log.
Comment 24 Thomas Capricelli 2020-03-26 14:42:04 UTC
I can confirm the problem with kde-frameworks/purpose-5.68.0 and sys-apps/portage-2.3.96-r1

/etc/portage/bashrc is not present on the system.
Comment 25 Matt Whitlock 2020-03-26 16:53:30 UTC
Created attachment 626124 [details]
build.log for kde-frameworks/purpose-5.68.0 with Portage 2.3.96
Comment 26 Matt Whitlock 2020-03-26 16:54:17 UTC
Created attachment 626126 [details]
environment for kde-frameworks/purpose-5.68.0 with Portage 2.3.96

(In reply to Andreas Sturmlechner from comment #23)
> Please attach `environment` from that build as well, same dir as build.log.
Comment 27 Matt Whitlock 2020-03-26 16:57:43 UTC
Created attachment 626128 [details]
build.log for a successful configure with 'env -u DISPLAY'
Comment 28 Matt Whitlock 2020-03-26 16:58:02 UTC
Created attachment 626130 [details]
environment for a successful configure with 'env -u DISPLAY'
Comment 29 Andreas Sturmlechner gentoo-dev 2020-03-26 22:28:42 UTC
Well, I'm at a loss. Re-assigning to dev-portage for what seems to be an ENV_UNSET issue.
Comment 30 Luis Lucas 2020-04-12 21:25:25 UTC
Same problem here compiling kde-frameworks/purpose
Comment 31 Zac Medico gentoo-dev 2020-04-12 22:43:03 UTC
What does emerge --info show for the ENV_UNSET variable? I have this:

> # emerge --info | grep ENV_UNSET
> 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"
Comment 32 Zac Medico gentoo-dev 2020-04-12 22:54:09 UTC
(In reply to Matt Whitlock from comment #26)
> Created attachment 626126 [details]
> environment for kde-frameworks/purpose-5.68.0 with Portage 2.3.96

I see an appropriate ENV_UNSET setting there, and no DISPLAY setting. That's for a failed build supposedly triggered by a DISPLAY setting?
Comment 33 Luis Lucas 2020-04-12 22:55:36 UTC
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"
Comment 35 Larry the Git Cow gentoo-dev 2020-04-12 23:44:56 UTC
The bug has been referenced in the following commit(s):

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

commit 01b0693dd0c5a8d20591cea805cbe4c4988585b7
Author:     Zac Medico <zmedico@gentoo.org>
AuthorDate: 2020-04-12 23:40:37 +0000
Commit:     Zac Medico <zmedico@gentoo.org>
CommitDate: 2020-04-12 23:44:45 +0000

    sys-apps/portage: 2.3.99-r1 revbump for bug 700830
    
     #700830 fix ENV_UNSET for DISPLAY variable
    
    Bug: https://bugs.gentoo.org/711148
    Bug: https://bugs.gentoo.org/700830
    Package-Manager: Portage-2.3.99, Repoman-2.3.22
    Signed-off-by: Zac Medico <zmedico@gentoo.org>

 sys-apps/portage/{portage-2.3.99.ebuild => portage-2.3.99-r1.ebuild} | 3 +++
 1 file changed, 3 insertions(+)
Comment 36 Larry the Git Cow gentoo-dev 2020-04-12 23:46:07 UTC
The bug has been referenced in the following commit(s):

https://gitweb.gentoo.org/proj/portage.git/commit/?id=5570a96ddc859851036035baa4da65df2daa51a0

commit 5570a96ddc859851036035baa4da65df2daa51a0
Author:     Zac Medico <zmedico@gentoo.org>
AuthorDate: 2020-04-12 23:11:06 +0000
Commit:     Zac Medico <zmedico@gentoo.org>
CommitDate: 2020-04-12 23:45:31 +0000

    special_env_vars: add ENV_UNSET to environ_whitelist (bug 700830)
    
    Add ENV_UNSET to the environ_whitelist. Since DISPLAY is also in
    the environ_whitelist, ENV_UNSET must also be in environ_whitelist
    in order to unset DISPLAY.
    
    Fixes: a5e02c92fd72 ("Support ENV_UNSET for EAPI 7")
    Bug: https://bugs.gentoo.org/700830
    Signed-off-by: Zac Medico <zmedico@gentoo.org>

 lib/portage/package/ebuild/_config/special_env_vars.py | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
Comment 37 Larry the Git Cow gentoo-dev 2020-04-12 23:59:27 UTC
The bug has been referenced in the following commit(s):

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

commit d291d12dfcfca0a5b8ed6bf3535488f50a94efc8
Author:     Zac Medico <zmedico@gentoo.org>
AuthorDate: 2020-04-12 23:54:31 +0000
Commit:     Zac Medico <zmedico@gentoo.org>
CommitDate: 2020-04-12 23:55:01 +0000

    sys-apps/portage: stable 2.3.89-r2 revbump for bug 700830
    
     #700830 fix ENV_UNSET for DISPLAY variable
    
    Bug: https://bugs.gentoo.org/706142
    Bug: https://bugs.gentoo.org/700830
    Package-Manager: Portage-2.3.99, Repoman-2.3.22
    Signed-off-by: Zac Medico <zmedico@gentoo.org>

 .../portage/{portage-2.3.89-r1.ebuild => portage-2.3.89-r2.ebuild}     | 3 +++
 1 file changed, 3 insertions(+)