Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 429372 - dev-python/pypy USE=sandbox - Fatal error during initialization: out of memory
Summary: dev-python/pypy USE=sandbox - Fatal error during initialization: out of memory
Status: RESOLVED WONTFIX
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: New packages (show other bugs)
Hardware: AMD64 Linux
: Normal normal (vote)
Assignee: Python Gentoo Team
URL:
Whiteboard:
Keywords: PMASKED
Depends on:
Blocks:
 
Reported: 2012-08-01 15:41 UTC by Mehrunes Dagon
Modified: 2018-04-21 08:00 UTC (History)
2 users (show)

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


Attachments
emerge --info dev-python/pypy (emerge--info,5.45 KB, text/plain)
2012-08-01 15:41 UTC, Mehrunes Dagon
Details
log of successful build/installation (success.log.zip,50.39 KB, text/plain)
2012-08-01 15:44 UTC, Mehrunes Dagon
Details
log of failed installation (failure.log.zip,34.30 KB, application/zip)
2012-08-01 15:46 UTC, Mehrunes Dagon
Details
incomplete(!) patch for improving sandbox support (pypy-ebuild.patch,3.09 KB, patch)
2012-08-02 11:53 UTC, Marien Zwart (RETIRED)
Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Mehrunes Dagon 2012-08-01 15:41:07 UTC
Created attachment 319990 [details]
emerge --info dev-python/pypy

pypy build successfully, but last action of src_install() failed. Error messages were
=====
>>> Install pypy-1.9-r1 into /tmp/portage/dev-python/pypy-1.9-r1/image/ category dev-python
sll_os.ll_os_getenv(sPYPY_GC_NURSERYFatal error during initialization: out of memory
...

Generation of Grammar and PatternGrammar pickles failed
=====
Marien Zwart suggested to turn off sandbox USE flag. This solved the problem for me.

I further suggest adding the hint to .ebuild, like that: 
======
# diff pypy-1.9-r1.ebuild pypy-1.9-r2.ebuild 
110c110,113
<       PYTHONPATH="${ED}${INSPATH}/lib_pypy/__extensions__:${ED}${INSPATH}/lib_pypy:${ED}${INSPATH}/lib-python/modified-2.7:${ED}${INSPATH}/lib-python/2.7" "${ED}${INSPATH}/pypy-c" -c "import lib2to3.pygram, lib2to3.patcomp; lib2to3.patcomp.PatternCompiler()" || die "Generation of Grammar and PatternGrammar pickles failed"
---
>       PYTHONPATH="${ED}${INSPATH}/lib_pypy/__extensions__:${ED}${INSPATH}/lib_pypy:${ED}${INSPATH}/lib-python/modified-2.7:${ED}${INSPATH}/lib-python/2.7" "${ED}${INSPATH}/pypy-c" -c "import lib2to3.pygram, lib2to3.patcomp; lib2to3.patcomp.PatternCompiler()" || {
>   use sandbox && die "Installation failed. Suggested solution: disable sandbox USE-flag"
>   die "Generation of Grammar and PatternGrammar pickles failed"
>  }
======
I attach emerge--info, success.log, failure.log
Comment 1 Mehrunes Dagon 2012-08-01 15:44:39 UTC
Created attachment 319992 [details]
log of successful build/installation
Comment 2 Mehrunes Dagon 2012-08-01 15:46:46 UTC
Created attachment 319994 [details]
log of failed installation
Comment 3 Mehrunes Dagon 2012-08-01 15:48:08 UTC
Comment on attachment 319994 [details]
log of failed installation

Bug tracker does not let me attach plain text of size 967375 or 639352, so I compressed the files to .zip
Comment 4 Marien Zwart (RETIRED) gentoo-dev 2012-08-02 11:53:03 UTC
Created attachment 320042 [details, diff]
incomplete(!) patch for improving sandbox support

A pypy built with USE=sandbox does not run on its own: it needs to talk to a helper process for any system interaction, including starting up (because this involves looking at one or more env vars, and access to the env is funneled through that helper process). The build fails because the ebuild needs to run the built pypy to build some grammar pickles and the like.

I think a more useful thing for USE=sandbox to do is build an additional pypy executable exclusively sandboxing. We should build that one with more restrictive build flags, as upstream is "more confident" in a sandboxed pypy without JIT, and linking to sqlite and friends defeats the sandboxing. And we can build the sandboxed pypy with the regular pypy we just built for speed. The attached patch does that, and some additional improvements. Note this is incomplete (it won't even work for you unless you edit back out the additional epatch).

However, I'm not entirely sure USE=sandbox is of any use right now, as the only implementation of a sandbox control process I know of sits in the pypy source tree, and needs some undefined (substantial) subset of that source tree to function. If people need to check out a matching version of pypy to actually use a USE=sandbox pypy I think it makes more sense to have them build the executable too.
Comment 5 Michał Górny archtester Gentoo Infrastructure gentoo-dev Security 2013-11-10 08:26:33 UTC
AFAIR additional sandboxed binary is what other distros do. However, I'm not sure if we really want or need that. In any case, someone needs to provide a complete, well-tested patch.
Comment 6 Michał Górny archtester Gentoo Infrastructure gentoo-dev Security 2013-11-10 11:14:20 UTC
I've masked the flag via package.use.mask.
Comment 7 Michał Górny archtester Gentoo Infrastructure gentoo-dev Security 2018-04-21 08:00:55 UTC
In any case, this is not something we're going to support, I guess.