refactor(libharfbuzz): report guest-input throws as faults #28912
Loading…
Reference in a new issue
No description provided.
Delete branch "upstream-pr/28912"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Imported from boykopovar/AnyPS5. Originally posted by LODIBIDO on 2026-12-04T15:36:34Z.
What
Six libharfbuzz exports forward every valid input to the pinned HarfBuzz 10.0.1 but still reached
NotImplemented_nid_no_patchon guest-input paths: null handles, unreadable or unwritable guest pointers and buffers, a foreign or finalized FreeType face, a null blob with a nonzero length, or an out-of-range memory mode. Cairo-style, these are inputs the console module itself dereferences, so this moves the 22 sites toGuestFault_nid_no_patch(#28739).tools/progress.pycounts it as a throw, so libharfbuzz goes from 30 of 37 on currentmainto 36 of 37.This reproduces part of the closed #23897 by monika-runtime (credited as co-author) on current
main, now that theGuestFault_nid_no_patchhelper has merged; it is part of #23391's per-library migration, which the maintainers invited as separate PRs. The seventh export,hb_icu_get_unicode_funcs, is left to the open #28781.Sites and their justification, checked against
3rdparty/harfbuzzat the pinned 10.0.1 commit:Export.cpphb_ft_face_create_cached(6): null face (hb-ft.ccdereferencesft_face->generic/stream), unreadable guest record, a record without a live AnyPS5 FreeType owner (foreign layout), unreadable owner fields or a null/finalized host face (releasedFT_Face), and the two unwritablegenericcopies.Shaping.cpphb_shape(3): null buffer (hb-shape.ccreadsbuffer->len), null font or a null feature array of nonzero length (nullhb_memcpysource inhb-shape-plan.cc), and an unreadable feature array.Lifecycle.cpphb_blob_create(1): null data with a nonzero length below 2 GiB (stored and later read), and an out-of-range memory mode (out-of-range enum conversion, no upstream behaviour). A length of 2 GiB or more is upstream-rejected and is not faulted.Layout.cpp(12): null faces, unreadable caller counts, a null tag array with a nonzero count, and the host-write bracket and later writes over unwritable count/tag/index buffers. A nullcountorindexis documented as optional and is not faulted.No control flow changes; the same inputs throw at the same points. The
docs/dev/debt/libharfbuzz.mdentries already describe these as throwing in place of upstream undefined behaviour, so no fragment is added.Tested
Native Intel Mac (x86_64, macOS 15.7.8, Apple clang 17.0.0), Release, with the diffs of #27201 and #27767 applied locally.
ctest -R 'harfbuzz': 19 of 19 passed (the existingguest_harfbuzz_shapetest already exercises the fourhb_shapefault inputs and still counts four throws).tools/progress.py --compare:libharfbuzz30 to 36 of 37; no other library changes.tools/check_conventions.pyandtools/debt_fold.py --check: pass.Not tested: Windows, Linux, console.
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)🤖 Generated with Claude Code
Summary by CodeRabbit
Imported from boykopovar/AnyPS5. Originally posted by MarcZX10 on 2026-12-04T16:34:51Z.
Review: APPROVED
Reviewed — looks good
The reviewed change consistently reports the identified guest-input failures as guest faults, and I found no blocking defects.
What I ran
Reviewed head
32f2923f2396a5ecbb3c2e34126e7da4b055fea2; no merged-preview check or tests were run. I read all four changed files listed underreviewedinfiles.json;files.jsonlists no excluded files.The reader search printed matching lines but returned an error while trying to write its call log in the read-only review folder.
Results
Negative control
Not run; no tests were run.
Findings
Blocking
None.
Non-blocking
None.
Sources
Not verified
Tests, Windows and Linux behavior, and console behavior were not verified. The description reports native Intel Mac test results; I did not run those checks.
To get this to a good state
Nothing is required.
View command line instructions
Checkout
From your project repository, check out a new branch and test the changes.Merge
Merge the changes and update on Forgejo.Warning: The "Autodetect manual merge" setting is not enabled for this repository, you will have to mark this pull request as manually merged afterwards.