test(libSceFreeType): leave a valid autofitter default script set #13512
Loading…
Reference in a new issue
No description provided.
Delete branch "upstream-pr/13512"
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 jotitadev on 2026-10-30T17:23:55Z.
What
GuestFreeTypeModulePropertiessets the autofitterdefault-scriptto999and0xFFFFFFFFlast. FreeType stores anydefault-scriptvalue without validating it, so the native and the guest libraries both keep0xFFFFFFFF. The per-faceincrease-x-heightqueries added in #12668 then build the face globals with it:af_face_globals_compute_style_coveragefinds no style for that script, keepsdflt = 0xFFFFand readsaf_style_classes[0xFFFF], past the 88-entry table. It passes in normal builds only because the HarfBuzz-lessaf_shaper_get_coverageignores the style class it gets.Under ASan+UBSan both tests stop there:
The loop now tries the invalid values first and ends on a valid script, so every value is still compared against native FreeType. Test only; the adapter is unchanged. The nightly sanitizer run does not show this yet because
guest_freetype_*are "Not Run" there until #12894 lets the ASan build finish.Tested
Linux (Ubuntu 26.04, GCC 15.2, i7-8700), main
9f748f4d8e, with #12894 applied locally so the ASan build completes:-DANYPS5_ENABLE_ASAN=ON,-fsanitize=undefined -fno-sanitize-recover=undefined -fno-sanitize=vptr, RelWithDebInfo),UBSAN_OPTIONS=halt_on_error=1:guest_freetype_module_propertiesand_nidfail on main with the report above and pass with this change (5 repeats). The rest of the non-GPU suite (1833 tests) had no other sanitizer report.check_conventions.pyandgit diff --checkpass.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
Imported from boykopovar/AnyPS5. Originally posted by MarcZX10 on 2026-10-30T17:29:22Z.
Review: APPROVED
Reviewed — looks good
The reordered test still checks both invalid script values against native FreeType and leaves a valid default script selected before the later face-property queries.
What I ran
Reviewed head
c1aff9498d1519fefb3f2a5906e6d8bdbdd1fabcagainst base6a3afa4deb18ea58a90efb8040fff8c60e4f2aab; the exact-head merge preview is clean. Environment: Linux x86_64, Python 3.11.2, Git 2.39.5. No compiler or C++ test binary was run locally.Results
ModuleProperties.cmakeregistersguest_freetype_module_propertiesand_nid; this is a false positive.mainwith an out-of-bounds style-table access. The author reports applying #12894 locally to make the sanitizer build complete. I did not reproduce these runs.Unedited output from local checks
git diff --checkexited 0 and emitted no output.The local heuristic rerun returned:
Sources
default-scriptwithout range validationaf_style_classesusing the selected default-script indexNot verified
I did not build or run the tests locally, independently reproduce the sanitizer failure or fix, verify the author's reported base commit, or run Windows or console tests. The reported sanitizer run used #12894 applied locally; that PR remains open.