Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!

Bug 910376

Summary: env-update does not detect or report ldconfig failure
Product: Portage Development Reporter: Brandon Enright <dontspam>
Component: CoreAssignee: Portage team <dev-portage>
Status: RESOLVED FIXED    
Severity: normal CC: esigra, kfm, sam
Priority: Normal Keywords: InVCS
Version: unspecified   
Hardware: All   
OS: Linux   
See Also: https://github.com/gentoo/portage/pull/1068
Whiteboard:
Package list:
Runtime testing required: ---
Bug Depends on: 908971    
Bug Blocks:    

Description Brandon Enright 2023-07-15 03:16:28 UTC
I recently ran into an XFS bug on my system that causes ldconfig to abort() early:

epsilon ~ # ldconfig; echo $?
Aborted
134


However env-update does not properly check and propagate the return code for ldconfig and env-update silently fails without any indication to the user:

epsilon ~ # env-update; echo $?
>>> Regenerating /etc/ld.so.cache...
0


At a minimum I would expect env-update to return some error code. Even better would be to print a warning saying ldconfig failed and something is likely VERY WRONG on the system.

Using strace I confirmed env-update is running ldconfig and that ldconfig is failing and it's not being reported.

Tested on sys-apps/portage-3.0.46::gentoo with sys-libs/glibc-2.37-r3:2.2::gentoo
Comment 1 Sam James archtester Gentoo Infrastructure gentoo-dev Security 2023-07-15 07:28:22 UTC
For those who are curious, the XFS bug/original issue was discussed at https://forums.gentoo.org/viewtopic-t-1164198.html and has a great writeup there.
Comment 2 Larry the Git Cow gentoo-dev 2023-07-26 07:58:33 UTC
The bug has been referenced in the following commit(s):

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

commit 3bba408e214ae27bdf924ba90ad4b0919a85f3c8
Author:     Sam James <sam@gentoo.org>
AuthorDate: 2023-07-25 03:16:36 +0000
Commit:     Sam James <sam@gentoo.org>
CommitDate: 2023-07-26 07:58:30 +0000

    lib: env_update: port to subprocess
    
    os.system is a bit janky here, let's use subprocess so we're not injecting
    multiple commands.
    
    Thanks to mgorny for the suggestion.
    
    Bug: https://bugs.gentoo.org/910376
    Signed-off-by: Sam James <sam@gentoo.org>

 lib/portage/util/env_update.py | 24 +++++++++++++++---------
 1 file changed, 15 insertions(+), 9 deletions(-)

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

commit 3da0ff3d2dd47469becd80e744c0c3ced448a516
Author:     Sam James <sam@gentoo.org>
AuthorDate: 2023-07-15 08:16:45 +0000
Commit:     Sam James <sam@gentoo.org>
CommitDate: 2023-07-26 07:58:30 +0000

    lib: env_update: check ldconfig exit code
    
    Bug: https://bugs.gentoo.org/910376
    Signed-off-by: Sam James <sam@gentoo.org>

 NEWS                           |  2 ++
 lib/portage/util/env_update.py | 13 ++++++++++---
 2 files changed, 12 insertions(+), 3 deletions(-)
Comment 3 Larry the Git Cow gentoo-dev 2023-08-09 02:57:27 UTC
The bug has been closed via the following commit(s):

https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=858dfd771ac4c6c9315ac5851f4aeeb233fc21d5

commit 858dfd771ac4c6c9315ac5851f4aeeb233fc21d5
Author:     Sam James <sam@gentoo.org>
AuthorDate: 2023-08-09 02:54:12 +0000
Commit:     Sam James <sam@gentoo.org>
CommitDate: 2023-08-09 02:54:12 +0000

    sys-apps/portage: add 3.0.50
    
    Closes: https://bugs.gentoo.org/908971
    Closes: https://bugs.gentoo.org/640658
    Closes: https://bugs.gentoo.org/894398
    Closes: https://bugs.gentoo.org/895908
    Closes: https://bugs.gentoo.org/909067
    Closes: https://bugs.gentoo.org/909148
    Closes: https://bugs.gentoo.org/909853
    Closes: https://bugs.gentoo.org/910035
    Closes: https://bugs.gentoo.org/910376
    Closes: https://bugs.gentoo.org/911594
    Closes: https://bugs.gentoo.org/911574
    Signed-off-by: Sam James <sam@gentoo.org>

 sys-apps/portage/Manifest              |   1 +
 sys-apps/portage/portage-3.0.50.ebuild | 229 +++++++++++++++++++++++++++++++++
 2 files changed, 230 insertions(+)