Skip to content

[skia-sync] Merge upstream chrome/m150 bug fixes - #4379

Merged
mattleibow merged 2 commits into
release/4.150.xfrom
skia-sync/release-4.150.x
Jul 10, 2026
Merged

mattleibow merged 2 commits into
release/4.150.xfrom
skia-sync/release-4.150.x

Conversation

@mattleibow

Copy link
Copy Markdown
Contributor

Automated upstream bug-fix sync for m150. Targeting release branch release/4.150.x (mono/skia release/4.150.x).

Companion skia PR: mono/skia#281

[skia-sync] Merge upstream chrome/m150 bug fixes — mono/SkiaSharp

Base branch: release/4.150.x
Head branch: skia-sync/release-4.150.x
Mode: release-line bug-fix sync (CURRENT == TARGET == 150)
Companion mono/skia PR: [skia-sync] Merge upstream chrome/m150 bug fixes on
skia-sync/release-4.150.x (submodule pointer advanced to reflect it)

Breaking-change analysis

None. Only one new upstream commit was pulled in (3273c66a68 [M150] Fix Use-After-Free in SubRunAllocator), and it is a pure internal C++ fix in
src/text/gpu/SubRunAllocator.h — it changes destruction order of an
internal allocator return type from std::tuple to a custom struct.

Category Risk Findings
Removed APIs 🔴 HIGH None
Renamed/Moved APIs 🟡 MEDIUM None
New APIs 🟢 LOW None
Behavior changes 🟡 MEDIUM None (bug fix restores correct behavior)
Graphite-only ⚪ SKIP N/A

