Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 936613 - app-portage/elt-patches app-text/ghostscript-gpl-10.03.1 fails to prepare due to: eltpatch failed: "yesno: invalid argument: '/etc/init.d/display-manager'"
Summary: app-portage/elt-patches app-text/ghostscript-gpl-10.03.1 fails to prepare due...
Status: RESOLVED FIXED
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: Current packages (show other bugs)
Hardware: AMD64 Linux
: Normal normal
Assignee: Gentoo's Team for Core System packages
URL:
Whiteboard:
Keywords:
: 936059 (view as bug list)
Depends on:
Blocks:
 
Reported: 2024-07-25 07:06 UTC by hkBst
Modified: 2024-08-02 23:14 UTC (History)
2 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 hkBst 2024-07-25 07:06:38 UTC
>>> Emerging (322 of 358) app-text/ghostscript-gpl-10.03.1::gentoo
 * ghostscript-10.03.1.tar.xz BLAKE2B SHA512 size ;-) ...                                                                                                                                                                                              [ ok ]
 * ghostscript-gpl-10.0-patches.tar.xz BLAKE2B SHA512 size ;-) ...                                                                                                                                                                                     [ ok ]
>>> Unpacking source...
>>> Unpacking ghostscript-10.03.1.tar.xz to /var/tmp/portage/app-text/ghostscript-gpl-10.03.1/work
>>> Unpacking ghostscript-gpl-10.0-patches.tar.xz to /var/tmp/portage/app-text/ghostscript-gpl-10.03.1/work
>>> Source unpacked in /var/tmp/portage/app-text/ghostscript-gpl-10.03.1/work
>>> Preparing source in /var/tmp/portage/app-text/ghostscript-gpl-10.03.1/work/ghostscript-10.03.1 ...
 * Applying patches from /var/tmp/portage/app-text/ghostscript-gpl-10.03.1/work/ghostscript-gpl-10.0-patches ...
 *   0001-Make-sure-dvipdf-is-being-run-securely.patch ...                                                                                                                                                                                             [ ok ]
 *   0002-Allow-the-build-timestamp-to-be-externally-set.patch ...                                                                                                                                                                                     [ ok ]
 *   0003-Fix-docdir-for-Gentoo.patch ...                                                                                                                                                                                                              [ ok ]
 *   0004-Don-t-force-libstdc-fix-build-w-libc.patch ...                                                                                                                                                                                               [ ok ]
 * Applying ghostscript-gpl-10.03.0-c99.patch ...                                                                                                                                                                                                      [ ok ]
 * Running eautoreconf in '/var/tmp/portage/app-text/ghostscript-gpl-10.03.1/work/ghostscript-10.03.1' ...
 * Running 'aclocal --system-acdir=/var/tmp/portage/app-text/ghostscript-gpl-10.03.1/temp/aclocal' ...                                                                                                                                                 [ ok ]
 * Running 'autoconf --force' ...                                                                                                                                                                                                                      [ ok ]
 * Running elibtoolize in: ghostscript-10.03.1/
 * Running elibtoolize in: ghostscript-10.03.1/ijs/
 *   Applying ppc64le/2.4.4 patch ...
 * Running eautoreconf in '/var/tmp/portage/app-text/ghostscript-gpl-10.03.1/work/ghostscript-10.03.1/ijs' ...
 * Running 'libtoolize --install --copy --force --automake' ...                                                                                                                                                                                        [ ok ]
 * Running 'aclocal --system-acdir=/var/tmp/portage/app-text/ghostscript-gpl-10.03.1/temp/aclocal' ...                                                                                                                                                 [ ok ]
 * Running 'autoconf --force' ...                                                                                                                                                                                                                      [ ok ]
 * Running 'automake --add-missing --copy --foreign --force-missing' ...                                                                                                                                                                               [ ok ]
 * Running elibtoolize in: ghostscript-10.03.1/ijs/
 * yesno: invalid argument: '/etc/init.d/display-manager'
 * yesno: invalid argument: '/etc/init.d/display-manager'
---8<--- many identical copies of "yesno: invalid argument:" snipped --->8---
 * yesno: invalid argument: '/etc/init.d/display-manager'
 * yesno: invalid argument: '/etc/init.d/display-manager'
 * yesno: invalid argument: 
