Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 871570 - sys-apps/portage exits silently during updates when decompressor fails
Summary: sys-apps/portage exits silently during updates when decompressor fails
Status: RESOLVED FIXED
Alias: None
Product: Portage Development
Classification: Unclassified
Component: Binary packages support (show other bugs)
Hardware: All Linux
: Normal normal (vote)
Assignee: Portage team
URL:
Whiteboard:
Keywords: InVCS
Depends on: 872710
Blocks:
  Show dependency tree
 
Reported: 2022-09-18 19:32 UTC by Michał Górny
Modified: 2022-10-01 03:00 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 Michał Górny archtester Gentoo Infrastructure gentoo-dev Security 2022-09-18 19:32:39 UTC
The symptom is roughly:

# emerge -v Levenshtein

Performing Global Updates
(Could take a couple of minutes if you have a lot of binary packages.)
  .='update pass'  *='binary update'  #='/var/db update'  @='/var/db move'
  s='/var/db SLOT move'  %='binary move'S='binary SLOT move'
  p='update /etc/portage/package.*'
/home/mgorny/git/gentoo/profiles/updates/3Q-2022..................

# echo $?
141


Upon strace()-ing it, I see:

[pid 46112] write(2, "--rm    : remove source file(s) "..., 65) = 65
[pid 46112] write(2, " -h/-H  : display help/long help"..., 43) = 43
[pid 46112] exit_group(1)               = ?
[pid 46113] <... read resumed>"", 32768) = 0
[pid 46112] +++ exited with 1 +++
[pid 46106] --- SIGCHLD {si_signo=SIGCHLD, si_code=CLD_EXITED, si_pid=46112, si_uid=0, si_status=1, si_utime=0, si_stime=0} ---
[pid 46113] futex(0x7f51c370a330, FUTEX_WAIT_BITSET_PRIVATE, 0, {tv_sec=2193, tv_nsec=114214782}, FUTEX_BITSET_MATCH_ANY <unfinished ...>
[pid 46106] futex(0x7f51c370a330, FUTEX_WAKE_PRIVATE, 1) = 1
[pid 46113] <... futex resumed>)        = 0
[pid 46106] write(5, "s x64-winnt x86 x86-linux x86-so"..., 10240 <unfinished ...>
[pid 46113] futex(0x7f51c370a338, FUTEX_WAKE_PRIVATE, 1 <unfinished ...>
[pid 46106] <... write resumed>)        = -1 EPIPE (Broken pipe)
[pid 46113] <... futex resumed>)        = 0
[pid 46106] --- SIGPIPE {si_signo=SIGPIPE, si_code=SI_USER, si_pid=46106, si_uid=0} ---
[pid 46113] +++ killed by SIGPIPE +++
+++ killed by SIGPIPE +++

(which is an error message from lz4, followed by SIGPIPE)

So apparently if decompressor spawned by Portage fails, it is hit with SIGPIPE and dies silently.
Comment 1 Sam James archtester Gentoo Infrastructure gentoo-dev Security 2022-09-25 01:49:20 UTC
See Alsoing bug 871573 as this is how it was hit ;)
Comment 2 Sheng Yu 2022-09-25 01:50:51 UTC
(In reply to Sam James from comment #1)
> See Alsoing bug 871573 as this is how it was hit ;)

I got it, fixing.
Comment 3 Sam James archtester Gentoo Infrastructure gentoo-dev Security 2022-09-25 01:54:25 UTC
(In reply to Sheng Yu from comment #2)
> (In reply to Sam James from comment #1)
> > See Alsoing bug 871573 as this is how it was hit ;)
> 
> I got it, fixing.

Thanks!
Comment 4 Larry the Git Cow gentoo-dev 2022-09-28 23:56:14 UTC
The bug has been referenced in the following commit(s):

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

commit b8c3f38ec5eec077e69451f1f3126999065ea132
Author:     Sheng Yu <syu.os@protonmail.com>
AuthorDate: 2022-09-25 04:29:55 +0000
Commit:     Sam James <sam@gentoo.org>
CommitDate: 2022-09-28 23:56:08 +0000

    Add more error handling for binpkgs
    
    And catch process Exception spawned by portage itself.
    e.g. bad decompress command.
    
    Bug: https://bugs.gentoo.org/871570
    Signed-off-by: Sheng Yu <syu.os@protonmail.com>
    Closes: https://github.com/gentoo/portage/pull/910
    Signed-off-by: Sam James <sam@gentoo.org>

 bin/gpkg-helper.py    | 12 +++++++++---
 bin/quickpkg          | 30 ++++++++++++++++++------------
 lib/_emerge/Binpkg.py | 34 ++++++++++++++++++++--------------
 lib/portage/gpkg.py   |  9 +++++++--
 4 files changed, 54 insertions(+), 31 deletions(-)
Comment 5 Larry the Git Cow gentoo-dev 2022-10-01 03:00:04 UTC
The bug has been closed via the following commit(s):

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

commit 00f62c1578506cb2d94b3ccf922cb40fa128387a
Author:     Sam James <sam@gentoo.org>
AuthorDate: 2022-10-01 02:59:09 +0000
Commit:     Sam James <sam@gentoo.org>
CommitDate: 2022-10-01 02:59:59 +0000

    sys-apps/portage: add 3.0.38
    
    Closes: https://bugs.gentoo.org/827974
    Closes: https://bugs.gentoo.org/864259
    Closes: https://bugs.gentoo.org/865115
    Closes: https://bugs.gentoo.org/871570
    Closes: https://bugs.gentoo.org/872392
    Closes: https://bugs.gentoo.org/872440
    Closes: https://bugs.gentoo.org/873088
    Signed-off-by: Sam James <sam@gentoo.org>

 sys-apps/portage/Manifest              |   1 +
 sys-apps/portage/portage-3.0.38.ebuild | 273 +++++++++++++++++++++++++++++++++
 2 files changed, 274 insertions(+)