You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The import audit incorrectly reports a guest import as absent when its sibling module exports the matching NID with a #library#module suffix and retains ELF section headers. The sectionless reader already resolves the same symbol. Normalize section-based export names at the first #, matching the import reader, sectionless reader, and relinker's GuestImageReader export handling.
The regression fixture audits consumer.prx importing NID#import#module against provider.prx exporting NID#export#module. It covers section headers, sectionless SysV hash and sectionless GNU hash, verifies the JSON provider and importing module, and checks that a different NID remains absent.
Windows 11 build 26200, AMD64, CPython 3.13.7. Python tooling only; no C++ compiler, GPU, title or homebrew execution was required or performed.
Same new regression against a separate untouched baseline source copy: fails for the section-header case (audit exit 1 instead of 0), with both sectionless controls passing.
Fixed regression: passes, including the unrelated-export negative control.
tools/tests/test_import_audit.py: 80 tests, 76 passed and 4 skipped, 2.830 seconds. Two POSIX permission checks are unavailable on Windows, symlink creation lacks privilege, and the existing source-stamp fixture was explicitly excluded because it creates a temporary Git commit. An external runner applied this skip without changing tracked tests.
git diff --check: passed.
python tools/check_conventions.py --base origin/main: passed on the committed change.
Checked main eea428ca855fb59a3edd394bab9abf99165590f1 and the complete 466-PR inventory with paginated changed-file lists. Each overlapping head was normalized onto that main with Git tree-only merges, then compared with main as the explicit merge base. No temporary commits were created. This branch merges cleanly with main. The four proposed changes also merge cleanly with one another.
#5713 changes Git stamping; #5571 changes out-of-file section-table fallback. Neither normalizes section-based export names. #5473 has no remaining common-base diff in the shared files.
Setup: head fcd477f merged into main at ff23657 (no conflicts), Linux, Python 3.14.8, clean environment (env -i, only HOME and PATH set). python3 -m unittest -v test_import_audit from tools/tests, 3 runs each.
with this PR: 3 of 3 runs pass (85 tests, 1 Windows-only test skipped).
with tools/import_audit.py put back to main's version (the PR's test changes kept): 3 of 3 runs fail, each time only at the layout='sections' subtest of test_module_export_suffix_is_stripped_with_and_without_sections.
The export path for ELFs with section headers now strips the # suffix, as main already did for section-less dynamic symbols and in elf_imports.
I did not check Windows or macOS.
Checked the one-line change in elf_exports against the other two readers (lines 145 and 208, same # split) and the new test: import_audit passes on the merged tree and fails with tools/import_audit.py reverted. The test covers section headers, sectionless SysV/GNU hash and a different-NID negative control. Also confirmed on Linux by @Dextroid17. Merging.
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
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.
What
The import audit incorrectly reports a guest import as absent when its sibling module exports the matching NID with a
#library#modulesuffix and retains ELF section headers. The sectionless reader already resolves the same symbol. Normalize section-based export names at the first#, matching the import reader, sectionless reader, and relinker'sGuestImageReaderexport handling.The regression fixture audits
consumer.prximportingNID#import#moduleagainstprovider.prxexportingNID#export#module. It covers section headers, sectionless SysV hash and sectionless GNU hash, verifies the JSON provider and importing module, and checks that a different NID remains absent.Branch:
fix/import-audit-export-suffixBaseline:
eea428ca855fb59a3edd394bab9abf99165590f1Tested commit:
fcd477faf8fd0b4959f927db1f36590b317fa2b7.Tested
Windows 11 build 26200, AMD64, CPython 3.13.7. Python tooling only; no C++ compiler, GPU, title or homebrew execution was required or performed.
tools/tests/test_import_audit.py: 80 tests, 76 passed and 4 skipped, 2.830 seconds. Two POSIX permission checks are unavailable on Windows, symlink creation lacks privilege, and the existing source-stamp fixture was explicitly excluded because it creates a temporary Git commit. An external runner applied this skip without changing tracked tests.git diff --check: passed.python tools/check_conventions.py --base origin/main: passed on the committed change.Reproducer:
python -m unittest tools.tests.test_import_audit.ImportAuditTests.test_module_export_suffix_is_stripped_with_and_without_sections -v.Open PR comparison
Checked main
eea428ca855fb59a3edd394bab9abf99165590f1and the complete 466-PR inventory with paginated changed-file lists. Each overlapping head was normalized onto that main with Git tree-only merges, then compared with main as the explicit merge base. No temporary commits were created. This branch merges cleanly with main. The four proposed changes also merge cleanly with one another.#5713 changes Git stamping; #5571 changes out-of-file section-table fallback. Neither normalizes section-based export names. #5473 has no remaining common-base diff in the shared files.
fd3c6796042ff61c599fa100a4e979a7be200658: clean pair preview. Shared files:tools/import_audit.py,tools/tests/test_import_audit.py.7ff22e76dc54f096f724381aef1a0c936b86cf9b: clean pair preview. Shared files:tools/import_audit.py,tools/tests/test_import_audit.py.4a7a38c43d8d2545584f72c10ac1614f8f74c311: clean pair preview. Shared files:tools/import_audit.py,tools/tests/test_import_audit.py.Checklist
main; no other open PR implements the same functionsNotImplemented_nid_no_patch); silent stubs are listed under Silent stubs in their library's technical debt file.mdfiles or images added to the repository (attach them to this PR)