/var/tmp/portage/app-text/ghostscript-gpl-10.03.1/temp/environment: line 1244:   686 Segmentation fault      ELT_LOGDIR=${T} LD=$(tc-getLD) eltpatch "${@}"
 * ERROR: app-text/ghostscript-gpl-10.03.1::gentoo failed (prepare phase):
 *   eltpatch failed
 * 
 * Call stack:
 *     ebuild.sh, line  136:  Called src_prepare
 *   environment, line 2115:  Called eautoreconf
 *   environment, line 1209:  Called elibtoolize '--force' '/var/tmp/portage/app-text/ghostscript-gpl-10.03.1/work/ghostscript-10.03.1/ijs'
 *   environment, line 1246:  Called die
 * The specific snippet of code:
 *       ELT_LOGDIR=${T} LD=$(tc-getLD) eltpatch "${@}" || die "eltpatch failed"
 * 
 * If you need support, post the output of `emerge --info '=app-text/ghostscript-gpl-10.03.1::gentoo'`,
 * the complete build log and the output of `emerge -pqv '=app-text/ghostscript-gpl-10.03.1::gentoo'`.
 * The complete build log is located at '/var/tmp/portage/app-text/ghostscript-gpl-10.03.1/temp/build.log'.
 * The ebuild environment file is located at '/var/tmp/portage/app-text/ghostscript-gpl-10.03.1/temp/environment'.
 * Working directory: '/var/tmp/portage/app-text/ghostscript-gpl-10.03.1/work/ghostscript-10.03.1/ijs'
 * S: '/var/tmp/portage/app-text/ghostscript-gpl-10.03.1/work/ghostscript-10.03.1'

Reproducible: Always




Portage 3.0.65 (python 3.12.4-final-0, default/linux/amd64/17.1/no-multilib, gcc-13, glibc-2.39-r9, 5.15.159-gentoo x86_64)
=================================================================
System uname: Linux-5.15.159-gentoo-x86_64-Intel-R-_Core-TM-_i5-6200U_CPU_@_2.30GHz-with-glibc2.39
KiB Mem:     7995520 total,   1449360 free
KiB Swap:   16123900 total,  15561748 free
Timestamp of repository gentoo: Wed, 24 Jul 2024 12:00:00 +0000
Head commit of repository gentoo: 2c5eabe4627110b44c6cb9c9f41b0f81e2850fa4
sh bash 5.2_p26-r8
ld GNU ld (Gentoo 2.42 p6) 2.42.0
app-misc/pax-utils:        1.3.7::gentoo
app-shells/bash:           5.2_p26-r8::gentoo
dev-build/autoconf:        2.13-r8::gentoo, 2.72-r1::gentoo
dev-build/automake:        1.16.5-r2::gentoo, 1.17-r1::gentoo
dev-build/cmake:           3.30.1::gentoo
dev-build/libtool:         2.4.7-r4::gentoo
dev-build/make:            4.4.1-r1::gentoo
dev-build/meson:           1.5.0::gentoo
dev-lang/perl:             5.40.0::gentoo
dev-lang/python:           3.11.9::gentoo, 3.12.4_p2::gentoo, 3.13.0_beta4::gentoo
dev-lang/rust-bin:         1.79.0::gentoo
sys-apps/baselayout:       2.15::gentoo
sys-apps/openrc:           0.54.2::gentoo
sys-apps/sandbox:          2.39::gentoo
sys-devel/binutils:        2.42-r2::gentoo
sys-devel/binutils-config: 5.5::gentoo
sys-devel/clang:           17.0.6::gentoo, 18.1.0::gentoo
sys-devel/gcc:             13.3.1_p20240614::gentoo, 14.1.1_p20240720::gentoo
sys-devel/gcc-config:      2.11::gentoo
sys-devel/lld:             17.0.6::gentoo
sys-devel/llvm:            17.0.6::gentoo, 18.1.8-r1::gentoo
sys-kernel/linux-headers:  6.9::gentoo (virtual/os-headers)
sys-libs/glibc:            2.39-r9::gentoo
Repositories:

gentoo
    location: /usr/portage
    sync-type: rsync
    sync-uri: rsync://rsync.gentoo.org/gentoo-portage
    priority: -1000
    volatile: True
    sync-rsync-extra-opts: 
    sync-rsync-verify-metamanifest: yes
    sync-rsync-verify-jobs: 1
    sync-rsync-verify-max-age: 3

local_overlay
    location: /home/marijn/local_overlay
    masters: gentoo
    volatile: True

