Repository navigation
gh-160388: Load the copied library in the deleted-mapping test - #160396
Merged
Merged
Conversation
zanieb
marked this pull request as ready for review
October 22, 2026 23:19
This was referenced Oct 22, 2026
itamaro
approved these changes
Oct 23, 2026
itamaro
left a comment
Contributor
There was a problem hiding this comment.
why cpython itself doesn't (currently) set RPATH (so doesn't suffer from this issue), this fix doesn't regress anything for cpython itself, while making it easier to test by downstream distributors that do set RPATH. this change also makes the behavior consistent under glibc and musl when RPATH is set, because LD_PRELOAD would always win (although potentially loading two copies under musl), while LD_LIBRARY_PATH wins over RPATH only under musl.
|
GH-160515 is a backport of this pull request to the 3.15 branch. |
|
GH-160516 is a backport of this pull request to the 3.14 branch. |
itamaro
pushed a commit
that referenced
this pull request
Oct 23, 2026
…GH-160396) (#160515) gh-160388: Load the copied library in the deleted-mapping test (GH-160396) The deleted-`libpython` mapping test uses `LD_LIBRARY_PATH` to load a temporary copy of the library. On glibc, an interpreter's `DT_RPATH` can take precedence and load a different copy, so the test fails because the temporary copy was not mapped. Preload the temporary library explicitly so the subprocess maps the file that the test removes. Create the copy beneath the working directory and preload it through a relative path, since `LD_PRELOAD` treats spaces and colons as separators. (cherry picked from commit 3a440b6) Co-authored-by: Zanie Blue <contact@zanie.dev>
itamaro
pushed a commit
that referenced
this pull request
Oct 23, 2026
…GH-160396) (#160516) gh-160388: Load the copied library in the deleted-mapping test (GH-160396) The deleted-`libpython` mapping test uses `LD_LIBRARY_PATH` to load a temporary copy of the library. On glibc, an interpreter's `DT_RPATH` can take precedence and load a different copy, so the test fails because the temporary copy was not mapped. Preload the temporary library explicitly so the subprocess maps the file that the test removes. Create the copy beneath the working directory and preload it through a relative path, since `LD_PRELOAD` treats spaces and colons as separators. (cherry picked from commit 3a440b6) Co-authored-by: Zanie Blue <contact@zanie.dev>
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.
The deleted-
libpythonmapping test usesLD_LIBRARY_PATHto load a temporary copy of the library. On glibc, an interpreter'sDT_RPATHcan take precedence and load a different copy, so the test fails because the temporary copy was not mapped. Preload the temporary library explicitly so the subprocess maps the file that the test removes. Create the copy beneath the working directory and preload it through a relative path, sinceLD_PRELOADtreats spaces and colons as separators.Fixes #160388.
test_remote_exec_deleted_libpythoncan fail whenDT_RPATHselectslibpython#160388