Skip to content

Cherry pick PR #9808: zlib: Fix GzipCompress invalid pointer crash#10024

Draft
cobalt-github-releaser-bot wants to merge 1 commit intomainfrom
cherry-pick-main-9808
Draft

Cherry pick PR #9808: zlib: Fix GzipCompress invalid pointer crash#10024
cobalt-github-releaser-bot wants to merge 1 commit intomainfrom
cherry-pick-main-9808

Conversation

@cobalt-github-releaser-bot
Copy link
Copy Markdown
Collaborator

Refer to the original PR: #9808

GzipCompress crashed in a CobaltMetricsLogUploaderTest test
due to a mismatched memory allocator issue.

The initial buffer was allocated using base::UncheckedMalloc,
which routes through PartitionAlloc. However, subsequent resizing
attempted to use the system realloc(), causing a SIGABRT.

This change avoids realloc() and correctly pairs base::UncheckedFree()
with base::UncheckedMalloc() to resolve the invalid pointer abort.

Bug: 486012022
Bug: 486003653
Bug: 502259405

@cobalt-github-releaser-bot
Copy link
Copy Markdown
Collaborator Author

MERGE CONFLICT CAT

Caution

There were merge conflicts while cherry picking! Check out cherry-pick-main-9808 and fix the conflicts before proceeding. Check the log at https://github.com/youtube/cobalt/actions/runs/24411862760 for details.

@github-actions
Copy link
Copy Markdown
Contributor

🤖 Gemini Suggested Commit Message


cobalt: Fix GzipCompress invalid pointer crash

The GzipCompress function crashed in Cobalt due to mismatched memory
allocators. An initial buffer allocated with base::UncheckedMalloc (via
PartitionAlloc) was incorrectly reallocated using the system realloc(),
leading to a SIGABRT. This change ensures that for Cobalt builds,
GzipCompress uses base::UncheckedFree() and avoids realloc(), thus
correctly pairing memory operations and resolving the invalid pointer
abort.

Bug: 486012022
Bug: 486003653
Bug: 502259405

💡 Pro Tips for a Better Commit Message:

  1. Influence the Result: Want to change the output? You can write custom prompts or instructions directly in the Pull Request description. The model uses that text to generate the message.
  2. Re-run the Generator: Post a comment with: /generate-commit-message

@jellefoks jellefoks force-pushed the cherry-pick-main-9808 branch 2 times, most recently from a3d1f66 to 5bce24c Compare April 15, 2026 00:39
GzipCompress crashed in a `CobaltMetricsLogUploaderTest` test
due to a mismatched memory allocator issue.

The initial buffer was allocated using base::UncheckedMalloc,
which routes through PartitionAlloc. However, subsequent resizing
attempted to use the system realloc(), causing a SIGABRT.

This change avoids realloc() and correctly pairs base::UncheckedFree()
with base::UncheckedMalloc() to resolve the invalid pointer abort.

Bug: 486012022
Bug: 486003653
@jellefoks jellefoks force-pushed the cherry-pick-main-9808 branch from 5bce24c to e897998 Compare April 15, 2026 00:40
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants