Gentoo Archives: gentoo-dev

From: Sam James <sam@g.o>
To: gentoo-dev@l.g.o
Cc: pr@g.o, toolchain@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: Tue, 21 Sep 2021 01:51:25
Message-Id: 20210921015057.2091044-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 | 103 ++++++++++++++++++
6 1 file changed, 103 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..4b4758b
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,103 @@
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 +While this largely only affects users of Portage's FEATURES="preserve-libs",
29 +it also affects those who may choose to use it in future given the database
30 +is corrupt even if certain files are not being used for preserving libraries
31 +at present.
32 +
33 +The full technical details and investigation can be found on a Wiki page
34 +[0] and on Bugzilla [1]. Work is underway to prevent this happening
35 +again both within Portage [2] (possibly more to come) and within the
36 +glibc and pax-utils ebuilds [3][4].
37 +
38 +To detect whether a system is affected, emerge the
39 +app-portage/recover-broken-vdb package:
40 +```
41 +$ emerge --ask --verbose --oneshot app-portage/recover-broken-vdb
42 +```
43 +which provides two tools: recover-broken-vdb-find-broken.sh and
44 +recover-broken-vdb.
45 +
46 +Then run recover-broken-vdb-find-broken.sh:
47 +```
48 +$ recover-broken-vdb-find-broken.sh | tee broken_vdb_packages
49 +```
50 +
51 +It is recommended that this check be run on all Gentoo systems.
52 +
53 +If you have any output, read on.
54 +
55 +Fixing a broken system is not always straightforward. It is strongly
56 +recommended to take a backup of your full system before proceeding,
57 +as well as a copy of /var/db/pkg (the VDB):
58 +
59 +1. A tool has been developed [5] to attempt to fix the consistency
60 + of the Portage database. Using this tool to modify the VDB is NOT
61 + mandatory (read the full news item before proceeding) - you can skip
62 + to Step 2 if you wish, but fixing the integrity of the VDB
63 + makes it as safe as reasonably possible to proceed with
64 + rebuilding packages.
65 +
66 + Run:
67 + ```
68 + # Take a backup of /var/db/pkg before proceeding, such as by doing:
69 + $ cp /var/db/pkg /var/db/pkg.orig
70 +
71 + # And then:
72 + $ emerge --ask --verbose --oneshot --noreplace \
73 + app-portage/recover-broken-vdb
74 +
75 + $ recover-broken-vdb
76 +
77 + # The tool will output to a random temporary directory.
78 + # Inspect the results, and then update the real /var/db/pkg/
79 + # by doing either:
80 +
81 + $ recover-broken-vdb --output /var/db/pkg
82 +
83 + # Or, manually copying the new files from the temporary directory tree
84 + # into your real /var/db/pkg/ directory tree.
85 + ```
86 +
87 + If you choose not to use this recovery tool, please re-emerge
88 + the affected packages (next step) and then -e @world, but
89 + there is more risk attached if not all packages can
90 + be rebuilt at their current versions.
91 +
92 +2. Attempt to rebuild the affected packages, first upgrading
93 + app-portage/pax-utils to the latest version:
94 + ```
95 + $ emerge --ask --verbose --oneshot ">=app-misc/pax-utils-1.3.3"
96 + $ emerge --ask --verbose --oneshot $(cat broken_vdb_packages)
97 + ```
98 +
99 +Given that there are possible other side-effects of the corruption/bug,
100 +it is strongly recommended that if any corruption is detected, all
101 +packages on the system should be rebuilt, after following the above
102 +steps:
103 +```
104 +$ emerge --ask --emptytree @world
105 +```
106 +
107 +Please see the wiki [0] for a full description of the background
108 +of this problem and handling corner cases such as e.g. already
109 +being affected by system breakage [6] as a result of the bug.
110 +
111 +[0] https://wiki.gentoo.org/wiki/Project:Toolchain/Corrupt_VDB_ELF_files
112 +[1] https://bugs.gentoo.org/811462
113 +[2] https://github.com/gentoo/portage/pull/744
114 +[3] https://bugs.gentoo.org/811462#c6
115 +[4] https://bugs.gentoo.org/811462#c7
116 +[5] https://github.com/thesamesam/recover-broken-vdb
117 +[6] https://wiki.gentoo.org/wiki/Fix_my_Gentoo
118 --
119 2.33.0