ACCEPT_KEYWORDS="amd64 ~amd64"
ACCEPT_LICENSE="@FREE"
CBUILD="x86_64-pc-linux-gnu"
CFLAGS="-march=native -O2"
CHOST="x86_64-pc-linux-gnu"
CONFIG_PROTECT="/etc /usr/share/gnupg/qualified.txt"
CONFIG_PROTECT_MASK="/etc/angband/gamedata/ /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 /etc/texmf/language.dat.d /etc/texmf/language.def.d /etc/texmf/updmap.d /etc/texmf/web2c"
CXXFLAGS="-march=native -O2"
DISTDIR="/usr/portage/distfiles"
ENV_UNSET="CARGO_HOME DBUS_SESSION_BUS_ADDRESS DISPLAY GDK_PIXBUF_MODULE_FILE 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 XDG_STATE_HOME"
FCFLAGS="-O2 -pipe"
FEATURES="assume-digests binpkg-docompress binpkg-dostrip binpkg-logs buildpkg-live config-protect-if-modified distlocks ebuild-locks fixlafiles ipc-sandbox merge-sync merge-wait multilib-strict network-sandbox news parallel-fetch pid-sandbox pkgdir-index-trusted 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 -pipe"
GENTOO_MIRRORS="http://distfiles.gentoo.org"
LANG="nl_NL.utf8"
LDFLAGS="-Wl,-O1 -Wl,--as-needed"
LEX="flex"
MAKEOPTS="-j5"
PKGDIR="/usr/portage/packages"
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"
SHELL="/bin/bash"
USE="X acl alsa amd64 bindist bzip2 cairo cjk cli crypt dbus dri dv egl elogind emacs flac fontconfig fortran gdbm gif gles gles2 gnutls gpm gtk gtk3 iconv icu imagemagick ipv6 jpeg jpeg2k lapack libtirpc midi mp3 ncurses networkmanager nls nss ogg opengl openmp otr pam pcre pdf png policykit postscript pulseaudio qml readline sdl sdlgfx seccomp sound split-usr sqlite ssl startup-notification svg test-rust theora threads tiff tk truetype udev udisks unicode v4l vorbis vpx vulkan wav wayland webp x264 xattr xcb xft xml xpm xscreensaver xvid zlib" ABI_X86="64" ADA_TARGET="gcc_12" APACHE2_MODULES="authn_core authz_core socache_shmcb unixd actions alias auth_basic authn_anon authn_dbm authn_file authz_dbm authz_groupfile authz_host authz_owner authz_user autoindex cache cgi cgid dav dav_fs dav_lock deflate dir env expires ext_filter file_cache filter headers include info log_config logio 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="aes avx avx2 f16c fma3 mmx mmxext pclmul popcnt rdrand sse sse2 sse3 sse4_1 sse4_2 ssse3" CURL_SSL="gnutls" ELIBC="glibc" GPSD_PROTOCOLS="ashtech aivdm earthmate evermore fv18 garmin garmintxt gpsclock greis isync itrax mtk3301 ntrip navcom oceanserver oncore rtcm104v2 rtcm104v3 sirf skytraq superstar2 tsip tripmate tnt ublox" GRUB_PLATFORMS="efi-64" INPUT_DEVICES="synaptics evdev" KERNEL="linux" L10N="en nl de fr" LCD_DEVICES="bayrad cfontz glk hd44780 lb216 lcdm001 mtxorb text" LUA_SINGLE_TARGET="lua5-1" LUA_TARGETS="lua5-1" OFFICE_IMPLEMENTATION="libreoffice" PHP_TARGETS="php8-2" POSTGRES_TARGETS="postgres15" PYTHON_SINGLE_TARGET="python3_12" PYTHON_TARGETS="python3_12" RUBY_TARGETS="ruby31 ruby32" VIDEO_CARDS="intel i965" XTABLES_ADDONS="quota2 psd pknock lscan length2 ipv4options ipp2p iface geoip fuzzy condition tarpit sysrq proto logmark ipmark dhcpmac delude chaos account"
Unset:  ADDR2LINE, AR, ARFLAGS, AS, ASFLAGS, CC, CCLD, CONFIG_SHELL, CPP, CPPFLAGS, CTARGET, CXX, CXXFILT, ELFEDIT, EMERGE_DEFAULT_OPTS, EXTRA_ECONF, F77FLAGS, FC, GCOV, GPROF, INSTALL_MASK, LC_ALL, LD, LFLAGS, LIBTOOL, LINGUAS, MAKE, MAKEFLAGS, NM, OBJCOPY, OBJDUMP, PORTAGE_BINHOST, PORTAGE_BUNZIP2_COMMAND, PORTAGE_COMPRESS, PORTAGE_COMPRESS_FLAGS, PORTAGE_RSYNC_EXTRA_OPTS, PYTHONPATH, RANLIB, READELF, RUSTFLAGS, SIZE, STRINGS, STRIP, YACC, YFLAGS
Comment 1 Sam James archtester Gentoo Infrastructure gentoo-dev Security 2024-07-25 10:16:09 UTC
Please attach the full, untruncated build.log (as the stack size may matter here).
Comment 2 kfm 2024-07-25 13:12:44 UTC
Also, please apply a temporary alteration to /usr/bin/eltpatch, such that the first three lines are as follows.

