Gentoo Forums
Gentoo Forums
Gentoo Forums
Quick Search: in
Hardened Gentoo + Python Fails to Update
View unanswered posts
View posts from last 24 hours

 
Reply to topic    Gentoo Forums Forum Index Installing Gentoo
View previous topic :: View next topic  
Author Message
eleanor
l33t
l33t


Joined: 01 Nov 2004
Posts: 666

PostPosted: Thu Jan 02, 2014 10:19 pm    Post subject: Hardened Gentoo + Python Fails to Update Reply with quote

Hi, when running emerge python command, I'm getting the error presented below.

Quote:


Skipping: EDRIVE_CANT_DO_THIS = EOPNOTSUPP
Skipping: CDSL_NONE = (INT_MAX-1)
Skipping: CDSL_CURRENT = INT_MAX
/usr/lib64/portage/bin/ebuild-helpers/xattr/install -c -m 644 /var/tmp/portage/dev-lang/python-3.3.2-r2/work/Python-3.3.2/Tools/gdb/libpython.py python-gdb.py
x86_64-pc-linux-gnu-gcc -pthread -c -Wno-unused-result -DNDEBUG -march=native -ggdb -fwrapv -I. -IInclude -I/var/tmp/portage/dev-lang/python-3.3.2-r2/work/Python-3.3.2/Include -fPIC -DPy_BUILD_CORE -o Modules/_testembed.o /var/tmp/portage/dev-lang/python-3.3.2-r2/work/Python-3.3.2/Modules/_testembed.c
x86_64-pc-linux-gnu-gcc -pthread -Wl,-O1 -Wl,--as-needed -L. -Xlinker -export-dynamic -o Modules/_testembed Modules/_testembed.o -L. -lpython3.3 -lpthread -ldl -lutil -lm
* XT PaX marking -m with paxctl-ng
* python
>>> Source compiled.
>>> Test phase [not enabled]: dev-lang/python-3.3.2-r2

