Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 934079 - dev-lang/python-3.13.0_beta2 Compile Failure - Sandbox Access Violations
Summary: dev-lang/python-3.13.0_beta2 Compile Failure - Sandbox Access Violations
Status: RESOLVED FIXED
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: Current packages (show other bugs)
Hardware: All Linux
: Normal normal
Assignee: Python Gentoo Team
URL:
Whiteboard:
Keywords:
: 932790 (view as bug list)
Depends on:
Blocks:
 
Reported: 2024-06-12 00:15 UTC by Reuben Farrelly
Modified: 2024-07-21 02:44 UTC (History)
11 users (show)

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


Attachments
emerge --info (emerge info.txt,6.42 KB, text/plain)
2024-06-12 00:16 UTC, Reuben Farrelly
Details
Entire build log (python full build log.txt,224.91 KB, text/plain)
2024-06-12 00:17 UTC, Reuben Farrelly
Details
build temp directory logs (temp.tar.gz,56.33 KB, application/x-gzip)
2024-06-12 00:19 UTC, Reuben Farrelly
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Reuben Farrelly 2024-06-12 00:15:35 UTC
I currently have python 3.13.0_beta1_p3 installed - as a parallel install with python 3.12 which is the primary version I am using.

However python 3.13.0_beta2 does not compile due to sandbox errors.  3.13.0_beta1_p3 did obviously compile and was installed on 27-May succesfully.

