Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 762319 - kernel-2.eclass with app-shells/bash-5.1_p4 causes environment: line 2647: 10#: invalid integer constant (error token is "10#") in sys-kernel/git-sources-5.11_rc1
Summary: kernel-2.eclass with app-shells/bash-5.1_p4 causes environment: line 2647: 10...
Status: RESOLVED FIXED
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: Eclasses (show other bugs)
Hardware: All Linux
: Normal normal (vote)
Assignee: Gentoo Kernel Bug Wranglers and Kernel Maintainers
URL:
Whiteboard:
Keywords:
Depends on:
Blocks: bash-5.1
  Show dependency tree
 
Reported: 2020-12-28 23:21 UTC by jospezial
Modified: 2021-01-01 19:18 UTC (History)
5 users (show)

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 jospezial 2020-12-28 23:21:07 UTC
[ebuild  N     ] sys-kernel/git-sources-5.11_rc1:5.11_rc1::gentoo  USE="symlink -build" 0 KiB

Total: 1 package (1 new), Size of downloads: 0 KiB

Would you like to merge these packages? [Yes/No] 
>>> Verifying ebuild manifests
>>> Emerging (1 of 1) sys-kernel/git-sources-5.11_rc1::gentoo
>>> Failed to emerge sys-kernel/git-sources-5.11_rc1, Log file:
>>>  '/var/tmp/portage/sys-kernel/git-sources-5.11_rc1/temp/build.log'
>>> Jobs: 0 of 1 complete, 1 failed                 Load avg: 1.14, 0.44, 0.40
 * Package:    sys-kernel/git-sources-5.11_rc1
 * Repository: gentoo
 * Maintainer: mpagano@gentoo.org kernel@gentoo.org
 * USE:        abi_x86_64 amd64 elibc_glibc kernel_linux symlink userland_GNU
 * FEATURES:   ccache network-sandbox preserve-libs sandbox userpriv usersandbox
