Bug 231917
| Summary: | [bmalloc] Heap.shrinkLarge() allocates non-aligned region | ||
|---|---|---|---|
| Product: | WebKit | Reporter: | Basuke Suzuki <basuke> |
| Component: | bmalloc | Assignee: | Nobody <webkit-unassigned> |
| Status: | NEW | ||
| Severity: | Normal | CC: | fpizlo, ggaren, webkit-bug-importer |
| Priority: | P2 | Keywords: | InRadar |
| Version: | WebKit Nightly Build | ||
| Hardware: | Unspecified | ||
| OS: | Unspecified | ||
Basuke Suzuki
Because the newly allocated region is not aligned well, unaligned region will be returned to LargeFree while splitAndAllocate() is called. Those regions won't match to any request to LargeFree until the neighbor region is returned to LargeFree and get merged with that.
1. Align 40k memory region A. Both start and end is aligned in 4k boundary.
2. realloc A to 36k + 1. shrinkLarge tries to split it in that size, B (36k +1) and C (4k - 1)
3. B's end is not aligned, but there's no practical issue.
4. On the other hand, C's start address is not aligned and sit in the LargeFree. It won't fit to any request because it's not aligned.
| Attachments | ||
|---|---|---|
| Add attachment proposed patch, testcase, etc. |
Basuke Suzuki
Above description was wrong. Rewrote.
Because the newly allocated region is not aligned well, unaligned region will be returned to LargeFree while splitAndAllocate() is called. Those regions won't match to any request to LargeFree until the neighbor region is returned to LargeFree and get merged with that.
1. Align 40k memory region A. Both start and end is aligned in 4k boundary.
2. realloc A to 36k + 8. shrinkLarge tries to split it in that size, B (36k +8) and C (4k - 8)
3. B's end is not aligned, but there's no practical issue.
4. On the other hand, C's start address is not aligned and sit in the LargeFree. It won't fit to any request because it's not aligned.
Radar WebKit Bug Importer
<rdar://problem/84635991>