Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 729950 - dev-lang/crystal-0.35.1 - libsandbox/trace.c:_do_ptrace():83: failure (Operation not permitted): * ISE:_do_ptrace: ptrace(PTRACE_TRACEME, ..., 0x0000000000000000, 0x0000000000000000): Operation not permitted
Summary: dev-lang/crystal-0.35.1 - libsandbox/trace.c:_do_ptrace():83: failure (Operat...
Status: RESOLVED DUPLICATE of bug 693582
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: Current packages (show other bugs)
Hardware: All Linux
: Normal normal (vote)
Assignee: Sergei Trofimovich (RETIRED)
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2020-06-27 21:51 UTC by Renich Bon Ciric
Modified: 2020-07-02 15:36 UTC (History)
0 users

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


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Renich Bon Ciric 2020-06-27 21:51:52 UTC
I just tried this in a podman container for funtoo:

# podman run -it --name=mi-gentoo-pro docker://gentoo/stage3-amd64-hardened-nomultilib

a2c7b6122917 ~ # emerge -j dev-lang/crystal
Calculating dependencies... done!
>>> Verifying ebuild manifests
>>> Emerging (1 of 1) dev-lang/crystal-0.35.1::gentoo
>>> Failed to emerge dev-lang/crystal-0.35.1, Log file:
>>>  '/var/tmp/portage/dev-lang/crystal-0.35.1/temp/build.log'
>>> Jobs: 0 of 1 complete, 1 failed                 Load avg: 2.03, 8.10, 9.80
 * Package:    dev-lang/crystal-0.35.1
 * Repository: gentoo
 * Maintainer: slyfox@gentoo.org
 * USE:        abi_x86_64 amd64 elibc_glibc kernel_linux userland_GNU xml yaml
 * FEATURES:   network-sandbox preserve-libs sandbox userpriv usersandbox
Unable to unshare: EPERM (for FEATURES="pid-sandbox")
Unable to unshare: EPERM (for FEATURES="ipc-sandbox network-sandbox pid-sandbox")
>>> Unpacking source...
>>> Unpacking crystal-0.35.1.tar.gz to /var/tmp/portage/dev-lang/crystal-0.35.1/work
>>> Unpacking crystal-0.35.1-1-linux-x86_64.tar.gz to /var/tmp/portage/dev-lang/crystal-0.35.1/work
>>> Source unpacked in /var/tmp/portage/dev-lang/crystal-0.35.1/work
Unable to unshare: EPERM (for FEATURES="ipc-sandbox network-sandbox pid-sandbox")
>>> Preparing source in /var/tmp/portage/dev-lang/crystal-0.35.1/work/crystal-0.35.1 ...
 * Applying crystal-0.31.0-verbose.patch ...
patching file Makefile
Hunk #1 succeeded at 29 with fuzz 1.
 [ ok ]
 * Applying crystal-0.26.1-gentoo-tests-sandbox.patch ...
patching file spec/std/file_spec.cr
Hunk #1 succeeded at 1219 with fuzz 1 (offset 55 lines).
patching file spec/std/process_spec.cr
Hunk #1 succeeded at 219 with fuzz 1 (offset 84 lines).
Hunk #2 succeeded at 234 with fuzz 1 (offset 91 lines).
 [ ok ]
 * Applying crystal-0.27.0-extra-spec-flags.patch ...
 [ ok ]
 * Applying crystal-0.27.0-gentoo-tests-long-unix.patch ...
patching file spec/std/socket/unix_server_spec.cr
Hunk #1 succeeded at 16 (offset 2 lines).
Hunk #2 succeeded at 28 (offset 2 lines).
Hunk #3 succeeded at 39 (offset 2 lines).
Hunk #4 succeeded at 55 (offset 4 lines).
Hunk #5 succeeded at 72 (offset 4 lines).
Hunk #6 succeeded at 86 with fuzz 1 (offset 4 lines).
Hunk #7 succeeded at 121 (offset 12 lines).
Hunk #8 succeeded at 135 with fuzz 1 (offset 12 lines).
 [ ok ]
 * Applying crystal-0.27.0-gentoo-tests-long-unix-2.patch ...
 [ ok ]
>>> Source prepared.
Unable to unshare: EPERM (for FEATURES="ipc-sandbox network-sandbox pid-sandbox")
>>> Configuring source in /var/tmp/portage/dev-lang/crystal-0.35.1/work/crystal-0.35.1 ...
>>> Source configured.
Unable to unshare: EPERM (for FEATURES="ipc-sandbox network-sandbox pid-sandbox")
>>> Compiling source in /var/tmp/portage/dev-lang/crystal-0.35.1/work/crystal-0.35.1 ...
make -j16 release=1 progress=true stats=1 threads=16 verbose=1 CC=x86_64-pc-linux-gnu-gcc CXX=x86_64-pc-linux-gnu-g++ AR=x86_64-pc-linux-gnu-ar PATH=/var/tmp/portage/dev-lang/crystal-0.35.1/work/crystal-0.35.1-1/bin:/usr/lib/portage/python3.7/ebuild-helpers/xattr:/usr/lib/portage/python3.7/ebuild-helpers:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/opt/bin:/usr/lib/llvm/10/bin CRYSTAL_PATH=src CRYSTAL_CONFIG_VERSION=0.35.1 CRYSTAL_CONFIG_PATH=lib:/usr/lib64/crystal 
Using /usr/lib/llvm/10/bin/llvm-config [version=10.0.0]
x86_64-pc-linux-gnu-g++ -c -march=native -O2 -pipe  -o src/llvm/ext/llvm_ext.o src/llvm/ext/llvm_ext.cc -I/usr/lib/llvm/10/include -std=c++14    -D_GNU_SOURCE -D__STDC_CONSTANT_MACROS -D__STDC_FORMAT_MACROS -D__STDC_LIMIT_MACROS
x86_64-pc-linux-gnu-gcc -march=native -O2 -pipe -fPIC    -c -o src/ext/sigfault.o src/ext/sigfault.c
x86_64-pc-linux-gnu-ar -rcs src/ext/libcrystal.a src/ext/sigfault.o
CRYSTAL_CONFIG_LIBRARY_PATH="" CRYSTAL_CONFIG_BUILD_COMMIT="" SOURCE_DATE_EPOCH="1593294442" ./bin/crystal build --release --stats --progress --threads 16 --link-flags="-Wl,-O1 -Wl,--as-needed" --verbose  -o .build/crystal src/compiler/crystal.cr -D without_openssl -D without_zlib
 * /var/tmp/portage/sys-apps/sandbox-2.18/work/sandbox-2.18/libsandbox/trace.c:_do_ptrace():83: failure (Operation not permitted):
 * ISE:_do_ptrace: ptrace(PTRACE_TRACEME, ..., 0x0000000000000000, 0x0000000000000000): Operation not permitted
/usr/lib64/libsandbox.so(+0xc285)[0x7fc0b5cf8285]
/usr/lib64/libsandbox.so(+0xc396)[0x7fc0b5cf8396]
/usr/lib64/libsandbox.so(+0x5f79)[0x7fc0b5cf1f79]
/usr/lib64/libsandbox.so(+0x6595)[0x7fc0b5cf2595]
/usr/lib64/libsandbox.so(+0x764e)[0x7fc0b5cf364e]
/usr/lib64/libsandbox.so(execve+0x4f)[0x7fc0b5cf5ccf]
/bin/sh(+0x24de2)[0x55a8bce03de2]
/bin/sh(+0x25706)[0x55a8bce04706]
/bin/sh(+0x2871d)[0x55a8bce0771d]
/bin/sh(+0x75399)[0x55a8bce54399]
/proc/357/cmdline: /bin/sh /var/tmp/portage/dev-lang/crystal-0.35.1/work/crystal-0.35.1-1/bin/crystal env CRYSTAL_LIBRARY_PATH 

 * /var/tmp/portage/sys-apps/sandbox-2.18/work/sandbox-2.18/libsandbox/trace.c:_do_ptrace():83: failure (Operation not permitted):
 * ISE:_do_ptrace: ptrace(PTRACE_TRACEME, ..., 0x0000000000000000, 0x0000000000000000): Operation not permitted
/usr/lib64/libsandbox.so(+0xc285)[0x7fc0b5cf8285]
/usr/lib64/libsandbox.so(+0xc396)[0x7fc0b5cf8396]
/usr/lib64/libsandbox.so(+0x5f79)[0x7fc0b5cf1f79]
/usr/lib64/libsandbox.so(+0x6595)[0x7fc0b5cf2595]
/usr/lib64/libsandbox.so(+0x764e)[0x7fc0b5cf364e]
/usr/lib64/libsandbox.so(execve+0x4f)[0x7fc0b5cf5ccf]
/bin/sh(+0x24de2)[0x55a8bce03de2]
/bin/sh(+0x75b2f)[0x55a8bce54b2f]
/bin/sh(+0x24305)[0x55a8bce03305]
/bin/sh(+0x28890)[0x55a8bce07890]
/proc/358/cmdline: /bin/sh /var/tmp/portage/dev-lang/crystal-0.35.1/work/crystal-0.35.1-1/bin/crystal env CRYSTAL_LIBRARY_PATH 

 * /var/tmp/portage/sys-apps/sandbox-2.18/work/sandbox-2.18/libsandbox/trace.c:_do_ptrace():83: failure (Operation not permitted):
 * ISE:_do_ptrace: ptrace(PTRACE_TRACEME, ..., 0x0000000000000000, 0x0000000000000000): Operation not permitted
/usr/lib64/libsandbox.so(+0xc285)[0x7fcb83e74285]
/usr/lib64/libsandbox.so(+0xc396)[0x7fcb83e74396]
/usr/lib64/libsandbox.so(+0x5f79)[0x7fcb83e6df79]
/usr/lib64/libsandbox.so(+0x6595)[0x7fcb83e6e595]
/usr/lib64/libsandbox.so(+0x764e)[0x7fcb83e6f64e]
/usr/lib64/libsandbox.so(execve+0x4f)[0x7fcb83e71ccf]
/bin/sh(+0x24de2)[0x561f39c22de2]
/bin/sh(+0x25706)[0x561f39c23706]
/bin/sh(+0x2871d)[0x561f39c2671d]
/bin/sh(+0x75399)[0x561f39c73399]
/proc/370/cmdline: /bin/sh /var/tmp/portage/dev-lang/crystal-0.35.1/work/crystal-0.35.1-1/bin/crystal build --release --stats --progress --threads 16 --link-flags=-Wl,-O1 -Wl,--as-needed --verbose -o .build/crystal src/compiler/crystal.cr -D without_openssl -D without_zlib 

 * /var/tmp/portage/sys-apps/sandbox-2.18/work/sandbox-2.18/libsandbox/trace.c:_do_ptrace():83: failure (Operation not permitted):
 * ISE:_do_ptrace: ptrace(PTRACE_TRACEME, ..., 0x0000000000000000, 0x0000000000000000): Operation not permitted
/usr/lib64/libsandbox.so(+0xc285)[0x7fcb83e74285]
/usr/lib64/libsandbox.so(+0xc396)[0x7fcb83e74396]
/usr/lib64/libsandbox.so(+0x5f79)[0x7fcb83e6df79]
/usr/lib64/libsandbox.so(+0x6595)[0x7fcb83e6e595]
/usr/lib64/libsandbox.so(+0x764e)[0x7fcb83e6f64e]
/usr/lib64/libsandbox.so(execve+0x4f)[0x7fcb83e71ccf]
/bin/sh(+0x24de2)[0x561f39c22de2]
/bin/sh(+0x75b2f)[0x561f39c73b2f]
/bin/sh(+0x24305)[0x561f39c22305]
/bin/sh(+0x28890)[0x561f39c26890]
/proc/371/cmdline: /bin/sh /var/tmp/portage/dev-lang/crystal-0.35.1/work/crystal-0.35.1-1/bin/crystal build --release --stats --progress --threads 16 --link-flags=-Wl,-O1 -Wl,--as-needed --verbose -o .build/crystal src/compiler/crystal.cr -D without_openssl -D without_zlib 

make: *** [Makefile:121: .build/crystal] Error 134
 * ERROR: dev-lang/crystal-0.35.1::gentoo failed (compile phase):
 *   emake failed
 * 
 * If you need support, post the output of `emerge --info '=dev-lang/crystal-0.35.1::gentoo'`,
 * the complete build log and the output of `emerge -pqv '=dev-lang/crystal-0.35.1::gentoo'`.
 * The complete build log is located at '/var/tmp/portage/dev-lang/crystal-0.35.1/temp/build.log'.
 * The ebuild environment file is located at '/var/tmp/portage/dev-lang/crystal-0.35.1/temp/environment'.
 * Working directory: '/var/tmp/portage/dev-lang/crystal-0.35.1/work/crystal-0.35.1'
 * S: '/var/tmp/portage/dev-lang/crystal-0.35.1/work/crystal-0.35.1'

 * Messages for package dev-lang/crystal-0.35.1:

 * ERROR: dev-lang/crystal-0.35.1::gentoo failed (compile phase):
 *   emake failed
 * 
 * If you need support, post the output of `emerge --info '=dev-lang/crystal-0.35.1::gentoo'`,
 * the complete build log and the output of `emerge -pqv '=dev-lang/crystal-0.35.1::gentoo'`.
 * The complete build log is located at '/var/tmp/portage/dev-lang/crystal-0.35.1/temp/build.log'.
 * The ebuild environment file is located at '/var/tmp/portage/dev-lang/crystal-0.35.1/temp/environment'.
 * Working directory: '/var/tmp/portage/dev-lang/crystal-0.35.1/work/crystal-0.35.1'
 * S: '/var/tmp/portage/dev-lang/crystal-0.35.1/work/crystal-0.35.1'
Comment 1 Renich Bon Ciric 2020-06-27 21:52:38 UTC
a2c7b6122917 ~ # emerge --info
Portage 2.3.99 (python 3.7.7-final-0, default/linux/amd64/17.1/no-multilib/hardened, gcc-9.3.0, glibc-2.30-r8, 5.6.19-300.fc32.x86_64 x86_64)
=================================================================
System uname: Linux-5.6.19-300.fc32.x86_64-x86_64-AMD_Ryzen_7_1800X_Eight-Core_Processor-with-gentoo-2.6
KiB Mem:    65849128 total,  50746380 free
KiB Swap:   33044476 total,  33044476 free
Timestamp of repository gentoo: Sat, 27 Jun 2020 20:30:01 +0000
Head commit of repository gentoo: e98b9305296a9f98342559a50e29834ad12b1c0b
sh bash 5.0_p17
ld GNU ld (Gentoo 2.33.1 p2) 2.33.1
app-shells/bash:          5.0_p17::gentoo
dev-lang/perl:            5.30.3::gentoo
dev-lang/python:          2.7.18::gentoo, 3.7.7-r2::gentoo, 3.8.2-r2::gentoo
dev-util/cmake:           3.17.3::gentoo
sys-apps/baselayout:      2.6-r1::gentoo
sys-apps/openrc:          0.42.1::gentoo
sys-apps/sandbox:         2.18::gentoo
sys-devel/autoconf:       2.69-r4::gentoo
sys-devel/automake:       1.16.1-r1::gentoo
sys-devel/binutils:       2.33.1-r1::gentoo
sys-devel/gcc:            9.3.0::gentoo
sys-devel/gcc-config:     2.2.1::gentoo
sys-devel/libtool:        2.4.6-r6::gentoo
sys-devel/make:           4.2.1-r4::gentoo
sys-kernel/linux-headers: 5.4-r1::gentoo (virtual/os-headers)
sys-libs/glibc:           2.30-r8::gentoo
Repositories:

gentoo
    location: /var/db/repos/gentoo
    sync-type: rsync
    sync-uri: rsync://rsync.gentoo.org/gentoo-portage
    priority: -1000
    sync-rsync-verify-metamanifest: yes
    sync-rsync-verify-max-age: 24
    sync-rsync-extra-opts: 
    sync-rsync-verify-jobs: 1

ACCEPT_KEYWORDS="amd64 ~amd64"
ACCEPT_LICENSE="@FREE"
CBUILD="x86_64-pc-linux-gnu"
CFLAGS="-march=native -O2 -pipe"
CHOST="x86_64-pc-linux-gnu"
CONFIG_PROTECT="/etc /usr/share/gnupg/qualified.txt"
CONFIG_PROTECT_MASK="/etc/ca-certificates.conf /etc/env.d /etc/gconf /etc/gentoo-release /etc/sandbox.d /etc/terminfo"
CXXFLAGS="-march=native -O2 -pipe"
DISTDIR="/var/cache/distfiles"
ENV_UNSET="DBUS_SESSION_BUS_ADDRESS DISPLAY GOBIN GOPATH PERL5LIB PERL5OPT PERLPREFIX PERL_CORE PERL_MB_OPT PERL_MM_OPT XAUTHORITY XDG_CACHE_HOME XDG_CONFIG_HOME XDG_DATA_HOME XDG_RUNTIME_DIR"
FCFLAGS="-march=native -O2 -pipe"
FEATURES="assume-digests binpkg-docompress binpkg-dostrip binpkg-logs config-protect-if-modified distlocks ebuild-locks fixlafiles ipc-sandbox merge-sync multilib-strict network-sandbox news parallel-fetch pid-sandbox preserve-libs protect-owned qa-unresolved-soname-deps sandbox sfperms strict unknown-features-warn unmerge-logs unmerge-orphans userfetch userpriv usersandbox usersync xattr"
FFLAGS="-march=native -O2 -pipe"
GENTOO_MIRRORS="http://distfiles.gentoo.org"
LANG="C.UTF8"
LDFLAGS="-Wl,-O1 -Wl,--as-needed"
PKGDIR="/var/cache/binpkgs"
PORTAGE_CONFIGROOT="/"
PORTAGE_RSYNC_OPTS="--recursive --links --safe-links --perms --times --omit-dir-times --compress --force --whole-file --delete --stats --human-readable --timeout=180 --exclude=/distfiles --exclude=/local --exclude=/packages --exclude=/.git"
PORTAGE_TMPDIR="/var/tmp"
USE="acl amd64 bzip2 crypt hardened iconv ipv6 libtirpc ncurses nls nptl openmp pam pcre pie readline seccomp split-usr ssl ssp unicode xattr xtpax zlib" ABI_X86="64" ADA_TARGET="gnat_2018" ALSA_CARDS="ali5451 als4000 atiixp atiixp-modem bt87x ca0106 cmipci emu10k1x ens1370 ens1371 es1938 es1968 fm801 hda-intel intel8x0 intel8x0m maestro3 trident usb-audio via82xx via82xx-modem ymfpci" APACHE2_MODULES="authn_core authz_core socache_shmcb unixd actions alias auth_basic authn_alias authn_anon authn_dbm authn_default authn_file authz_dbm authz_default authz_groupfile authz_host authz_owner authz_user autoindex cache cgi cgid dav dav_fs dav_lock deflate dir disk_cache env expires ext_filter file_cache filter headers include info log_config logio mem_cache mime mime_magic negotiation rewrite setenvif speling status unique_id userdir usertrack vhost_alias" CALLIGRA_FEATURES="karbon sheets words" COLLECTD_PLUGINS="df interface irq load memory rrdtool swap syslog" CPU_FLAGS_X86="mmx mmxext sse sse2" ELIBC="glibc" GPSD_PROTOCOLS="ashtech aivdm earthmate evermore fv18 garmin garmintxt gpsclock greis isync itrax mtk3301 nmea ntrip navcom oceanserver oldstyle oncore rtcm104v2 rtcm104v3 sirf skytraq superstar2 timing tsip tripmate tnt ublox ubx" INPUT_DEVICES="libinput" KERNEL="linux" LCD_DEVICES="bayrad cfontz cfontz633 glk hd44780 lb216 lcdm001 mtxorb ncurses text" LIBREOFFICE_EXTENSIONS="presenter-console presenter-minimizer" OFFICE_IMPLEMENTATION="libreoffice" PHP_TARGETS="php7-2" POSTGRES_TARGETS="postgres10 postgres11" PYTHON_SINGLE_TARGET="python3_7" PYTHON_TARGETS="python2_7 python3_7" RUBY_TARGETS="ruby25" USERLAND="GNU" VIDEO_CARDS="amdgpu fbdev intel nouveau radeon radeonsi vesa dummy v4l" XTABLES_ADDONS="quota2 psd pknock lscan length2 ipv4options ipset ipp2p iface geoip fuzzy condition tee tarpit sysrq steal rawnat logmark ipmark dhcpmac delude chaos account"
Unset:  CC, CPPFLAGS, CTARGET, CXX, EMERGE_DEFAULT_OPTS, INSTALL_MASK, LC_ALL, LINGUAS, MAKEOPTS, PORTAGE_BINHOST, PORTAGE_BUNZIP2_COMMAND, PORTAGE_COMPRESS, PORTAGE_COMPRESS_FLAGS, PORTAGE_RSYNC_EXTRA_OPTS
Comment 2 Sergei Trofimovich (RETIRED) gentoo-dev 2020-07-02 06:37:41 UTC
The bug is not specific to crystal. I guess you are running inprivileged user container.

ptrace() is not allowed in podman containers. Do you know why? Is it filtered away with seccomp? Or something already runs under prtrace there?

I suggest disabling sandbox for select packages.

*** This bug has been marked as a duplicate of bug 693582 ***
Comment 3 Renich Bon Ciric 2020-07-02 15:36:27 UTC
(In reply to Sergei Trofimovich from comment #2)
> The bug is not specific to crystal. I guess you are running inprivileged
> user container.
> 
> ptrace() is not allowed in podman containers. Do you know why? Is it
> filtered away with seccomp? Or something already runs under prtrace there?

I'll check. Yeah, they're unprivileged. 

> I suggest disabling sandbox for select packages.

OK, will try that. Thanks!