Repository navigation
Conversation
glibc's ld.so(8) splits LD_PRELOAD on whitespace as well as colons and provides no escaping. When the ROCm install path contains a space (e.g. a pip venv in '/home/user/Documents/My research/.venv') every LD_PRELOAD entry is split at the space, generating one 'cannot preload' error per fragment and silently failing to load the library. Detect this before calling update_env and print a clear, actionable warning to stderr listing each affected path. The existing ROCP_TOOL_LIBRARIES route is unaffected by spaces and continues to deliver the tool library, so tracing still works today; the warning flags the incomplete preload so users know to move the venv to a space-free path. Fixes ROCm#13245 Signed-off-by: 0x5t4l1n <stalin.s@owasp.org>
Contributor
There was a problem hiding this comment.
Copilot wasn't able to review any files in this pull request. Check if the Files changed in this pull request are included in default exclusions.
✅ All Policy Checks Passed
📖 Need help? See the Policy FAQ for details on every check and how to fix failures. |
This branch has not been deployed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Fixes #13245.
rocprofv3buildsLD_PRELOADby joining library paths with colons. When the ROCm install directory contains a space (common with pip/venv installs in paths like/home/user/Documents/My research/.venv), glibc'sld.sosilently splits the entry at the space, generating four confusing "cannot preload" errors and failing to load the tool library through the preload route.Fix
Before calling
update_env("LD_PRELOAD", ...), check whether any path inprepend_preloadorappend_preloadcontains a space. If so, print a clear, actionable warning to stderr that:LD_PRELOADROCP_TOOL_LIBRARIESas a workaroundTracing still works today via the
ROCP_TOOL_LIBRARIESroute (which is unaffected by spaces). The warning ensures users understand the incomplete preload rather than seeing four opaque ld.so errors.