fix(libcairo): fault null surfaces that Cairo dereferences #28910
Loading…
Reference in a new issue
No description provided.
Delete branch "upstream-pr/28910"
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:26:15Z.
What
Moves the two null-surface rejections in
core/libs/prx/libcairo/Surface.cpptoGuestFault_nid_no_patch(#28739). Part of #23391, same approach as #23881 (Matrix.cpp) and #28898 (Context.cpp).Basis: Sony publishes Cairo source for the PS5 as one archive per system software range;
docs/dev/debt/libcairo.mdrecords that these exports run Cairo 1.18.0 on PS5 9.00 and later.cairo_surface_create_similar: Cairo readsother->statuson its first line, before the width, height and content checks, so a nullotherfaults regardless of the other arguments.cairo_surface_create_for_rectangle: Cairo checkswidth < 0 || height < 0first and returns an error surface, then readstarget->status. A nulltargetfaults only when width and height are both non-negative; with a negative width or height the call reaches Cairo and returns an error surface without the dereference. The rejection now matches that order.cairo_set_dashstill throwsNotImplemented_nid_no_patchfor null dashes with a positive count, and is unchanged.Console behaviour is not measured. No title is known to be unblocked.
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.
guest_cairo_surfacepassed 5 of 5 runs.CheckNullFaultswithSurface.cppfrommainaborts (create_similar/create_for_rectangleon a null surface throwNotImplementedor return nothing, so the fault-count assertion fails).ctest -R '^public_headers'65 of 65.tools/progress.py --compare:libcairo114 to 116 of 161.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 coderabbitai[bot] on 2026-12-04T15:32:51Z.
Review: COMMENTED
Actionable comments
fd2b4573-1acb-4045-8039-238d4eea5307Reviewing files that changed from the base of the PR and between
2fbf8b4391andf7d3438064.core/libs/prx/libcairo/Surface.cppcore/libs/tests/GuestCairoSurface.cppdocs/dev/debt/changes/fix-libcairo-surface-fault-null.mdIncluded review availability: This review used your included allowance. Your plan provides up to 10 included reviews per hour; 8 remain after this review.
Imported from boykopovar/AnyPS5. Originally posted by MarcZX10 on 2026-12-04T16:33:39Z.
Review: COMMENTED
Reviewed — comments
The changed files were read, but pinned source context could not be checked because
repo_read.pyfailed while trying to write its read log.What I ran
Reviewed head
8d83d64c6e635cf853f2b2e89b5ef68ec96b9a0b. Read the prepared description, commits, diff, manifest, and all three changed files listed as reviewed. Attempted a targetedrepo_read.py search; it returned a match but failed to write its log. No tests or builds were run.Results
Findings
Blocking
None verified.
Non-blocking
None.
Sources
Not verified
Could not check the pinned repository context for Cairo behavior or
GuestFault_nid_no_patch; the reader's log write failed under the read-only filesystem. No tests were run. The preparedfiles.jsonlists all three changed files as reviewed and none as excluded.To get this to a good state
Nothing is required. Optional: rerun the targeted source-context review in an environment where
repo_read.pycan write its read log.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.