Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 925714 - Signals should be blocked on package updates
Summary: Signals should be blocked on package updates
Status: CONFIRMED
Alias: None
Product: Portage Development
Classification: Unclassified
Component: Core (show other bugs)
Hardware: All Linux
: Normal normal
Assignee: Portage team
URL:
Whiteboard:
Keywords:
Depends on:
Blocks: 910332 925715
  Show dependency tree
 
Reported: 2024-02-28 15:47 UTC by Sam James
Modified: 2024-02-28 16:06 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 Sam James archtester Gentoo Infrastructure gentoo-dev Security 2024-02-28 15:47:34 UTC
If package updates (renames etc) are interrupted, we sometimes end up with weird errors:

```
# emerge --sync
[...]
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.*'
/var/db/repos/gentoo/profiles/updates/1Q-2024........................................................................................
/var/db/repos/gentoo/profiles/updates/4Q-2020........
/var/db/repos/gentoo/profiles/updates/4Q-2022..........
/var/db/repos/gentoo/profiles/updates/1Q-2020..........
/var/db/repos/gentoo/profiles/updates/1Q-2023.......................
/var/db/repos/gentoo/profiles/updates/4Q-2023..........................................
/var/db/repos/gentoo/profiles/updates/2Q-2023...............................
/var/db/repos/gentoo/profiles/updates/4Q-2021........................................................................
@!!! Cannot update binary: Destination exists.
!!! sys-kernel/installkernel-gentoo-7 -> sys-kernel/installkernel-7
%@%@^C

Exiting on signal 2
```

# emaint all -f
Error reading binpkg '/var/cache/binpkgs/dev-perl/SGMLSpm/SGMLSpm-1.1-r2-7.gpkg.tar': [Errno 22] Invalid argument!!! Invalid binary package: '/var/cache/binpkgs/dev-perl/SGMLSpm/SGMLSpm-1.1-r2-7.gpkg.tar', Error reading binpkg '/var/cache/binpkgs/dev-perl/SGMLSpm/SGMLSpm-1.1-r2-7.gpkg.tar': [Errno 22] Invalid argument
Emaint: fix binhost             [<=>                                          ]Error reading binpkg '/var/cache/binpkgs/dev-perl/SGMLSpm/SGMLSpm-1.1-r2-7.gpkg.tar': [Errno 22] Invalid argument!!! Invalid binary package: '/var/cache/binpkgs/dev-perl/SGMLSpm/SGMLSpm-1.1-r2-7.gpkg.tar', Error reading binpkg '/var/cache/binpkgs/dev-perl/SGMLSpm/SGMLSpm-1.1-r2-7.gpkg.tar': [Errno 22] Invalid argument
Emaint: fix binhost        100% [============================================>]
Emaint: fix cleanconfmem   100% [============================================>]
Emaint: fix cleanresume    100% [============================================>]

'sys-libs/glibc-2.35-r7' does not exist in the ebuild repository.


Emaint: fix movebin             [ <=>                                         ]!!! Cannot update binary: Destination exists.
!!! sys-kernel/installkernel-gentoo-7 -> sys-kernel/installkernel-7
Emaint: fix movebin             [    <=>
```

(The missing newlines are a different problem.)

We should probably block signals here given it's a critical point, although it's also quite slow, so maybe it's not a great idea?
Comment 1 Larry the Git Cow gentoo-dev 2024-02-28 15:49:19 UTC
The bug has been referenced in the following commit(s):

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

commit f070275fe05d5053c3756ebb5d0a602db8ba515d
Author:     Sam James <sam@gentoo.org>
AuthorDate: 2024-02-28 15:48:48 +0000
Commit:     Sam James <sam@gentoo.org>
CommitDate: 2024-02-28 15:49:16 +0000

    binpkg: add another missing newline to error message
    
    ```
    Error reading binpkg '/var/cache/binpkgs/dev-perl/SGMLSpm/SGMLSpm-1.1-r2-7.gpkg.tar': [Errno 22] Invalid argument!!! Invalid binary package: '/var/cache/binpkgs/dev-perl/SGMLSpm/SGMLSpm-1.1-r2-7.gpkg.tar', Error reading binpkg '/var/cache/binpkgs/dev-perl/SGMLSpm/SGMLSpm-1.1-r2-7.gpkg.tar': [Errno 22] Invalid argument
    ```
    
    Bug: https://bugs.gentoo.org/925714
    Signed-off-by: Sam James <sam@gentoo.org>

 lib/portage/binpkg.py | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
Comment 2 Sam James archtester Gentoo Infrastructure gentoo-dev Security 2024-02-28 16:06:09 UTC
(In reply to Sam James from comment #0)
> If package updates (renames etc) are interrupted, we sometimes end up with
> weird errors:
>
> We should probably block signals here given it's a critical point, although
> it's also quite slow, so maybe it's not a great idea?

to be clear, I don't mind at all if we think this is a bad idea. It's just been on my mind so wanted to file something over it.