Title: gh-127545: Specify minimum PyGC_Head alignment to fix build failure by fthain · Pull Request #127546 · python/cpython · GitHub
Open Graph Title: gh-127545: Specify minimum PyGC_Head alignment to fix build failure by fthain · Pull Request #127546 · python/cpython
X Title: gh-127545: Specify minimum PyGC_Head alignment to fix build failure by fthain · Pull Request #127546 · python/cpython
Description: As documented in InternalDocs/garbage_collector.md, the garbage collector stores flags in the least significant two bits of the _gc_prev pointer in struct PyGC_Head. Consequently, this pointer is only capable of storing a location that's aligned to a 4-byte boundary. This alignment requirement is documented but it's not actually encoded. The code works when python happens to run on a platform that has a large minimum alignment, but fails otherwise. Since we know that 2 bits are needed, we also know the minimum alignment that's needed. Let's make that explicit, so the compiler can then make sure those 2 bits are available. This patch fixes a segfault in _bootstrap_python. It also clarifies the code by making the actual requirement explicit. This bug was investigated by Adrian Glaubitz here: https://lists.debian.org/debian-68k/2024/11/msg00020.html https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=1087600 Although Adrian's patch isn't really correct (because natural alignment is not needed), he deserves full credit for finding the root cause. #127545 Issue: gh-127545
Open Graph Description: As documented in InternalDocs/garbage_collector.md, the garbage collector stores flags in the least significant two bits of the _gc_prev pointer in struct PyGC_Head. Consequently, this pointer is o...
X Description: As documented in InternalDocs/garbage_collector.md, the garbage collector stores flags in the least significant two bits of the _gc_prev pointer in struct PyGC_Head. Consequently, this pointer is o...
Opengraph URL: https://github.com/python/cpython/pull/127546
X: @github
Domain: github.com
| route-pattern | /:user_id/:repository/pull/:id/files(.:format) |
| route-controller | pull_requests |
| route-action | files |
| fetch-nonce | v2:2ce44066-2cf4-e65c-5d12-c76d786d858c |
| current-catalog-service-hash | ae870bc5e265a340912cde392f23dad3671a0a881730ffdadd82f2f57d81641b |
| request-id | C16A:C7E79:527D938:73CC183:6A570F94 |
| html-safe-nonce | 044c9007da0d1099f4cef3b213811421842575fab104642d348ed59d63192f21 |
| visitor-payload | eyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiJDMTZBOkM3RTc5OjUyN0Q5Mzg6NzNDQzE4Mzo2QTU3MEY5NCIsInZpc2l0b3JfaWQiOiI2MjQ2Nzg4NTE3OTk5MzQ5NjUyIiwicmVnaW9uX2VkZ2UiOiJpYWQiLCJyZWdpb25fcmVuZGVyIjoiaWFkIn0= |
| visitor-hmac | edccb20ef5fe53763c473fbb39cfbfb703f62fe5a6906dd566081d47f694675f |
| hovercard-subject-tag | pull_request:2211797565 |
| 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/127546/files |
| twitter:image | https://avatars.githubusercontent.com/u/11977417?s=400&v=4 |
| twitter:card | summary_large_image |
| og:image | https://avatars.githubusercontent.com/u/11977417?s=400&v=4 |
| og:image:alt | As documented in InternalDocs/garbage_collector.md, the garbage collector stores flags in the least significant two bits of the _gc_prev pointer in struct PyGC_Head. Consequently, this pointer is o... |
| og:site_name | GitHub |
| og:type | object |
| hostname | github.com |
| expected-hostname | github.com |
| None | 4e7a7296a3830877cf21a6ad2a972c9e618a48915e03966cf0c53eb08e5aad98 |
| 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 | 2576d1f0198cf1588faf2edf27f1ed120903be10 |
| ui-target | full |
| theme-color | #1e2327 |
| color-scheme | light dark |
Links:
Viewport: width=device-width