No C API impact (grep SubRunAllocator src/c/ include/c/ returns nothing),
no header changes reachable from include/c/*.h, no binding regeneration
delta.

Version / binding updates

No version bump — this is a same-milestone release-line sync, so
scripts/VERSIONS.txt and scripts/azure-templates-variables.yml are
untouched (the Phase 6 script's version-downgrade side-effect was reverted
to preserve the branch's 4.150.1 post-release in-development number).

cgmanifest.json:

  • commitHash: b16789ec35… → 06f50d1c05… (new mono/skia merge commit)
  • upstream_merge_commit: 14d05ec761… → 3273c66a68… (new upstream tip)
  • chrome_milestone: 150 (unchanged)

externals/skia submodule pointer: 280ec21ada → 06f50d1c05 (points
at the new merge commit on skia-sync/release-4.150.x).

C# changes

None. Binding regeneration (pwsh ./utils/generate.ps1, via
.agents/skills/update-skia/scripts/regenerate-bindings.ps1) produced
zero diff across binding/SkiaSharp/SkiaApi.generated.cs and the
Skottie/SceneGraph/Resources generated files. The Phase 9 new-function
check (git diff origin/release/4.150.x -- binding/SkiaSharp/SkiaApi.generated.cs | grep '^+.*internal static') returned zero matches, so no C# wrappers
need to be added.

Build & test results (Linux x64)

Step Result
Native build (dotnet cake --target=externals-linux --arch=x64) ✅ Succeeded (14m 21s; 1506/1506 targets)
Binding regeneration ✅ Succeeded, zero binding diff
C# build (dotnet build binding/SkiaSharp/SkiaSharp.csproj) ✅ Succeeded (0 warnings, 0 errors)
Test suite (all SkiaSharp.Tests.Console tests) ✅ Passed: 5584, Failed: 0, Skipped: 172, Total: 5756 (2m 47s)

Both native artifacts produced as expected:

  • output/native/linux/x64/libSkiaSharp.so → libSkiaSharp.so.150.0.0
  • output/native/linux/x64/libHarfBuzzSharp.so → libHarfBuzzSharp.so.0.61421.0

Full test log uploaded as test-output.txt artifact.

Items needing human attention

None. This is a minimal internal C++ bug fix from upstream Skia's m150
branch with:

  • Zero API surface impact
  • Zero binding delta
  • Zero C# code changes
  • Zero test regressions (5584 passed)

Only Linux x64 was built and tested in this automated sync — macOS,
Windows, iOS, Android, WASM, and Tizen are covered by the normal CI matrix
on the PR.

Companion mono/skia PR

The submodule now points at commit 06f50d1c05 on the
skia-sync/release-4.150.x branch of mono/skia. That PR must merge
first; then this PR's submodule pointer will be re-fetched to the squashed
SHA before merging here.

Created by skia-upstream-sync.

Advances the externals/skia submodule to pull in one new upstream m150
bug-fix commit:
- 3273c66a68 [M150] Fix Use-After-Free in SubRunAllocator

Release-line bug-fix sync (release/4.150.x, same-milestone) — no version
bump. cgmanifest.json's commitHash and upstream_merge_commit updated.

Upstream change is internal-only (src/text/gpu/SubRunAllocator.h): no C
API, binding, or public C# API impact. Bindings regenerated to confirm
zero diff; full test suite (5584 passed / 0 failed / 172 skipped) green
on Linux x64.

Co-authored-by: Copilot <[email protected]>
@mattleibow mattleibow added the type/milestone-sync Any Skia upstream sync PR (milestone bump, same-milestone bug-fix re-sync, or tip sync). label Jul 8, 2026
@github-actions

github-actions Bot commented Jul 8, 2026

Copy link
Copy Markdown
Contributor

📦 Try the packages from this PR

Warning

Do not run these scripts without first reviewing the code in this PR.

Step 1 — Download the packages

bash / macOS / Linux:

curl -fsSL https://raw.githubusercontent.com/mono/SkiaSharp/main/scripts/get-skiasharp-pr.sh | bash -s -- 4379

PowerShell / Windows:

iex "& { $(irm https://raw.githubusercontent.com/mono/SkiaSharp/main/scripts/get-skiasharp-pr.ps1) } 4379"

Step 2 — Add the local NuGet source

dotnet nuget add source ~/.skiasharp/hives/pr-4379/packages --name skiasharp-pr-4379
More options
Option Description
--successful-only / -SuccessfulOnly Only use successful builds
--force / -Force Overwrite previously downloaded packages
--list / -List List available artifacts without downloading
--build-id ID / -BuildId ID Download from a specific build

Or download manually from Azure Pipelines — look for the nuget artifact on the build for this PR.

Remove the source when you're done:

dotnet nuget remove source skiasharp-pr-4379

@mattleibow
mattleibow marked this pull request as ready for review July 10, 2026 20:42
mattleibow added a commit to mono/skia that referenced this pull request Jul 10, 2026
[skia-sync] Merge upstream chrome/m150 bug fixes (#281)

Upstream CL: https://skia-review.googlesource.com/c/skia/+/1288679
Bug: skia:530646115 / Chromium 532102500
Upstream commit: google/skia@3273c66a68 (cherry-pick of 014a77e)

Merge one new bug-fix commit from chrome/m150 into the release/4.150.x
line:

  * 3273c66 [M150] Fix Use-After-Free in SubRunAllocator

Deserializing a corrupt Slug buffer (SlugImpl::MakeFromBuffer) returns
nullptr early, which destroys the temporary result of
SubRunAllocator::AllocateClassMemoryAndArena. That result was a
std::tuple, and the C++ standard leaves tuple member destruction order
unspecified: SubRunInitializer freed the backing memory before
~BagOfBytes in the SubRunAllocator read fEndByte out of it -- a
use-after-free read followed by a wild-free/double-free.

The fix replaces the tuple with a plain struct (AllocateAndArenaResult)
whose members are declared so the allocator is destroyed before the
initializer frees the memory, and refactors SubRunInitializer onto a
std::unique_ptr with a custom deleter so the ownership transfer is
explicit.

Internal C++ only: the single changed file is
src/text/gpu/SubRunAllocator.h. It touches no include/c or src/c file,
so there is no C API or SkiaSharp binding impact. Clean automatic merge,
no conflicts. Companion SkiaSharp PR: mono/SkiaSharp#4379.

Co-authored-by: Arthur Sonzogni <[email protected]>
Co-authored-by: Copilot <[email protected]>
mono/skia#281 was squash-merged into release/4.150.x, so the two-parent
merge commit 06f50d1c05 no longer exists on that branch. Point the
submodule and cgmanifest.json commitHash at the squash commit
ef2ebb78c8 (current tip of mono/skia release/4.150.x).

chrome_milestone (150) and upstream_merge_commit (3273c66a68) are
unchanged -- no new upstream code was merged, only the mono/skia commit
SHA changed as a result of the squash.

Co-authored-by: Copilot App <[email protected]>
mattleibow added a commit that referenced this pull request Jul 10, 2026
[skia-sync] Merge upstream chrome/m151 bug fixes (#4382)

Companion: mono/skia#282
Changes: mono/skia@9887799...cd6e926
Upstream CL: https://skia-review.googlesource.com/c/skia/+/1288616
Bug: skia:530646115 / Chromium 532103445

Advance the externals/skia submodule (and cgmanifest.json) on main to
mono/skia@cd6e926914, pulling in one upstream chrome/m151 bug fix:

  * Fix Use-After-Free in SubRunAllocator (google/skia@0208108c7a)

Deserializing a corrupt Slug buffer (SlugImpl::MakeFromBuffer) returns
nullptr early and destroys a std::tuple whose member destruction order is
unspecified, so SubRunInitializer freed the backing memory before
~BagOfBytes in the SubRunAllocator read fEndByte out of it -- a
use-after-free read followed by a wild-free/double-free. Upstream replaces
the tuple with a struct that guarantees the allocator destructs before the
initializer frees the memory. This is the same fix already taken to
release/4.150.x in #4379; see mono/skia#282 for the full analysis.

Submodule bump only: cgmanifest.json commitHash tracks the new mono/skia
commit; chrome_milestone (151) and upstream_merge_commit (0208108c7a) are
unchanged (same-milestone sync, no version bump). The upstream change is
internal C++ (src/text/gpu/SubRunAllocator.h) with no C API or binding
impact -- binding regeneration produced zero diff and the full
SkiaSharp.Tests.Console suite passed (5614 passed, 0 failed, 182 skipped)
on Linux x64.

Co-authored-by: Matthew Leibowitz <[email protected]>
Co-authored-by: Copilot <[email protected]>
@mattleibow
mattleibow merged commit c535f68 into release/4.150.x Jul 10, 2026
2 of 3 checks passed
@mattleibow
mattleibow deleted the skia-sync/release-4.150.x branch July 10, 2026 21:04
@mattleibow mattleibow added the partner/agentic-workflows Issues and PRs created by SkiaSharp agentic workflows. label Jul 11, 2026
@github-actions github-actions Bot added this to the 4.150.1 milestone Sep 18, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

partner/agentic-workflows Issues and PRs created by SkiaSharp agentic workflows. type/milestone-sync Any Skia upstream sync PR (milestone bump, same-milestone bug-fix re-sync, or tip sync).

Projects

Status: Done

Development

Successfully merging this pull request may close these issues.

1 participant