#!/bin/bash
PS4='+$BASH_SOURCE:$LINENO:$FUNCNAME: '
set -x
Comment 3 Mike Gilbert gentoo-dev 2024-07-25 20:12:10 UTC
Also attached the environment file please.
Comment 4 Mike Gilbert gentoo-dev 2024-07-27 14:11:37 UTC
Please change the bug status to UNCONFIRMED once the requested information has been provided.
Comment 5 kfm 2024-07-28 15:40:26 UTC
*** Bug 936059 has been marked as a duplicate of this bug. ***
Comment 6 kfm 2024-07-28 16:09:36 UTC
The sequence of events is as follows.

1) EINFO_LOG is set to /etc/init.d/display-manager (why remains a mystery)
2) eltpatch calls esyslog()
3) esyslog() calls yesno()
4) yesno() checks whether EINFO_LOG refers to a valid identifier on second pass
5) the value is not a valid identifier; die() is called
6) the die() function got overridden by eltpatch and is duly called
7) the die() function calls eerror()
8) eerror() calls esyslog()
9) infinite recursion occurs until bash runs out of stack space

Regarding #5, having yesno() die wasn't a great idea. It was made a warning on the 11th June but there needs to be a new release of gentoo-functions for that change to be realised at large.

Regarding #8, to write a die() function that calls back into gentoo-functions in any capacity is a bad thing to do, irrespective of the circumstances. The die() function in gentoo-functions specifically refrains from doing this.

For now, I think that the appropriate thing to do would be twofold:

- make eltpatch die() use printf >&2, just as gentoo-functions does
- declare eltpatch die() prior to sourcing functions.sh, not afterwards

It would also be good to tag a new gentoo-functions release at some point in the near future. Eventually, it will become feasible to remove the declaration of die() from eltpatch altogether.

All of the above aside, those that are reporting this issue would be well advised to find out how and why EINFO_LOG is set to such a value and to prevent it from happening.

...

P.S. I think that the behaviour of yesno() whereby it falls back to treating the value as a potential identifier is a misfeature and would like to remove it. The problem is that I don't know for certain that there is no code in the wild expecting for this long-standing behaviour to occur. I have not seen any.
Comment 7 kfm 2024-07-28 16:13:18 UTC
(In reply to RumpletonBongworth from comment #6)

> The die() function in gentoo-functions specifically refrains from doing this.

Other than to call quote_args, that is. However, it is by design and has no effect on control flow.
Comment 9 Larry the Git Cow gentoo-dev 2024-07-29 17:30:21 UTC
The bug has been closed via the following commit(s):

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

commit a7107c20c6b3e3e4b656941d395970904059c277
Author:     Kerin Millar <kfm@plushkava.net>
AuthorDate: 2024-07-28 21:47:17 +0000
Commit:     Sam James <sam@gentoo.org>
CommitDate: 2024-07-29 17:29:18 +0000

    sys-apps/gentoo-functions: revise 1.6 as 1.6-r1
    
    This revision backports a few patches to prevent ~arch keyword users
    with unusual EINFO_LOG declarations from being affected by bug #936613.
    
    Closes: https://bugs.gentoo.org/936613
    Signed-off-by: Kerin Millar <kfm@plushkava.net>
    Signed-off-by: Sam James <sam@gentoo.org>

 .../gentoo-functions-1.6-add-warn-function.patch   |  34 +++
 ...-functions-1.6-relax-parameter-validation.patch | 233 +++++++++++++++++++++
 ...s-1.6.ebuild => gentoo-functions-1.6-r1.ebuild} |   5 +
 3 files changed, 272 insertions(+)
Comment 10 Larry the Git Cow gentoo-dev 2024-08-02 23:14:11 UTC
The bug has been referenced in the following commit(s):

https://gitweb.gentoo.org/proj/gentoo-functions.git/commit/?id=d6e689bc832e4b033f4af9cb6746a99649ecc8d8

commit d6e689bc832e4b033f4af9cb6746a99649ecc8d8
Author:     Kerin Millar <kfm@plushkava.net>
AuthorDate: 2024-07-31 23:20:10 +0000
Commit:     Kerin Millar <kfm@plushkava.net>
CommitDate: 2024-07-31 23:36:10 +0000

    Treat EINFO_LOG as false if equal to RC_SERVICE
    
    Consider the value of EINFO_LOG to be false in the event that it is
    equal to the value of RC_SERVICE. The reason for this is that, as of the
    time of writing, openrc-run(8) defines and uses EINFO_LOG in a way that
    is at odds with gentoo-functions. Ideally, the behaviour of OpenRC would
    be modified so that it becomes possible to jettison this workaround.
    
    Fixes: 0dd8364c03c6f8737150ee4f146ddeeec57efee9
    Bug: https://bugs.gentoo.org/936613
    Signed-off-by: Kerin Millar <kfm@plushkava.net>

 functions/rc.sh | 8 ++++++--
 1 file changed, 6 insertions(+), 2 deletions(-)