cpython/Objects/mimalloc
Miss Islington (bot) ff58c3cb48
[3.13] gh-123022: Fix crash with `Py_Initialize` in background thread (GH-123052) (#123114)
Check that the current default heap is initialized in
`_mi_os_get_aligned_hint` and `mi_os_claim_huge_pages`.

The mimalloc function `_mi_os_get_aligned_hint` assumes that there is an
initialized default heap. This is true for our main thread, but not for
background threads. The problematic code path is usually called during
initialization (i.e., `Py_Initialize`), but it may also be called if the
program allocates large amounts of memory in total.

The crash only affected the free-threaded build.
(cherry picked from commit d061ffea7b)

Co-authored-by: Sam Gross <colesbury@gmail.com>
2024-08-17 20:38:02 +00:00
..
prim [3.13] gh-121731: Fix mimalloc compile error on GNU/Hurd (GH-121732) (#121773) 2024-07-14 17:14:30 +00:00
alloc-aligned.c
alloc-override.c
alloc-posix.c
alloc.c gh-115103: Enable internal mimalloc assertions in debug builds (#116343) 2024-03-05 13:54:20 -05:00
arena.c
bitmap.c
bitmap.h
heap.c gh-115103: Delay reuse of mimalloc pages that store PyObjects (#115435) 2024-03-06 09:42:11 -05:00
init.c gh-115491: Keep some fields valid across allocations (free-threading) (#115573) 2024-02-20 10:36:40 -05:00
options.c
os.c [3.13] gh-123022: Fix crash with `Py_Initialize` in background thread (GH-123052) (#123114) 2024-08-17 20:38:02 +00:00
page-queue.c
page.c gh-115103: Delay reuse of mimalloc pages that store PyObjects (#115435) 2024-03-06 09:42:11 -05:00
random.c
segment-map.c
segment.c gh-117755: Fix mimalloc for huge allocation on s390x (#117809) 2024-04-16 20:34:12 +00:00
static.c
stats.c