WebKit Bugzilla
New
Browse
Search+
Log In
×
Sign in with GitHub
or
Remember my login
Create Account
·
Forgot Password
Forgotten password account recovery
RESOLVED FIXED
300882
[GTK][WPE] Fix tracking and leaking reallocated memory with MALLOC_HEAP_BREAKDOWN
https://bugs.webkit.org/show_bug.cgi?id=300882
Summary
[GTK][WPE] Fix tracking and leaking reallocated memory with MALLOC_HEAP_BREAK...
Olivier Blin
Reported
2025-10-16 04:55:01 PDT
With MALLOC_HEAP_BREAKDOWN on GLib ports, memory reallocated with zoneRealloc() is not tracked properly. If realloc() returns a different pointer, the old pointer is left accounted for in the zone allocations with the new size, and the new pointer is not tracked at all. So when the new pointer is freed by zoneFree(), the old pointer allocation remains in the allocation statistics. This has been noticed with a backport of this feature on WPE 2.42, which showed incorrect leaks of AssemblerData and MetadataTable objects.
Attachments
Add attachment
proposed patch, testcase, etc.
Olivier Blin
Comment 1
2025-10-16 04:59:51 PDT
Pull request:
https://github.com/WebKit/WebKit/pull/52467
Olivier Blin
Comment 2
2025-10-16 07:02:26 PDT
As noticed by Loïc, this was also leaking the reallocated memory, because zoneFree() checks if the freed pointer exists in the tracked allocation. Since it was not tracked properly, the actual free() was not called.
EWS
Comment 3
2025-10-17 07:14:40 PDT
Committed
301709@main
(ea2e6d0dea2c): <
https://commits.webkit.org/301709@main
> Reviewed commits have been landed. Closing PR #52467 and removing active labels.
Note
You need to
log in
before you can comment on or make changes to this bug.
Top of Page
Format For Printing
XML
Clone This Bug