Repository navigation
fix(libcairo): propagate FreeType error font faces - #27755
Conversation
|
No actionable comments were generated in the recent review. Walkthrough
Change: Bug fix Merge Risk:
|
|
Independent Linux check on exact head I also ran the same probe executable against both builds and failed exactly one nonthrowing allocation while creating a FreeType guest face through |
MarcZX10
left a comment
There was a problem hiding this comment.
Reviewed — looks good
Nothing blocks this change; the review evidence supports merging.
What I ran
Reviewed head fa082443ce4d05d3e279571f99d9fcfee21057b2 using the prepared diff and repo_read.py source reads. No test commands were run.
Results
| Check | Result | Note |
|---|---|---|
| Changed code review | passed | Three changed files read |
| Automated tests | not run | Only author-reported test results available |
Findings
Blocking
None.
Non-blocking
None.
Not verified
core/libs/prx/libcairo/FontFace.cpp, core/libs/tests/GuestCairoFtFontFace.cpp, and docs/dev/debt/changes/feat-libcairo-font-pipeline.md were read in full. files.json was not available as a review-folder document; the reader's file listing confirms all three changed files are included and read. The Cairo backend source, build, tests, and console behavior were not independently verified. The description reports 41 passing guest Cairo tests and a standalone Cairo 1.18.0 check; these were not run in this review.
To get this to a good state
Nothing is required.
PrivacyOnion
left a comment
There was a problem hiding this comment.
Verified on Linux (Ubuntu 24.04, GCC 13.3, Ninja, Release) against fa082443ce:
- Conventions:
tools/check_conventions.pypassed. - Build:
guest_cairo_ft_font_face_testsbuilt cleanly. - CTest (
guest_cairo_ft_font_face):1/1 Test #6245: guest_cairo_ft_font_face ......... Passed 0.02 sec 100% tests passed, 0 tests failed out of 1 - Negative control: with
core/libs/prx/libcairo/FontFace.cppreverted tomainand the new tests kept, the suite fails:Restoring the change makes it pass again.1/1 Test #6245: guest_cairo_ft_font_face .........Subprocess aborted***Exception: 0.51 sec 0% tests passed, 1 tests failed out of 1 - Code reading:
- Verified that CairoFontFaceFromBackend_nid_no_patch correctly handles both _cairo_font_face_nil and _cairo_font_face_nil_file_not_found before taking BackendMutex, preventing map allocations for upstream error faces
- Checked lifetime and reference semantics in CairoFontFaceNilNoMemory and CairoFontFaceNilFileNotFound, ensuring .immortal = true and correct .backend pointers are retained across reference/destroy operations
- Verified that CairoFontFaceBackend_nid_no_patch safely returns the upstream nil backend pointers when passed error faces, enabling propagation to downstream consumers like cairo_scaled_font_create and cairo_set_font_face
- Checked GuestCairoFtFontFace.cpp test logic to confirm it verifies status 18 propagation to scaled fonts and contexts, preserves the initial error on subsequent assignments, and cleans up all allocated test objects
- Verified AGENTS.md conventions, debt fragment format in feat-libcairo-font-pipeline.md, and absence of undocumented stubs or comments
Looks Good To Me
Plyxen
left a comment
There was a problem hiding this comment.
Checked head fa082443ce. All on Windows 11 with WinLibs GCC 15.2 (Release), applied to main a163d4b886 together with #27930, #27929, #27926, #27925, #27924, #27923, #27922, #27901, #27828, #27771, #27748, #27682, #27765. tools/check_conventions.py --head and tools/debt_fold.py --check passed and the full build succeeded. guest_cairo_ft_font_face passes. In the full CPU suite (5,120 tests) the only failures are unrelated:
windows_read_trap_unknownfails onmaintoo (fixed in #28028).frame_capture_minimize,jpeg_external_toolchainandguest_pthread_mutex_contentionare timeouts under load; they pass when run on their own.guest_audio_in_capturepasses 20/20 onmainand with #27922.
AI-assisted: yes (Claude Code)
|
Windows result for head Host: Windows 11 26300, Intel i7-12700K, WinLibs GCC 15.2.0 (x86_64-ucrt-posix-seh, r6), Release,
AI-assisted: yes (Claude Code), the runs and the numbers above are from this machine. |
ligmaSec
left a comment
There was a problem hiding this comment.
The Linux guest_cairo_ft_font_face CTest passed with the patch. The fixture checks that a FreeType failure yields a Cairo error face with the expected status, alongside the normal FreeType font-face path.
AI-assisted: yes.
What
Carry the pinned Cairo backend’s file-not-found and no-memory font faces through the guest font-face bridge. A missing file in a Fontconfig pattern now gives
cairo_scaled_font_createan error font and sets the same error on a healthy context passed tocairo_set_font_face. The error objects retain their guest identity and require no allocation.Tested
On Ubuntu 24.04.4 x86-64, the new missing-file regression failed on the base commit with
cairo_scaled_font_create not implemented. All 41 tests inctest --test-dir build -R '^guest_cairo_' --output-on-failurepassed with the change. The test checks the scaled font status, the context error through its target, and preservation of the first context error. A separate program using Cairo 1.18.0 returnedCAIRO_STATUS_FILE_NOT_FOUND(18) for the face, scaled font and context.python3 tools/check_conventions.pypassed. The standalonetools/debt_fold.py --checkreports the same two conflicting shader debt fragments on both the base and the branch.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)Summary by CodeRabbit