Skip to content

Conversation

@elezar
Copy link
Member

@elezar elezar commented Nov 11, 2025

This change fixes the update of the ldcache when running a non-debian (including ubuntu) container on a debian-like system. Here the ldcache in the container does not initially include system libraries from /lib64 or /usr/lib64 since this ldconfig from the host that is executed in the container's namespace does not process those paths by default.

This is related to #1403 and will need to be updated once that is merged since we would also need to NOT include lib64 and /usr/lib64 in the list of folders if it's already present in the config folders for some reason.

Testing

The expected behaviour when using runc directly:

$ docker run --rm --runtime=runc redhat/ubi9 bash -c "ldconfig -p | grep libc.so."
        libc.so.6 (libc6,AArch64, OS ABI: Linux 3.7.0) => /lib64/libc.so.6

The current behaviour:

$ docker run --rm --runtime=nvidia -e NVIDIA_VISIBLE_DEVICES=all redhat/ubi9 bash -c "ldconfig -p | grep libc.so."

(note that libc.so.6 is not present in the ldcache since /lib64 (linked to /usr/lib64) is not processed).

The updated behaviour:

$ docker run --rm --runtime=nvidia -e NVIDIA_VISIBLE_DEVICES=all redhat/ubi9 bash -c "ldconfig -p | grep libc.so."
        libc.so.6 (libc6,AArch64, OS ABI: Linux 3.7.0) => /lib64/libc.so.6

@elezar elezar added this to the v1.18.1 milestone Nov 11, 2025
@elezar
Copy link
Member Author

elezar commented Nov 11, 2025

/cherry-pick release-1.18

Copy link
Contributor

@cdesiniotis cdesiniotis left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I left a couple of comments / questions, but no blockers.

if len(args) < 1 {
return nil, fmt.Errorf("incorrect arguments: %v", args)
}
fs := flag.NewFlagSet(args[1], flag.ExitOnError)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Question -- is args[1] the right name to give to this flag set? What about something along the lines of ldconfig-options?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You're right. This was definitely a copy-paste error on my part.

@elezar elezar force-pushed the fix-ldcache-update-on-non-debian branch from a854d3d to 2794eaa Compare November 14, 2025 09:34
This change ensures that the ldcache in a non-debian container
includes libraries at /lib64 and /usr/lib64 when running on
debian host. This is required because the system search paths
do not include these folders by default resulting in a non-debian
container missing system libraries from the ldcache.

Signed-off-by: Evan Lezar <[email protected]>
@elezar elezar force-pushed the fix-ldcache-update-on-non-debian branch from 2794eaa to 0b28791 Compare November 14, 2025 10:49
func (l *Ldconfig) getSystemSerachPaths() []string {
func (l *Ldconfig) getSystemSearchPaths() []string {
if l.isDebianLikeContainer {
debianSystemSearchPaths()
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I've been debugging issues on my homelab cluster with the latest CTK release, and I just spotted this code here. I think it's missing a return. I can send a PR for the existing code, or we can roll that fix into this PR.

Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

See #1457

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants