Title: gh-144319: Fix huge page leak in datastack chunk allocator by pablogsal · Pull Request #147963 · python/cpython · GitHub
Open Graph Title: gh-144319: Fix huge page leak in datastack chunk allocator by pablogsal · Pull Request #147963 · python/cpython
X Title: gh-144319: Fix huge page leak in datastack chunk allocator by pablogsal · Pull Request #147963 · python/cpython
Description: The datastack chunk allocator (allocate_chunk in pystate.c) and other small virtual-memory users such as the JIT tracer allocate through _PyObject_VirtualAlloc() using the logical requested size. When huge pages are enabled, the arena allocator may round those mappings up to the platform huge page size, so freeing with the smaller requested size can make munmap() fail with EINVAL and leak the mapping. This change moves the rounding logic into _PyObject_VirtualAlloc() / _PyObject_VirtualFree() so allocation and free always agree on the full mapped size. Keeping it in the allocator layer also avoids a hardcoded 2 MB assumption in pystate.c and fixes the JIT tracer allocation path at the same time. Issue: gh-144319
Open Graph Description: The datastack chunk allocator (allocate_chunk in pystate.c) and other small virtual-memory users such as the JIT tracer allocate through _PyObject_VirtualAlloc() using the logical requested size. W...
X Description: The datastack chunk allocator (allocate_chunk in pystate.c) and other small virtual-memory users such as the JIT tracer allocate through _PyObject_VirtualAlloc() using the logical requested size. W...
Opengraph URL: https://github.com/python/cpython/pull/147963
X: @github
Domain: github.com
| route-pattern | /:user_id/:repository/pull/:id/files(.:format) |
| route-controller | pull_requests |
| route-action | files |
| fetch-nonce | v2:35b61332-f005-305b-4779-13750273486b |
| current-catalog-service-hash | ae870bc5e265a340912cde392f23dad3671a0a881730ffdadd82f2f57d81641b |
| request-id | 9862:1D00CE:7569D6:9BDE6E:6A52A708 |
| html-safe-nonce | a4eb8a616c449c30957382ab8b2886a3ced58d90794a229d80535f99d0730a96 |
| visitor-payload | eyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiI5ODYyOjFEMDBDRTo3NTY5RDY6OUJERTZFOjZBNTJBNzA4IiwidmlzaXRvcl9pZCI6IjM1ODc3MTE2MzU4MzIzNTA0NzIiLCJyZWdpb25fZWRnZSI6ImlhZCIsInJlZ2lvbl9yZW5kZXIiOiJpYWQifQ== |
| visitor-hmac | 6854ded903602c13c4a3842d8095f36cdb65bca99256a69a0ddb8bdee9f775dd |
| hovercard-subject-tag | pull_request:3476815925 |
| github-keyboard-shortcuts | repository,pull-request-list,pull-request-conversation,pull-request-files-changed,copilot |
| google-site-verification | Apib7-x98H0j5cPqHWwSMm6dNU4GmODRoqxLiDzdx9I |
| octolytics-url | https://collector.github.com/github/collect |
| analytics-location | / |
| fb:app_id | 1401488693436528 |
| apple-itunes-app | app-id=1477376905, app-argument=https://github.com/python/cpython/pull/147963/files |
| twitter:image | https://avatars.githubusercontent.com/u/11718525?s=400&v=4 |
| twitter:card | summary_large_image |
| og:image | https://avatars.githubusercontent.com/u/11718525?s=400&v=4 |
| og:image:alt | The datastack chunk allocator (allocate_chunk in pystate.c) and other small virtual-memory users such as the JIT tracer allocate through _PyObject_VirtualAlloc() using the logical requested size. W... |
| og:site_name | GitHub |
| og:type | object |
| hostname | github.com |
| expected-hostname | github.com |
| None | b9a586c06a05a7a86fc7e3f4dbd03e42f6869085879aa184aa6369456dbd50fb |
| turbo-cache-control | no-preview |
| diff-view | unified |
| go-import | github.com/python/cpython git https://github.com/python/cpython.git |
| octolytics-dimension-user_id | 1525981 |
| octolytics-dimension-user_login | python |
| octolytics-dimension-repository_id | 81598961 |
| octolytics-dimension-repository_nwo | python/cpython |
| octolytics-dimension-repository_public | true |
| octolytics-dimension-repository_is_fork | false |
| octolytics-dimension-repository_network_root_id | 81598961 |
| octolytics-dimension-repository_network_root_nwo | python/cpython |
| turbo-body-classes | logged-out env-production page-responsive full-width |
| disable-turbo | true |
| browser-stats-url | https://api.github.com/_private/browser/stats |
| browser-errors-url | https://api.github.com/_private/browser/errors |
| release | 07a982c1d40157c619b364352b704c3ce66bb332 |
| ui-target | full |
| theme-color | #1e2327 |
| color-scheme | light dark |
Links:
Viewport: width=device-width