>>> Preparing to unpack ...
>>> Unpacking source...
>>> Unpacking linux-5.10.tar.xz to /var/tmp/portage/sys-kernel/git-sources-5.11_rc1/work
/var/tmp/portage/sys-kernel/git-sources-5.11_rc1/temp/environment: line 2647: 10#: invalid integer constant (error token is "10#")
 * The ebuild phase 'unpack' has exited unexpectedly. This type of behavior
 * is known to be triggered by things such as failed variable assignments
 * (bug #190128) or bad substitution errors (bug #200313). Normally, before
 * exiting, bash should have displayed an error message above. If bash did
 * not produce an error message above, it's possible that the ebuild has
 * called `exit` when it should have called `die` instead. This behavior
 * may also be triggered by a corrupt bash binary or a hardware problem
 * such as memory or cpu malfunction. If the problem is not reproducible or
 * it appears to occur randomly, then it is likely to be triggered by a
 * hardware problem. If you suspect a hardware problem then you should try
 * some basic hardware diagnostics such as memtest. Please do not report
 * this as a bug unless it is consistently reproducible and you are sure
 * that your bash binary and hardware are functioning properly.


That is the line:
                 STRICT_COUNT=$((10#${STRICT_COUNT} + 1));
Comment 1 Ionen Wolkens 2020-12-29 00:43:20 UTC
This is bash-5.1 specific, stable bash works fine.
Comment 2 Ionen Wolkens 2020-12-29 12:40:08 UTC
Actually I'm amazed this worked at all.

For some reason bash-5.0 let this goes by and echos 1

   testfunc() { local SC; echo $((10#${SC} + 1)); }
   testfunc

I assume the intend here was for ${#SC}? Not that I've reviewed the logic. This is also used in another location written the same way.

kernel-2.eclass bug rather than git-sources anyway.
Comment 3 jospezial 2020-12-29 15:58:28 UTC
emerge --info bash
Portage 3.0.12 (python 3.8.7-final-0, default/linux/amd64/17.1, gcc-10.2.0, glibc-2.32-r6, 5.10.3 x86_64)
=================================================================
                         System Settings
=================================================================
System uname: Linux-5.10.3-x86_64-AMD_Athlon-tm-_II_X2_240_Processor-with-glibc2.2.5
KiB Mem:     4026920 total,    678748 free
KiB Swap:   11010040 total,  11006968 free
Timestamp of repository poly-c: Tue, 29 Dec 2020 12:35:09 +0000
Head commit of repository poly-c: ffb3f6e2a3477da8114a32a7dfe6b3e464448b95

Head commit of repository gentoo: e7a9ef74b2b3e1dd7255138d6fad4737a06f1fac

Timestamp of repository FireBurn: Tue, 29 Dec 2020 03:05:08 +0000
Head commit of repository FireBurn: d567c3fb6d17fe0e0f67a4f83c29a42c38146616

Timestamp of repository gamerlay: Mon, 28 Dec 2020 10:27:23 +0000
Head commit of repository gamerlay: 7b321120adfa6044141da4465bcea8b8e6aef5f1

Timestamp of repository java: Mon, 28 Dec 2020 10:27:28 +0000
Head commit of repository java: c6419d6c365faa39c6fbded3bf1e1d69f4d7ad2b

Timestamp of repository jorgicio: Tue, 29 Dec 2020 15:35:09 +0000
Head commit of repository jorgicio: 343965c84378ec5428585272bbfd942f5a55321a

Head commit of repository kde: 005287b8721073d616f9aa294c81d7d32d0c44c7

Timestamp of repository libressl: Mon, 28 Dec 2020 23:05:14 +0000
Head commit of repository libressl: a88295e69a9576750152131cedb3a2010e6f5a03

Head commit of repository mbucas: ee777421fd3fa5d5c257d6a21e068b088a04da4c

Timestamp of repository pg_overlay: Tue, 29 Dec 2020 13:35:07 +0000
Head commit of repository pg_overlay: 8f620c0d84d26d3cec3219609831b2c61ff6ddff

Timestamp of repository qt: Mon, 28 Dec 2020 10:27:39 +0000
Head commit of repository qt: 8e5b984ef0297cfdce82c62f240619cb290ec5e8

Timestamp of repository seden: Mon, 28 Dec 2020 23:05:14 +0000
Head commit of repository seden: af9fbe179a6c493579575a95f9d42b9c64085b22

Timestamp of repository stefantalpalaru: Mon, 28 Dec 2020 23:05:14 +0000
Head commit of repository stefantalpalaru: 62bf18c69906c32ee3a4d423c7654b124444fe48

Timestamp of repository wine: Mon, 28 Dec 2020 10:28:22 +0000
Head commit of repository wine: c55e6b3ef7da885580addbba616687994720d332

sh bash 5.1_p4
ld GNU ld (Gentoo 2.35.1 p2) 2.35.1
ccache version 4.1 [enabled]
app-shells/bash:          5.1_p4::gentoo
dev-java/java-config:     2.3.1::gentoo
dev-lang/perl:            5.30.3-r1::gentoo
dev-lang/python:          3.8.7::gentoo, 3.9.1::gentoo
dev-util/ccache:          4.1::gentoo
dev-util/cmake:           3.19.2::gentoo
dev-util/pkgconfig:       0.29.2::gentoo
sys-apps/baselayout:      2.7-r1::gentoo
sys-apps/openrc:          0.42.1::gentoo
sys-apps/sandbox:         2.20::gentoo
sys-devel/autoconf:       2.13-r1::gentoo, 2.69-r5::gentoo
sys-devel/automake:       1.16.3-r1::gentoo
sys-devel/binutils:       2.35.1-r1::gentoo
sys-devel/gcc:            10.2.0-r4::gentoo
sys-devel/gcc-config:     2.3.2-r1::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-r6::gentoo
Repositories:

poly-c
    location: /var/db/repos/poly-c
    sync-type: git
    sync-uri: https://github.com/gentoo-mirror/poly-c.git
    masters: gentoo
    priority: -1001

gentoo
    location: /usr/portage
    sync-type: git
    sync-uri: https://anongit.gentoo.org/git/repo/gentoo.git
    priority: -1000

FireBurn
    location: /var/db/repos/FireBurn
    sync-type: git
    sync-uri: https://github.com/gentoo-mirror/FireBurn.git
    masters: gentoo

gamerlay
    location: /var/db/repos/gamerlay
    sync-type: git
    sync-uri: https://github.com/gentoo-mirror/gamerlay.git
    masters: gentoo

java
    location: /var/db/repos/java
    sync-type: git
    sync-uri: https://github.com/gentoo-mirror/java.git
    masters: gentoo

jorgicio
    location: /var/db/repos/jorgicio
    sync-type: git
    sync-uri: https://github.com/gentoo-mirror/jorgicio.git
    masters: gentoo

kde
    location: /var/db/repos/kde
    sync-type: git
    sync-uri: https://anongit.gentoo.org/git/proj/kde.git
    masters: gentoo

libressl
    location: /var/db/repos/libressl
    sync-type: git
    sync-uri: https://github.com/gentoo-mirror/libressl.git
    masters: gentoo

mbucas
    location: /var/db/repos/mbucas
    sync-type: git
    sync-uri: https://github.com/mbucas/gentoo-overlay
    masters: gentoo

overlay_jl
    location: /usr/local/portage
    masters: gentoo
    priority: 0

pg_overlay
    location: /var/db/repos/pg_overlay
    sync-type: git
    sync-uri: https://github.com/gentoo-mirror/pg_overlay.git
    masters: gentoo

qt
    location: /var/db/repos/qt
    sync-type: git
    sync-uri: https://github.com/gentoo-mirror/qt.git
    masters: gentoo

seden
    location: /var/db/repos/seden
    sync-type: git
    sync-uri: https://github.com/gentoo-mirror/seden.git
    masters: gentoo

stefantalpalaru
    location: /var/db/repos/stefantalpalaru
    sync-type: git
    sync-uri: https://github.com/gentoo-mirror/stefantalpalaru.git
    masters: gentoo

wine
    location: /var/db/repos/wine
    sync-type: git
    sync-uri: https://github.com/gentoo-mirror/wine.git
    masters: gentoo

ACCEPT_KEYWORDS="amd64 ~amd64"
ACCEPT_LICENSE="*"
CBUILD="x86_64-pc-linux-gnu"
CFLAGS="-march=native -mtune=native -O2 -pipe"
CHOST="x86_64-pc-linux-gnu"
CONFIG_PROTECT="/etc /usr/lib64/libreoffice/program/sofficerc /usr/share/config /usr/share/gnupg/qualified.txt"
CONFIG_PROTECT_MASK="/etc/ca-certificates.conf /etc/dconf /etc/env.d /etc/fonts/fonts.conf /etc/gconf /etc/gentoo-release /etc/revdep-rebuild /etc/sandbox.d /etc/terminfo"
CXXFLAGS="-march=native -mtune=native -O2 -pipe"
DISTDIR="/usr/portage/distfiles"
EMERGE_DEFAULT_OPTS="--autounmask=y --autounmask-write=y --keep-going --quiet-build=y --verbose-conflicts"
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="-march=native -mtune=native -O2 -pipe"
FEATURES="assume-digests binpkg-docompress binpkg-dostrip binpkg-logs ccache 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 -mtune=native -O2 -pipe"
GENTOO_MIRRORS="http://distfiles.gentoo.org"
LANG="de_DE.UTF-8"
LDFLAGS="-Wl,-O1 -Wl,--as-needed"
LINGUAS="de"
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="64bit X Xaw3d a52 aac aacplus aacs aalib ace acl acpi activefilter admin aften alsa ambisonics amd64 ap apm apng archive arping audacious audiofile automount bazaar bdplus binary-drivers bluetooth bluray boost btrfs bzip2 cairo ccache cdda cddb cdio cdr cdrom cgi charconv chm chroot cjk clang cli client colordiff colorpicker colors compress corefonts cpio cpufreq_bench cpuload crypt css cue cups curl curlwrappers custom-modes d3d9 dav1d dbus declarative device-mapper dga dhcp dom doom doomsday dri dri3 drm dts dump dv dvb dvd dvdnav eap eap-sim eap-tls ebook egl elogind encode enscript epub equalizer exif extensions extras faac faad farstream fat fax fbcon fdformat fdk ffmpeg fftw firefox flac fluidsynth fontconfig foomatic foomaticdb fortran freedoom ftp fuse g3dvl gadu gallium gd gegl geoip gif git glamor gpg gphoto2 graphite gstreamer gtk gtk3 gtkstyle gui gzip haptic hddtemp hdf hdf5 heretic hexen hid highlight history hpcups hpijs http http2 hwdb iconv icu id3tag idn imagemagick initramfs inotify introspection ipc ipod ipv6 jack java javafx jbootstrap jit jpeg jpeg2k kde kdenlive ladspa lame lcms legacy-systray lensfun libaom libass libcanberra libdrm libglvnd libinput libkms libmpv libnotify libressl librtmp libsamplerate libssh2 libtirpc libv4l libwww lightdm live lm-sensors lm_sensors logrotate lua lv2 lximage lz4 lzma lzo mad magic man matroska md5sum meanwhile melt mercurial metalink midi mikmod mime minizip mixer mjpeg mmap mms mng mobi mod modern-top modplug mono mount mozilla mp3 mp4 mpeg mpeg2 mplayer mtp multilib multimedia multislot musepack musicbrainz nano-syntax ncat ncurses ndiff network networkmonitor nls nmap-update normalize nowlistening nping nptl ntfs ntfsprogs ntp nvidia nvram obex ocr odbc ogg ogm openal opencl opengl openh264 openmp opus oscar osdmenu otr p2p pam pango panorama parse-clocks pcap pci pcre pcre16 pdf pdfimport pipes plasma plugins pm-utils png policykit postproc postscript powermanagement ppds printsupport privacy projectm pulseaudio pvr python qalculate qml qrcode qt5 quicktime radio rar raw readline recording reiser4 reiserfs remote-access replaygain rtc rtmp rubberband sbsms scanner screensaver scripttools sdl seccomp secure-delete sensors serial serialport sftp sha512 shorten shout skins slang smi sndfile sockets sound soundtouch source-highlight speech speex spell split-usr sql sqlite sqlite3 squashfs ssh ssl staging startup-notification statistics statusnotifier stk stream subtitles subversion sudo svc svg symlink sync-plugin-portage syslog sysstat system-ffmpeg system-harfbuzz system-icu system-jpeg system-jsoncpp system-libvpx system-sqlite szip taglib tcpd text texteffect tftp tftpd themes theora threads thumbnail tiff timidity tracepath traceroute translator truetype twolame udev udf udisks unicode update_drivedb upower urlpicpreview usb utils v4l v4l2 vaapi vala vamp vdpau vector-icons video videos virtualbox vkd3d vnc vorbis vpx vroot vst vulkan vulkaninfo wad wav wavpack wayland webgl webp webpresence widgets winbind winpopup wmf worldclock wps wxwidgets x264 x265 xattr xcb xcomposite xfs xine xinerama xinetd xkb xml xmp xorg xosd xpm xrandr xscreensaver xv xvid yahoo zenmap zip zlib zstd zvbi" 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="3dnow 3dnowext mmx mmxext popcnt sse sse2 sse3 sse4a" CURL_SSL="libressl" 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" LCD_DEVICES="bayrad cfontz cfontz633 glk hd44780 lb216 lcdm001 mtxorb ncurses text" LIBREOFFICE_EXTENSIONS="presenter-console presenter-minimizer" LLVM_TARGETS="AMDGPU BPF X86" LUA_SINGLE_TARGET="lua5-2" LUA_TARGETS="lua5-2 lua5-3 lua5-4 luajit" OFFICE_IMPLEMENTATION="libreoffice" PHP_TARGETS="php7-2 php7-3 php7-4" POSTGRES_TARGETS="postgres10 postgres11" PYTHON_SINGLE_TARGET="python3_8" PYTHON_TARGETS="python3_8 python3_9" RUBY_TARGETS="ruby27 ruby30" USERLAND="GNU" VIDEO_CARDS="radeon amdgpu radeonsi" 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, INSTALL_MASK, LC_ALL, MAKEOPTS, PORTAGE_BINHOST, PORTAGE_BUNZIP2_COMMAND, PORTAGE_COMPRESS, PORTAGE_COMPRESS_FLAGS, PORTAGE_RSYNC_EXTRA_OPTS

=================================================================
                        Package Settings
=================================================================

app-shells/bash-5.1_p4::gentoo was built with the following:
USE="net nls plugins (readline) -afs -bashlogger -examples -mem-scramble" ABI_X86="(64)"
LDFLAGS="-Wl,-O1 -Wl,--as-needed -Wl,-rpath,/usr/lib64/bash"
Comment 4 Ionen Wolkens 2020-12-30 12:09:06 UTC
(In reply to Ionen Wolkens from comment #2)
> I assume the intend here was for ${#SC}?
Nevermind this, I just learned what arithmetic base in bash
is (never needed this construct before). That aside, SC being
unset looks like the problem, e.g. $((10#+1))
Comment 5 Larry the Git Cow gentoo-dev 2021-01-01 19:18:17 UTC
The bug has been closed via the following commit(s):

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

commit b622a2ec935dd8d9e60a2c92bcbacc5e57f5e9c7
Author:     Mike Pagano <mpagano@gentoo.org>
AuthorDate: 2021-01-01 19:17:38 +0000
Commit:     Mike Pagano <mpagano@gentoo.org>
CommitDate: 2021-01-01 19:17:38 +0000

    kernel-2.eclass: Handle stricter bash 5.1 expansion rules
    
    Set default value in the case that STRICT_COUNT is unset.
    Thanks to jospezial for reporting
    
    Closes: https://bugs.gentoo.org/762319
    
    Signed-off-by: Mike Pagano <mpagano@gentoo.org>

 eclass/kernel-2.eclass | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)