Summary: | sys-apps/sandbox: Cannot mkdir: Value too large for defined data type, various core dumps | ||
---|---|---|---|
Product: | Gentoo Linux | Reporter: | Mario Klebsch <mario> |
Component: | Current packages | Assignee: | Sandbox Maintainers <sandbox> |
Status: | RESOLVED DUPLICATE | ||
Severity: | normal | CC: | ionen, sam |
Priority: | Normal | ||
Version: | unspecified | ||
Hardware: | x86 | ||
OS: | Linux | ||
Whiteboard: | |||
Package list: | Runtime testing required: | --- |
Description
Mario Klebsch
2021-04-20 16:52:44 UTC
# emerge --info Portage 3.0.17 (python 3.8.8-final-0, default/linux/x86/17.0, gcc-10.2.0, glibc-2.32-r7, 4.4.39-gentoo i686) ================================================================= System uname: Linux-4.4.39-gentoo-i686-Intel-R-_Celeron-R-_CPU_G1610T_@_2.30GHz-with-glibc2.1.3 KiB Mem: 16596672 total, 8933268 free KiB Swap: 0 total, 0 free Timestamp of repository gentoo: Tue, 20 Apr 2021 02:00:01 +0000 Head commit of repository gentoo: 5b6cc80b2ba5a2ee76cd203379dedb0a1dbe6aae sh bash 5.0_p18 ld GNU ld (Gentoo 2.35.2 p1) 2.35.2 app-shells/bash: 5.0_p18::gentoo dev-lang/perl: 5.30.3::gentoo dev-lang/python: 2.7.18_p8::gentoo, 3.8.8_p1::gentoo, 3.9.2_p1::gentoo dev-util/cmake: 3.18.5::gentoo dev-util/pkgconfig: 0.29.2::gentoo sys-apps/baselayout: 2.7::gentoo sys-apps/openrc: 0.42.1-r1::gentoo sys-apps/sandbox: 2.20::gentoo sys-devel/autoconf: 2.13-r1::gentoo, 2.69-r5::gentoo sys-devel/automake: 1.15.1-r2::gentoo, 1.16.2-r1::gentoo sys-devel/binutils: 2.35.2::gentoo sys-devel/gcc: 10.2.0-r5::gentoo sys-devel/gcc-config: 2.4::gentoo sys-devel/libtool: 2.4.6-r6::gentoo sys-devel/make: 4.3::gentoo sys-kernel/linux-headers: 5.10::gentoo (virtual/os-headers) sys-libs/glibc: 2.32-r7::gentoo Repositories: gentoo location: /usr/portage sync-type: rsync sync-uri: rsync://rsync.gentoo.org/gentoo-portage priority: -1000 sync-rsync-verify-jobs: 1 sync-rsync-verify-max-age: 24 sync-rsync-extra-opts: --quiet sync-rsync-verify-metamanifest: yes x-portage location: /usr/local/portage masters: gentoo priority: 0 ACCEPT_KEYWORDS="x86" ACCEPT_LICENSE="* -@EULA" CBUILD="i686-pc-linux-gnu" CFLAGS="-O2 -march=i686 -pipe" CHOST="i686-pc-linux-gnu" CONFIG_PROTECT="/etc /usr/share/gnupg/qualified.txt /var/bind" CONFIG_PROTECT_MASK="/etc/ca-certificates.conf /etc/env.d /etc/fonts/fonts.conf /etc/gconf /etc/gentoo-release /etc/php/apache2-php7.4/ext-active/ /etc/php/cgi-php7.4/ext-active/ /etc/php/cli-php7.4/ext-active/ /etc/revdep-rebuild /etc/sandbox.d /etc/terminfo" CXXFLAGS="-O2 -march=i686 -pipe" DISTDIR="/usr/portage/distfiles" ENV_UNSET="CARGO_HOME 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="-O2 -march=i686 -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="-O2 -march=i686 -pipe" GENTOO_MIRRORS="http://distfiles.gentoo.org" LANG="en_US.UTF-8" LDFLAGS="-Wl,-O1 -Wl,--as-needed" LINGUAS="de en" MAKEOPTS="-j2" PKGDIR="/var/cache/binpkgs" PORTAGE_CONFIGROOT="/" PORTAGE_RSYNC_EXTRA_OPTS="-6" 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="accessibility acl berkdb bzip2 cli crypt dri fortran gdbm gif iconv imap ipv6 libglvnd libtirpc mbox ncurses nls nptl openmp pam pcre php phpdbg readline sasl seccomp split-usr ssl tcpd tty-helpers unicode x86 xattr zlib" ABI_X86="32" ADA_TARGET="gnat_2018" ALSA_CARDS="ali5451 als4000 atiixp atiixp-modem bt87x ca0106 cmipci emu10k1 emu10k1x ens1370 ens1371 es1938 es1968 fm801 hda-intel intel8x0 intel8x0m maestro3 trident usb-audio via82xx via82xx-modem ymfpci" APACHE2_MODULES="authn_core authn_file auth_basic authz_core authz_host authz_user deflate dir filter headers log_config mime rewrite php proxy proxy_http mod_headers alias socache_shmcb" CALLIGRA_FEATURES="karbon sheets words" COLLECTD_PLUGINS="df interface irq load memory rrdtool swap syslog" CPU_FLAGS_X86="mmx mmxext sse sse2 sse3" 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" L10N="de en" LCD_DEVICES="bayrad cfontz cfontz633 glk hd44780 lb216 lcdm001 mtxorb ncurses text" LIBREOFFICE_EXTENSIONS="presenter-console presenter-minimizer" LLVM_TARGETS="BPF X86" LUA_SINGLE_TARGET="lua5-1" LUA_TARGETS="lua5-1" OFFICE_IMPLEMENTATION="libreoffice" PHP_TARGETS="php7-4" POSTGRES_TARGETS="postgres10 postgres11" PYTHON_SINGLE_TARGET="python3_8" PYTHON_TARGETS="python3_8" RUBY_TARGETS="ruby26" USERLAND="GNU" VIDEO_CARDS="vesa" XTABLES_ADDONS="quota2 psd pknock lscan length2 ipv4options ipset ipp2p iface geoip fuzzy condition tee tarpit sysrq proto steal rawnat logmark ipmark dhcpmac delude chaos account" Unset: CC, CPPFLAGS, CTARGET, CXX, EMERGE_DEFAULT_OPTS, INSTALL_MASK, LC_ALL, PORTAGE_BINHOST, PORTAGE_BUNZIP2_COMMAND, PORTAGE_COMPRESS, PORTAGE_COMPRESS_FLAGS, RUSTFLAGS # Are you using XFS? I'm seeing a few similar reports on 32bit with XFS, not that I'm familiar with the issue. Like bug #583282 Yes, I am using XFS. Here is the strike output of tar prior to emitting the error message: 911 read(0, <unfinished ...> 911 <... read resumed>"eselect-rust-20200419/\0\0\0\0\0\0\0\0\0\0"..., 10240) = 4096 911 read(0, <unfinished ...> 911 <... read resumed>"$srcdir/../..'.\n#\n# Of course, A"..., 6144) = 4096 911 read(0, <unfinished ...> 911 <... read resumed>"bsolete],\n [$0: two-"..., 2048) = 2048 911 fstat64(0, {st_mode=S_IFIFO|0600, st_size=0, ...}) = 0 911 getcwd("/video/portage.tmp/portage/app-eselect/eselect-rust-20200419/work", 8192) = 66 911 lstat64("/video/portage.tmp/portage/app-eselect/eselect-rust-20200419/work", {st_mode=S_IFDIR|0700, st_size=6, ...}) = 0 911 getcwd("/video/portage.tmp/portage/app-eselect/eselect-rust-20200419/work", 8190) = 66 911 lstat64("/video/portage.tmp/portage/app-eselect/eselect-rust-20200419/work", {st_mode=S_IFDIR|0700, st_size=6, ...}) = 0 911 write(2, "tar: ", 5) = 5 911 write(2, "eselect-rust-20200419: Cannot mk"..., 35) = 35 911 write(2, ": Value too large for defined da"..., 39) = 39 911 write(2, "\n", 1) = 1 It seems, tar is reading the uncompressed archive on stdin and has read a record for a new file or directory, provably a directory. It tries to mkdir, but the sandbox intercepts and returns an error. I am not sure, wether the getcwd() and lstat64() calls are from tar or from the sandbox. When I look into the core dumps I see, that the process abroted in check_syscall() within sandbox-2.20/libsandbox/libsandbox.c: /* If we get here, something bad happened */ sb_ebort("ISE: %s(%s)\n" "\tabs_path: %s\n" "\tres_path: %s\n" "\terrno=%i: %s\n", func, file, absolute_path, resolved_path, errno, strerror(errno)); Here ist the error message in the build output: * /var/tmp/portage/sys-apps/sandbox-2.20/work/sandbox-2.20/libsandbox/libsandbox.c:check_syscall():983: failure (Value too large for defined data type): * ISE: open_wr(eselect-rust-20200419/aclocal.m4) abs_path: (null) res_path: (null) errno=75: Value too large for defined data type And according to this message, this seems to be the road to hell: absolute_path = resolve_path(file, 0); /* Do not bother dereferencing symlinks when we are using a function that * itself does not dereference. This speeds things up and avoids updating * the atime implicitly. #415475 */ if (symlink_func(sb_nr, flags, absolute_path)) resolved_path = absolute_path; else resolved_path = resolve_path(file, 1); if (!absolute_path || !resolved_path) goto error; resolve_path() seems to have returned NULL in both calls. But maybe, these are two errors: first, mkdir(eselect-rust-20200419) is denied (for some unknown reason), and then, when trying to write eselect-rust-20200419/aclocal.m4, the sandbox is unable to resolve the path (due the the missing directory), but is unable to handle this situation. resolve_path() calls canonicalize(),which calls erealpath(). erealpath() calls egetcwd() and lstat(), if the name does not start with a slash. This probably is the origin of the two getcwd() and lstat64() calls seen with strace. Ok, egetcwd() calls sb_unwrapped_getcwd() and lstat(), too. But I still am not able to find any code setting errno=75 (EOVERFLOW). The man page of lstat64() states on EOVERFLOW: EOVERFLOW pathname or fd refers to a file whose size, inode number, or number of blocks cannot be represented in, respectively, the types off_t, ino_t, or blkcnt_t. This error can occur when, for example, an application compiled on a 32-bit platform without -D_FILE_OFFSET_BITS=64 calls stat() on a file whose size exceeds (1<<31)-1 bytes. According to this statement, it should help to add -D_FILE_OFFSET_BITS=64 when compiling the sandbox. (In reply to Mario Klebsch from comment #3) > Yes, I am using XFS. I guess it's a duplicate of the sandbox bug then, best continue there. *** This bug has been marked as a duplicate of bug 583282 *** |