Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 543774 - sys-apps/portage: triggering a sandbox violation during portage dep generation fails badly: * ISE:write_logfile: unable to append logfile: ...
Summary: sys-apps/portage: triggering a sandbox violation during portage dep generatio...
Alias: None
Product: Portage Development
Classification: Unclassified
Component: Sandbox (show other bugs)
Hardware: All Linux
: Normal normal (vote)
Assignee: Portage team
Depends on:
Reported: 2015-03-19 10:18 UTC by Martin Mokrejš
Modified: 2015-09-28 22:11 UTC (History)
1 user (show)

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


Note You need to log in before you can comment on or make changes to this bug.
Description Martin Mokrejš 2015-03-19 10:18:03 UTC
By mistake when renaming a file in SRC_URI I made ebuild to crash badly (two line shown below):

SRC_URI=""${PV}".tar.gz" -> ${P}.tar.gz


I believe this bug should be used to derive a separate app-shells/bash-4.2_p47 bug while this report itself should stay about sys-apps/portage-2.2.15.

$ ebuild transdecoder-2.0.1.ebuild digest
 * ACCESS DENIED:  open_wr:      /usr/lib64/python2.7/site-packages/transdecoder-2.0.1.tar.gz
 * ISE:write_logfile: unable to append logfile: sci-biology_-_transdecoder-2.0.1
 * ../../sandbox-2.6/libsandbox/libsandbox.c:check_syscall():879: failure (Bad file descriptor):
 * ISE:
        abs_path: /usr/lib64/python2.7/site-packages/transdecoder-2.0.1.tar.gz
        res_path: /usr/lib64/python2.7/site-packages/transdecoder-2.0.1.tar.gz
/proc/30307/cmdline: /bin/bash /usr/lib/portage/python2.7/ depend 

/home/mmokrejs/proj/sci/sci-biology/transdecoder/transdecoder-2.0.1.ebuild: line 11: 30307 Aborted                 (core dumped) SRC_URI=""${PV}".tar.gz" - > "${P}".tar.gz
>>> Creating Manifest for /home/mmokrejs/proj/sci/sci-biology/transdecoder
Comment 1 SpanKY gentoo-dev 2015-09-28 05:05:46 UTC
i think this is portage not setting up the sandbox env vars properly, and not checking the log status after the depend phase

SANDBOX_LOG is set to a relative path ("sci-biology_-_transdecoder-2.0.1"), and the working directory is somewhere weird/bad (/usr/lib64/python2.7/site-packages/).  portage should really be setting the sandbox.log to a constant location like $T/sandbox.log even during depend phases.
Comment 2 Zac Medico gentoo-dev 2015-09-28 22:11:58 UTC
Yeah, the EbuildMetadataPhase class need to be fixed to handle SANDBOX_LOG. I guess we can have it just create a temporary file, since creating directories seems like overkill.

The invalid SANDBOX_LOG setting comes from here:

pym/portage/package/ebuild/ mysettings["SANDBOX_LOG"] = mycpv.replace("/", "_-_")