Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 675828 - sys-apps/portage-2.3.56: pid-sandbox: unpack of cyrus-sasl-2.1.26.tar.gz triggers gzip: stdout: Broken pipe
Summary: sys-apps/portage-2.3.56: pid-sandbox: unpack of cyrus-sasl-2.1.26.tar.gz trig...
Status: RESOLVED FIXED
Alias: None
Product: Portage Development
Classification: Unclassified
Component: Core - Ebuild Support (show other bugs)
Hardware: All Linux
: Normal normal (vote)
Assignee: Portage team
URL:
Whiteboard:
Keywords: InVCS, REGRESSION
Depends on:
Blocks: 671498
  Show dependency tree
 
Reported: 2019-01-19 08:18 UTC by Zac Medico
Modified: 2019-02-28 23:23 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 Zac Medico gentoo-dev 2019-01-19 08:18:09 UTC
<mrueg> Fails with portage 2.3.56 but succeds with .51

>  * cyrus-sasl-2.1.26.tar.gz BLAKE2B SHA512 size ;-) ...                                                                                                                                             >>> Unpacking source...
> >>> Unpacking cyrus-sasl-2.1.26.tar.gz to /var/tmp/portage/dev-libs/cyrus-sasl-2.1.26-r12/work
> 
> gzip: stdout: Broken pipe
>  * ERROR: dev-libs/cyrus-sasl-2.1.26-r12::gentoo failed (unpack phase):
>  *   unpack: failure unpacking cyrus-sasl-2.1.26.tar.gz
>  * 
>  * Call stack:
>  *               ebuild.sh, line  124:  Called src_unpack
>  *             environment, line 5268:  Called default
>  *      phase-functions.sh, line  868:  Called default_src_unpack
>  *      phase-functions.sh, line  895:  Called __eapi0_src_unpack
>  *        phase-helpers.sh, line  792:  Called unpack 'cyrus-sasl-2.1.26.tar.gz'
>  *        phase-helpers.sh, line  433:  Called __unpack_tar 'gzip -d'
>  *        phase-helpers.sh, line  364:  Called __assert_sigpipe_ok 'unpack: failure unpacking cyrus-sasl-2.1.26.tar.gz'
>  *   isolated-functions.sh, line   43:  Called __helpers_die 'unpack: failure unpacking cyrus-sasl-2.1.26.tar.gz'
>  *   isolated-functions.sh, line  119:  Called die
>  * The specific snippet of code:
>  *              die "$@"
>  * 
>  * If you need support, post the output of `emerge --info '=dev-libs/cyrus-sasl-2.1.26-r12::gentoo'`,
>  * the complete build log and the output of `emerge -pqv '=dev-libs/cyrus-sasl-2.1.26-r12::gentoo'`.
> !!! When you file a bug report, please include the following information:
> GENTOO_VM=  CLASSPATH="" JAVA_HOME=""
> JAVACFLAGS="" COMPILER=""
> and of course, the output of emerge --info =cyrus-sasl-2.1.26
>  * The complete build log is located at '/var/tmp/portage/dev-libs/cyrus-sasl-2.1.26-r12/temp/build.log'.
>  * The ebuild environment file is located at '/var/tmp/portage/dev-libs/cyrus-sasl-2.1.26-r12/temp/environment'.
>  * Working directory: '/var/tmp/portage/dev-libs/cyrus-sasl-2.1.26-r12/work'
>  * S: '/var/tmp/portage/dev-libs/cyrus-sasl-2.1.26-r12/work/cyrus-sasl-2.1.26'
> 
> >>> Failed to emerge dev-libs/cyrus-sasl-2.1.26-r12, Log file:
> 
> >>>  '/var/tmp/portage/dev-libs/cyrus-sasl-2.1.26-r12/temp/build.log'
> 
>  * Messages for package dev-libs/cyrus-sasl-2.1.26-r12:
> 
>  * ERROR: dev-libs/cyrus-sasl-2.1.26-r12::gentoo failed (unpack phase):
>  *   unpack: failure unpacking cyrus-sasl-2.1.26.tar.gz
>  * 
>  * Call stack:
>  *               ebuild.sh, line  124:  Called src_unpack
>  *             environment, line 5268:  Called default
>  *      phase-functions.sh, line  868:  Called default_src_unpack
>  *      phase-functions.sh, line  895:  Called __eapi0_src_unpack
>  *        phase-helpers.sh, line  792:  Called unpack 'cyrus-sasl-2.1.26.tar.gz'
>  *        phase-helpers.sh, line  433:  Called __unpack_tar 'gzip -d'
>  *        phase-helpers.sh, line  364:  Called __assert_sigpipe_ok 'unpack: failure unpacking cyrus-sasl-2.1.26.tar.gz'
>  *   isolated-functions.sh, line   43:  Called __helpers_die 'unpack: failure unpacking cyrus-sasl-2.1.26.tar.gz'
>  *   isolated-functions.sh, line  119:  Called die
>  * The specific snippet of code:
>  *              die "$@"
>  * 
>  * If you need support, post the output of `emerge --info '=dev-libs/cyrus-sasl-2.1.26-r12::gentoo'`,
>  * the complete build log and the output of `emerge -pqv '=dev-libs/cyrus-sasl-2.1.26-r12::gentoo'`.
>  * The complete build log is located at '/var/tmp/portage/dev-libs/cyrus-sasl-2.1.26-r12/temp/build.log'.
>  * The ebuild environment file is located at '/var/tmp/portage/dev-libs/cyrus-sasl-2.1.26-r12/temp/environment'.
>  * Working directory: '/var/tmp/portage/dev-libs/cyrus-sasl-2.1.26-r12/work'
>  * S: '/var/tmp/portage/dev-libs/cyrus-sasl-2.1.26-r12/work/cyrus-sasl-2.1.26'
> emerge -av1 cyrus-sasl  7.58s user 0.94s system 77% cpu 10.963 total
Comment 5 Arfrever Frehtes Taifersar Arahesis 2019-01-20 14:57:41 UTC
(In reply to Zac Medico from comment #4)
> Patch posted for review:
> 
> https://archives.gentoo.org/gentoo-portage-dev/message/
> 0a31ebd45b6817fa3d2066d7e5a71ae6
> https://github.com/gentoo/portage/pull/401

This patch causes this error (only with FEATURES="pid-sandbox") for depend phase of ebuilds whose metadata are not cached:
bin/ebuild.sh: line 756: 19: Bad file descriptor

Line 756 is:
eval "echo \$(echo \${!f}) 1>&${PORTAGE_PIPE_FD}" || exit $?
Comment 6 Arfrever Frehtes Taifersar Arahesis 2019-01-20 15:09:37 UTC
(In reply comment #5)

Also it is necessary to run the command as root user, not an unprivileged user.
Comment 7 Zac Medico gentoo-dev 2019-01-20 19:41:38 UTC
(In reply to Arfrever Frehtes Taifersar Arahesis from comment #5)
> (In reply to Zac Medico from comment #4)
> > Patch posted for review:
> > 
> > https://archives.gentoo.org/gentoo-portage-dev/message/
> > 0a31ebd45b6817fa3d2066d7e5a71ae6
> > https://github.com/gentoo/portage/pull/401
> 
> This patch causes this error (only with FEATURES="pid-sandbox") for depend
> phase of ebuilds whose metadata are not cached:
> bin/ebuild.sh: line 756: 19: Bad file descriptor
> 
> Line 756 is:
> eval "echo \$(echo \${!f}) 1>&${PORTAGE_PIPE_FD}" || exit $?

Fixed in v2 to use Popen pass_fds parameter when appropriate:

https://archives.gentoo.org/gentoo-portage-dev/message/03bb3400f8331e506f1ed0b3c66804a2
Comment 8 Larry the Git Cow gentoo-dev 2019-01-21 00:02:21 UTC
The bug has been referenced in the following commit(s):

https://gitweb.gentoo.org/proj/portage.git/commit/?id=0d18c696230bcabe007e35194e4b97a38f3b69f5

commit 0d18c696230bcabe007e35194e4b97a38f3b69f5
Author:     Zac Medico <zmedico@gentoo.org>
AuthorDate: 2019-01-20 04:02:35 +0000
Commit:     Zac Medico <zmedico@gentoo.org>
CommitDate: 2019-01-20 23:31:41 +0000

    pid-ns-init: fix child process signal disposition (bug 675828)
    
    Use subprocess.Popen to correctly configure the signal disposition
    of the child process, since os.fork leaves the signal disposition
    in a state which may be inappropriate for various signals including
    SIGPIPE, SIGQUIT, SIGTERM, and SIGINT. For python implementations
    other that CPython >= 3, use preexec_fn to manually configure the
    signal disposition (I have found that this is necessary for CPython
    2.7 and all PyPy versions tested, including PyPy3).
    
    Bug: https://bugs.gentoo.org/675828
    Signed-off-by: Zac Medico <zmedico@gentoo.org>

 bin/pid-ns-init        | 39 +++++++++++++++++++++++++++++++++------
 lib/portage/process.py |  1 +
 2 files changed, 34 insertions(+), 6 deletions(-)
Comment 9 Larry the Git Cow gentoo-dev 2019-01-21 00:11:40 UTC
The bug has been referenced in the following commit(s):

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

commit 7d999af4a47bf55e53e54713d98d145f935935c1
Author:     Zac Medico <zmedico@gentoo.org>
AuthorDate: 2019-01-21 00:01:42 +0000
Commit:     Zac Medico <zmedico@gentoo.org>
CommitDate: 2019-01-21 00:08:55 +0000

    sys-apps/portage: version bump to 2.3.57
    
     #675756 emerge: compare new SLOT USE to installed SLOT
     #675826 INSTALL_MASK scalability: minimize fnmatch calls
     #675828 pid-sandbox: fix child process signal disposition
    
    Bug: https://bugs.gentoo.org/671498
    Bug: https://bugs.gentoo.org/675756
    Bug: https://bugs.gentoo.org/675826
    Bug: https://bugs.gentoo.org/675828
    Package-Manager: Portage-2.3.57, Repoman-2.3.12
    Signed-off-by: Zac Medico <zmedico@gentoo.org>

 sys-apps/portage/Manifest              |   1 +
 sys-apps/portage/portage-2.3.57.ebuild | 271 +++++++++++++++++++++++++++++++++
 2 files changed, 272 insertions(+)