[ebuild     U #] dev-lang/python-3.13.0_beta2:3.13::gentoo [3.13.0_beta1_p3:3.13::gentoo] USE="debug ensurepip gdbm gil ncurses readline sqlite ssl -bluetooth -build -examples -jit -libedit -pgo -test -tk -valgrind -verify-sig (-big-endian%)" LLVM_SLOT="18" 0 KiB

...

x86_64-pc-linux-gnu-gcc -c -fno-strict-overflow -Wsign-compare     -O2 -pipe -march=skylake -mtune=native -fwrapv -std=c11 -Wextra -Wno-unused-parameter -Wno-missing-field-initializers -Wstrict-prototypes -Werror=implicit-function-declaration -fvisibility=hidden  -I./Include/internal -I./Include/internal/mimalloc  -I. -I./Include -I/usr/include/ncursesw  -fPIC -DPy_BUILD_CORE -o Programs/_bootstrap_python.o Programs/_bootstrap_python.c
x86_64-pc-linux-gnu-gcc -shared   -Wl,-O1 -Wl,--as-needed -Wl,-z,pack-relative-relocs   Modules/sha2module.o  Modules/_hacl/libHacl_Hash_SHA2.a  -o Modules/_sha2.cpython-313-x86_64-linux-gnu.so
x86_64-pc-linux-gnu-gcc     -o _bootstrap_python Modules/getbuildinfo.o Parser/token.o  Parser/pegen.o Parser/pegen_errors.o Parser/action_helpers.o Parser/parser.o Parser/string_parser.o Parser/peg_api.o Parser/lexer/buffer.o Parser/lexer/lexer.o Parser/lexer/state.o Parser/tokenizer/file_tokenizer.o Parser/tokenizer/readline_tokenizer.o Parser/tokenizer/string_tokenizer.o Parser/tokenizer/utf8_tokenizer.o Parser/tokenizer/helpers.o Parser/myreadline.o Objects/abstract.o Objects/boolobject.o Objects/bytes_methods.o Objects/bytearrayobject.o Objects/bytesobject.o Objects/call.o Objects/capsule.o Objects/cellobject.o Objects/classobject.o Objects/codeobject.o Objects/complexobject.o Objects/descrobject.o Objects/enumobject.o Objects/exceptions.o Objects/genericaliasobject.o Objects/genobject.o Objects/fileobject.o Objects/floatobject.o Objects/frameobject.o Objects/funcobject.o Objects/iterobject.o Objects/listobject.o Objects/longobject.o Objects/dictobject.o Objects/odictobject.o Objects/memoryobject.o Objects/methodobject.o Objects/moduleobject.o Objects/namespaceobject.o Objects/object.o Objects/obmalloc.o Objects/picklebufobject.o Objects/rangeobject.o Objects/setobject.o Objects/sliceobject.o Objects/structseq.o Objects/tupleobject.o Objects/typeobject.o Objects/typevarobject.o Objects/unicodeobject.o Objects/unicodectype.o Objects/unionobject.o Objects/weakrefobject.o Python/asm_trampoline.o Python/_warnings.o Python/Python-ast.o Python/Python-tokenize.o Python/asdl.o Python/assemble.o Python/ast.o Python/ast_opt.o Python/ast_unparse.o Python/bltinmodule.o Python/brc.o Python/ceval.o Python/codecs.o Python/compile.o Python/context.o Python/critical_section.o Python/crossinterp.o Python/dynamic_annotations.o Python/errors.o Python/flowgraph.o Python/frame.o Python/frozenmain.o Python/future.o Python/gc.o Python/gc_free_threading.o Python/gc_gil.o Python/getargs.o Python/getcompiler.o Python/getcopyright.o Python/getplatform.o Python/getversion.o Python/ceval_gil.o Python/hamt.o Python/hashtable.o Python/import.o Python/importdl.o Python/initconfig.o Python/interpconfig.o Python/instrumentation.o Python/instruction_sequence.o Python/intrinsics.o Python/jit.o Python/legacy_tracing.o Python/lock.o Python/marshal.o Python/modsupport.o Python/mysnprintf.o Python/mystrtoul.o Python/object_stack.o Python/optimizer.o Python/optimizer_analysis.o Python/optimizer_symbols.o Python/parking_lot.o Python/pathconfig.o Python/preconfig.o Python/pyarena.o Python/pyctype.o Python/pyfpe.o Python/pyhash.o Python/pylifecycle.o Python/pymath.o Python/pystate.o Python/pythonrun.o Python/pytime.o Python/qsbr.o Python/bootstrap_hash.o Python/specialize.o Python/structmember.o Python/symtable.o Python/sysmodule.o Python/thread.o Python/traceback.o Python/tracemalloc.o Python/getopt.o Python/pystrcmp.o Python/pystrtod.o Python/pystrhex.o Python/dtoa.o Python/formatter_unicode.o Python/fileutils.o Python/suggestions.o Python/perf_trampoline.o Python/perf_jit_trampoline.o Python/dynload_shlib.o     Modules/config.o Modules/main.o Modules/gcmodule.o Modules/atexitmodule.o  Modules/faulthandler.o  Modules/posixmodule.o  Modules/signalmodule.o  Modules/_tracemalloc.o  Modules/_suggestions.o  Modules/_codecsmodule.o  Modules/_collectionsmodule.o  Modules/errnomodule.o  Modules/_io/_iomodule.o Modules/_io/iobase.o Modules/_io/fileio.o Modules/_io/bytesio.o Modules/_io/bufferedio.o Modules/_io/textio.o Modules/_io/stringio.o  Modules/itertoolsmodule.o  Modules/_sre/sre.o  Modules/_sysconfig.o  Modules/_threadmodule.o  Modules/timemodule.o  Modules/_typingmodule.o  Modules/_weakref.o  Modules/_abc.o  Modules/_functoolsmodule.o  Modules/_localemodule.o  Modules/_operator.o  Modules/_stat.o  Modules/symtablemodule.o  Modules/pwdmodule.o \
        Programs/_bootstrap_python.o Modules/getpath.o -ldl                           -lm 
./_bootstrap_python ./Programs/_freeze_module.py abc ./Lib/abc.py Python/frozen_modules/abc.h
./_bootstrap_python ./Programs/_freeze_module.py codecs ./Lib/codecs.py Python/frozen_modules/codecs.h
./_bootstrap_python ./Programs/_freeze_module.py io ./Lib/io.py Python/frozen_modules/io.h
./_bootstrap_python ./Programs/_freeze_module.py _collections_abc ./Lib/_collections_abc.py Python/frozen_modules/_collections_abc.h
 * ACCESS DENIED:  open_wr:            /usr/lib/python3.13/site-packages/_distutils_hack/__pycache__/__init__.cpython-313.pyc.139845133869872
 * ACCESS DENIED:  open_wr:            /usr/lib/python3.13/site-packages/_distutils_hack/__pycache__/__init__.cpython-313.pyc.140010198836016
 * ACCESS DENIED:  open_wr:            /usr/lib/python3.13/site-packages/_distutils_hack/__pycache__/__init__.cpython-313.pyc.140362930070320
 * ACCESS DENIED:  open_wr:            /usr/lib/python3.13/site-packages/_distutils_hack/__pycache__/__init__.cpython-313.pyc.139891056436144
./_bootstrap_python ./Programs/_freeze_module.py _sitebuiltins ./Lib/_sitebuiltins.py Python/frozen_modules/_sitebuiltins.h
./_bootstrap_python ./Programs/_freeze_module.py genericpath ./Lib/genericpath.py Python/frozen_modules/genericpath.h
./_bootstrap_python ./Programs/_freeze_module.py ntpath ./Lib/ntpath.py Python/frozen_modules/ntpath.h
./_bootstrap_python ./Programs/_freeze_module.py posixpath ./Lib/posixpath.py Python/frozen_modules/posixpath.h
 * ACCESS DENIED:  open_wr:            /usr/lib/python3.13/site-packages/_distutils_hack/__pycache__/__init__.cpython-313.pyc.140658654196784
 * ACCESS DENIED:  open_wr:            /usr/lib/python3.13/site-packages/_distutils_hack/__pycache__/__init__.cpython-313.pyc.140500031501360
./_bootstrap_python ./Programs/_freeze_module.py os ./Lib/os.py Python/frozen_modules/os.h
 * ACCESS DENIED:  open_wr:            /usr/lib/python3.13/site-packages/_distutils_hack/__pycache__/__init__.cpython-313.pyc.140103614936112
 * ACCESS DENIED:  open_wr:            /usr/lib/python3.13/site-packages/_distutils_hack/__pycache__/__init__.cpython-313.pyc.140338469647408
./_bootstrap_python ./Programs/_freeze_module.py site ./Lib/site.py Python/frozen_modules/site.h
./_bootstrap_python ./Programs/_freeze_module.py stat ./Lib/stat.py Python/frozen_modules/stat.h
./_bootstrap_python ./Programs/_freeze_module.py importlib.util ./Lib/importlib/util.py Python/frozen_modules/importlib.util.h
 * ACCESS DENIED:  open_wr:            /usr/lib/python3.13/site-packages/_distutils_hack/__pycache__/__init__.cpython-313.pyc.140598746788912
 * ACCESS DENIED:  open_wr:            /usr/lib/python3.13/site-packages/_distutils_hack/__pycache__/__init__.cpython-313.pyc.139803248358448
 * ACCESS DENIED:  open_wr :          * ACCESS DENIED:  open_wr  /usr/lib/python3.13/site-packages/_distutils_hack/__pycache__/__init__.cpython-313.pyc.140577791226928:   
         /usr/lib/python3.13/site-packages/_distutils_hack/__pycache__/__init__.cpython-313.pyc.140146938786864
./_bootstrap_python ./Programs/_freeze_module.py importlib.machinery ./Lib/importlib/machinery.py Python/frozen_modules/importlib.machinery.h
./_bootstrap_python ./Programs/_freeze_module.py runpy ./Lib/runpy.py Python/frozen_modules/runpy.h
./_bootstrap_python ./Programs/_freeze_module.py __hello__ ./Lib/__hello__.py Python/frozen_modules/__hello__.h
./_bootstrap_python ./Programs/_freeze_module.py __phello__ ./Lib/__phello__/__init__.py Python/frozen_modules/__phello__.h
 * ACCESS DENIED:  open_wr:            /usr/lib/python3.13/site-packages/_distutils_hack/__pycache__/__init__.cpython-313.pyc.139758794028080
 * ACCESS DENIED:  open_wr:            /usr/lib/python3.13/site-packages/_distutils_hack/__pycache__/__init__.cpython-313.pyc.139825270289456
 * ACCESS DENIED:  open_wr:            /usr/lib/python3.13/site-packages/_distutils_hack/__pycache__/__init__.cpython-313.pyc.140383496008752
./_bootstrap_python ./Programs/_freeze_module.py __phello__.ham ./Lib/__phello__/ham/__init__.py Python/frozen_modules/__phello__.ham.h
./_bootstrap_python ./Programs/_freeze_module.py __phello__.ham.eggs ./Lib/__phello__/ham/eggs.py Python/frozen_modules/__phello__.ham.eggs.h
./_bootstrap_python ./Programs/_freeze_module.py __phello__.spam ./Lib/__phello__/spam.py Python/frozen_modules/__phello__.spam.h
 * ACCESS DENIED:  open_wr:            /usr/lib/python3.13/site-packages/_distutils_hack/__pycache__/__init__.cpython-313.pyc.140495303275568
./_bootstrap_python ./Programs/_freeze_module.py frozen_only ./Tools/freeze/flag.py Python/frozen_modules/frozen_only.h
 * ACCESS DENIED:  open_wr:            /usr/lib/python3.13/site-packages/_distutils_hack/__pycache__/__init__.cpython-313.pyc.139745235645488
 * ACCESS DENIED:  open_wr:            /usr/lib/python3.13/site-packages/_distutils_hack/__pycache__/__init__.cpython-313.pyc.139848014672944
 * ACCESS DENIED:  open_wr:            /usr/lib/python3.13/site-packages/_distutils_hack/__pycache__/__init__.cpython-313.pyc.140153960641584
 * ACCESS DENIED:  open_wr:            /usr/lib/python3.13/site-packages/_distutils_hack/__pycache__/__init__.cpython-313.pyc.140538201732144
Comment 1 Reuben Farrelly 2024-06-12 00:16:12 UTC
Created attachment 895646 [details]
emerge --info
Comment 2 Reuben Farrelly 2024-06-12 00:17:32 UTC
Created attachment 895647 [details]
Entire build log
Comment 3 Reuben Farrelly 2024-06-12 00:19:05 UTC
Created attachment 895648 [details]
build temp directory logs
Comment 4 Benjamin Réveillé 2024-06-15 18:43:28 UTC
I'm seeing the same thing on 3.13.0_beta2_p1
Comment 5 Sam James archtester Gentoo Infrastructure gentoo-dev Security 2024-06-16 05:41:20 UTC
It's likely https://github.com/python/cpython/commit/6394a72e99b342d980297ec437ecafea92a044c4#diff-efefe383b3a81d16150c280db0b64eed7569254299418f64cc0d749f8e16f3a4 (ABI break for .pyc), it happened for py3.12 too.

What I don't get is why mgorny and I didn't hit it..
Comment 6 Michał Górny archtester Gentoo Infrastructure gentoo-dev Security 2024-06-16 06:17:32 UTC
Easy reproducer:

1. emerge '<dev-lang/python-3.13.0_beta2'
2. add python3_13 to PYTHON_TARGETS
3. emerge setuptools
4. emerge '>=dev-lang/python-3.13.0_beta2'

We're working on it.
Comment 7 Michał Górny archtester Gentoo Infrastructure gentoo-dev Security 2024-06-16 06:47:00 UTC
Oh, and you need USE=-pgo, since pgo implies addwrite.
Comment 8 Reuben Farrelly 2024-06-16 08:34:20 UTC
(In reply to Michał Górny from comment #7)
> Oh, and you need USE=-pgo, since pgo implies addwrite.

Yes - that's true.  I've just changed the use flags in package.use to this:

dev-lang/python sqlite pgo

And the build completes successfully.  So as the OP, I think you're spot on with the last two comments and how to reproduce the problem.

Using +pgo I suppose is a workaround of sorts.  I don't understand what that flag does or why it's even the default though.
Comment 9 Sam James archtester Gentoo Infrastructure gentoo-dev Security 2024-06-16 08:46:48 UTC
pgo is not default, but from metadata.xml:
"""
                <flag name="pgo">
                        Optimize the build using Profile Guided Optimization (PGO)
                        by running Python's test suite and collecting statistics
                        based on its performance. This will take longer to build.
                </flag>
"""
Comment 10 Larry the Git Cow gentoo-dev 2024-06-16 13:13:54 UTC
The bug has been closed via the following commit(s):

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

commit 8d213f1a121fb27620e9675ae30116d34e1093db
Author:     Michał Górny <mgorny@gentoo.org>
AuthorDate: 2024-06-16 12:51:03 +0000
Commit:     Michał Górny <mgorny@gentoo.org>
CommitDate: 2024-06-16 13:13:48 +0000

    dev-lang/python: Bump to 3.13.0_beta2_p5
    
    Adds a patch to pass `-s -S` to just-built Python.  This should avoid
    accessing site-packages during the build, and therefore solve sandbox
    errors.
    
    TODO: extend this to tests, so we wouldn't have to `addwrite` at all.
    
    Also, add a rebuild postinst warning, like we did before for 3.11.
    
    Closes: https://bugs.gentoo.org/934079
    Signed-off-by: Michał Górny <mgorny@gentoo.org>

 dev-lang/python/Manifest                      |   1 +
 dev-lang/python/python-3.13.0_beta2_p5.ebuild | 684 ++++++++++++++++++++++++++
 2 files changed, 685 insertions(+)
Comment 11 Sam James archtester Gentoo Infrastructure gentoo-dev Security 2024-07-21 02:44:47 UTC
*** Bug 932790 has been marked as a duplicate of this bug. ***