Repository navigation
Commit afa6c90
set _mi_process_is_initialized before mi_process_setup_auto_thread_done
439dc27 moved `mi_process_setup_auto_thread_done` into
`mi_process_init_once` so it runs after `mi_thread_init` and can
associate the current theap with the thread-done key. It now runs
before `_mi_process_is_initialized = true`, and with
`MI_TLS_RECURSE_GUARD` (always on for `MI_TLS_MODEL_LOCAL` on macOS)
`_mi_theap_default()` still returns `_mi_theap_empty` at that point.
The new `mi_assert_internal(mi_theap_is_initialized(theap))` fires in
debug builds; release builds skip the association, so the first
thread's theap is again never passed to `_mi_thread_done`.
Repro (macOS): `cmake -DCMAKE_BUILD_TYPE=Debug -DMI_TLS_MODEL=LOCAL`
then `./mimalloc-test-api` aborts at process init on v3.5.2 and
passes on v3.5.1. Same with `-DMI_TLS_RECURSE_GUARD=ON` on Linux.
Set the flag before `mi_process_setup_auto_thread_done`; the theap is
fully initialized by then.
Co-Authored-By: Claude Opus 5 (1M context) <[email protected]>
Claude-Session: https://claude.ai/code/session_016srh5svTkqfW21zGcU6ht91 parent 636510a commit afa6c90
1 file changed
Lines changed: 2 additions & 2 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
560 | 560 | | |
561 | 561 | | |
562 | 562 | | |
563 | | - | |
564 | | - | |
| 563 | + | |
| 564 | + | |
565 | 565 | | |
566 | 566 | | |
567 | 567 | | |
| |||
0 commit comments