>>> Install python-3.3.2-r2 into /var/tmp/portage/dev-lang/python-3.3.2-r2/image/ category dev-lang
make DESTDIR=/var/tmp/portage/dev-lang/python-3.3.2-r2/image/ altinstall
Creating directory /usr/bin
Creating directory /usr/lib64
/usr/lib64/portage/bin/ebuild-helpers/xattr/install -c python /var/tmp/portage/dev-lang/python-3.3.2-r2/image//usr/bin/python3.3
if test "3.3" != "3.3"; then \
if test -f /var/tmp/portage/dev-lang/python-3.3.2-r2/image//usr/bin/python3.3 -o -h /var/tmp/portage/dev-lang/python-3.3.2-r2/image//usr/bin/python3.3; \
then rm -f /var/tmp/portage/dev-lang/python-3.3.2-r2/image//usr/bin/python3.3; \
fi; \
(cd /var/tmp/portage/dev-lang/python-3.3.2-r2/image//usr/bin; ln python3.3 python3.3); \
fi
if test -f libpython3.3.so; then \
if test -n "" ; then \
/usr/lib64/portage/bin/ebuild-helpers/xattr/install -c -m 555 /var/tmp/portage/dev-lang/python-3.3.2-r2/image//usr/bin; \
else \
/usr/lib64/portage/bin/ebuild-helpers/xattr/install -c -m 555 libpython3.3.so /var/tmp/portage/dev-lang/python-3.3.2-r2/image//usr/lib64/libpython3.3.so.1.0; \
if test libpython3.3.so != libpython3.3.so.1.0; then \
(cd /var/tmp/portage/dev-lang/python-3.3.2-r2/image//usr/lib64; ln -sf libpython3.3.so.1.0 libpython3.3.so) \
fi \
fi; \
if test -n "libpython3.so"; then \
/usr/lib64/portage/bin/ebuild-helpers/xattr/install -c -m 555 libpython3.so /var/tmp/portage/dev-lang/python-3.3.2-r2/image//usr/lib64/libpython3.so; \
fi; \
else true; \
fi
/bin/sh: line 5: 26293 Killed LD_LIBRARY_PATH=/var/tmp/portage/dev-lang/python-3.3.2-r2/work/x86_64-pc-linux-gnu: CC='x86_64-pc-linux-gnu-gcc -pthread' LDSHARED='x86_64-pc-linux-gnu-gcc -pthread -shared -Wl,-O1 -Wl,--as-needed -L. -Wl,-O1 -Wl,--as-needed -L.' CFLAGS='-Wno-unused-result -DNDEBUG -march=native -ggdb -fwrapv -march=native -ggdb -fwrapv ' ./python -E /var/tmp/portage/dev-lang/python-3.3.2-r2/work/Python-3.3.2/setup.py $quiet build
make: *** [sharedmods] Error 137
emake failed
* ERROR: dev-lang/python-3.3.2-r2::gentoo failed (install phase):
* emake altinstall failed
*
* Call stack:
* ebuild.sh, line 93: Called src_install
* environment, line 4063: Called die
* The specific snippet of code:
* emake DESTDIR="${D}" altinstall || die "emake altinstall failed";
*
* If you need support, post the output of `emerge --info '=dev-lang/python-3.3.2-r2::gentoo'`,
* the complete build log and the output of `emerge -pqv '=dev-lang/python-3.3.2-r2::gentoo'`.
* The complete build log is located at '/var/tmp/portage/dev-lang/python-3.3.2-r2/temp/build.log'.
* The ebuild environment file is located at '/var/tmp/portage/dev-lang/python-3.3.2-r2/temp/environment'.
* Working directory: '/var/tmp/portage/dev-lang/python-3.3.2-r2/work/x86_64-pc-linux-gnu'
* S: '/var/tmp/portage/dev-lang/python-3.3.2-r2/work/Python-3.3.2'

>>> Failed to emerge dev-lang/python-3.3.2-r2, Log file:

>>> '/var/tmp/portage/dev-lang/python-3.3.2-r2/temp/build.log'

* Messages for package dev-lang/python-3.3.2-r2:

* ERROR: dev-lang/python-3.3.2-r2::gentoo failed (install phase):
* emake altinstall failed
*
* Call stack:
* ebuild.sh, line 93: Called src_install
* environment, line 4063: Called die
* The specific snippet of code:
* emake DESTDIR="${D}" altinstall || die "emake altinstall failed";
*
* If you need support, post the output of `emerge --info '=dev-lang/python-3.3.2-r2::gentoo'`,
* the complete build log and the output of `emerge -pqv '=dev-lang/python-3.3.2-r2::gentoo'`.
* The complete build log is located at '/var/tmp/portage/dev-lang/python-3.3.2-r2/temp/build.log'.
* The ebuild environment file is located at '/var/tmp/portage/dev-lang/python-3.3.2-r2/temp/environment'.
* Working directory: '/var/tmp/portage/dev-lang/python-3.3.2-r2/work/x86_64-pc-linux-gnu'
* S: '/var/tmp/portage/dev-lang/python-3.3.2-r2/work/Python-3.3.2'



The error most probably occurs due to incorrect PaX settings, but I'm not sure how to convince the build system to actually compile the program. I've found a couple of threads with the same problem, but they didn't come to a solution: one user rebooted the system into non-hardened kernel with PaX disabled and recompiled the packages there.

I would like to come to the root of the problem and fix this.

Any ideas are appreciated.
Back to top
View user's profile Send private message
nix213
n00b
n00b


Joined: 08 Feb 2013
Posts: 23
Location: Illinois

PostPosted: Fri Jan 03, 2014 1:43 am    Post subject: Reply with quote

for whatever it's worth, the program compiled just fine, it's just failing on the install for whatever reason. I'd tail your dmesg output right after it fails, see what that info can tell you.
just out of curiosity, are you running a 3.12 kernel? 3.12.6 gave me some real shit when I first ran it, and it turned out to be something with python and newer mprotect behaviors. I had to turn PAX_CONFIG_MPROTECT_COMPAT on in the kernel in order to get python at least functional. Firefox has been giving me similar problems too (failing on the install because of xpcom and an mprotect setting). mprotect is nothing to scoff at either, it basically makes sure memory mappings can't be both writable and executable (for obvious reasons)
_________________
"Wherever you go, go with all your heart." -Confucius
Back to top
View user's profile Send private message
eleanor
l33t
l33t


Joined: 01 Nov 2004
Posts: 666

PostPosted: Fri Jan 03, 2014 8:10 am    Post subject: Reply with quote

Hi,

I'm running 3.10.1 kernel. I've enabled CONFIG_PAX_MPROTECT_COMPAT=y in the kernel, but Python still won't install. The same problem arises.
Back to top
View user's profile Send private message
NTU
Apprentice
Apprentice


Joined: 17 Jul 2015
Posts: 187

PostPosted: Sat May 28, 2016 2:34 am    Post subject: Reply with quote

I'm not sure if reviving old threads is against the rules here so if it is, I apologize, but I'm running into the same problem. I bumped up my ulimit settings to get rid of the resource overstep problem that was showing up in dmesg but RWX mmap is still being thrown and python fails to install on Grsec kernel w/ PAX. Same exact spot as OP. Thanks!

edit: the only fix I found was making a new kernel, disabling CONFIG_PAX_MPROTECT and rebuilding python{2,3} then switching kernels again.

NTU
Back to top
View user's profile Send private message
Display posts from previous:   
Reply to topic    Gentoo Forums Forum Index Installing Gentoo All times are GMT
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum