Gentoo Archives: gentoo-dev

From: Sam James <sam@g.o>
To: gentoo-dev@l.g.o
Cc: toolchain@g.o, pr@g.o, Sam James <sam@g.o>, Hank Leininger <hlein@×××××××××.com>
Subject: [gentoo-dev] [PATCH] 2021-09-24-possible-failure-to-preserve-libraries: add item
Date: Mon, 20 Sep 2021 21:19:45
Message-Id: 20210920211845.1930150-1-sam@gentoo.org
1 Bug: https://bugs.gentoo.org/811462
2 Signed-off-by: Hank Leininger <hlein@×××××××××.com>
3 Signed-off-by: Sam James <sam@g.o>
4 ---
5 ...sible-failure-to-preserve-libraries.en.txt | 98 +++++++++++++++++++
6 1 file changed, 98 insertions(+)
7 create mode 100644 2021-09-24-possible-failure-to-preserve-libraries/2021-09-24-possible-failure-to-preserve-libraries.en.txt
8
9 diff --git a/2021-09-24-possible-failure-to-preserve-libraries/2021-09-24-possible-failure-to-preserve-libraries.en.txt b/2021-09-24-possible-failure-to-preserve-libraries/2021-09-24-possible-failure-to-preserve-libraries.en.txt
10 new file mode 100644
11 index 0000000..00a209d
12 --- /dev/null
13 +++ b/2021-09-24-possible-failure-to-preserve-libraries/2021-09-24-possible-failure-to-preserve-libraries.en.txt
14 @@ -0,0 +1,98 @@
15 +Title: Possible failure to preserve libraries
16 +Author: Sam James <sam@g.o>
17 +Author: Hank Leininger <hlein@×××××××××.com>
18 +Posted: 2021-09-24
19 +Revision: 1
20 +News-Item-Format: 2.0
21 +Display-If-Installed: sys-apps/portage
22 +
23 +Possible inconsistency of Portage's internal database (VDB) has been
24 +observed in some cases, usually when glibc has been upgraded to a new
25 +major version, but pax-utils has not yet been upgraded to a version
26 +compatible with it.
27 +
28 +The full technical details and investigation can be found on a Wiki page
29 +[0] and on Bugzilla [1]. Work is underway to prevent this happening
30 +again both within Portage [2] (possibly more to come) and within the
31 +glibc and pax-utils ebuilds [3][4].
32 +
33 +To detect whether a system is affected, emerge the
34 +app-portage/recover-broken-vdb package:
35 +```
36 +$ emerge --ask --verbose --oneshot app-portage/recover-broken-vdb
37 +```
38 +which provides two tools: recover-broken-vdb-find-broken.sh and
39 +recover-broken-vdb.
40 +
41 +Then run recover-broken-vdb-find-broken.sh:
42 +```
43 +$ recover-broken-vdb-find-broken.sh | tee broken_vdb_packages
44 +```
45 +
46 +It is recommended that this check be run on all Gentoo systems.
47 +
48 +If you have any output, read on.
49 +
50 +Fixing a broken system is not always straightforward. It is strongly
51 +recommended to take a backup of your full system before proceeding,
52 +as well as a copy of /var/db/pkg (the VDB):
53 +
54 +1. A tool has been developed [5] to attempt to fix the consistency
55 + of the Portage database. Using this tool is NOT mandatory
56 + (read the full news item before proceeding) - you can skip
57 + to Step 2 if you wish, but fixing the integrity of the VDB
58 + makes it as safe as reasonably possible to proceed with
59 + rebuilding packages.
60 +
61 + Run:
62 + ```
63 + # Take a backup of /var/db/pkg before proceeding, such as by doing:
64 + $ cp /var/db/pkg /var/db/pkg.orig
65 +
66 + # And then:
67 + $ emerge --ask --verbose --oneshot --noreplace \
68 + app-portage/recover-broken-vdb
69 +
70 + $ recover-broken-vdb
71 +
72 + # The tool will output to a random temporary directory.
73 + # Inspect the results, and then update the real /var/db/pkg/
74 + # by doing either:
75 +
76 + $ recover-broken-vdb --output /var/db/pkg
77 +
78 + # Or, manually copying the new files from the temporary directory tree
79 + # into your real /var/db/pkg/ directory tree.
80 + ```
81 +
82 + If you choose not to use this recovery tool, please re-emerge
83 + the affected packages (next step) and then -e @world, but
84 + there is more risk attached if not all packages can
85 + be rebuilt at their current versions.
86 +
87 +2. Attempt to rebuild the affected packages, first upgrading
88 + app-portage/pax-utils to the latest version:
89 + ```
90 + $ emerge --ask --verbose --oneshot ">=app-misc/pax-utils-1.3.3"
91 + $ emerge --ask --verbose --oneshot $(cat broken_vdb_packages)
92 + ```
93 +
94 +Given that there are possible other side-effects of the corruption/bug,
95 +it is strongly recommended that if any corruption is detected, all
96 +packages on the system should be rebuilt, after following the above
97 +steps:
98 +```
99 +$ emerge --ask --emptytree @world
100 +```
101 +
102 +Please see the wiki [0] for a full description of the background
103 +of this problem and handling corner cases such as e.g. already
104 +being affected by system breakage [6] as a result of the bug.
105 +
106 +[0] https://wiki.gentoo.org/wiki/Project:Toolchain/Corrupt_VDB_ELF_files
107 +[1] https://bugs.gentoo.org/811462
108 +[2] https://github.com/gentoo/portage/pull/744
109 +[3] https://bugs.gentoo.org/811462#c6
110 +[4] https://bugs.gentoo.org/811462#c7
111 +[5] https://github.com/thesamesam/recover-broken-vdb
112 +[6] https://wiki.gentoo.org/wiki/Fix_my_Gentoo
113 --
114 2.33.0