Commit 20ca02e
committed
Fix crash in pthread_tsd_cleanup on macOS ARM64 (#1177)
Complete the NULL handling fix from commit 515047b by also checking for
NULL page entries in the 2-level page map lookup.
The issue occurs on macOS ARM64 during pthread TSD cleanup when
thread_local C++ objects are destroyed. During this late cleanup phase,
the TLS for mimalloc may already be invalidated, causing page map
lookups to return NULL for valid pointers.
Commit 515047b changed the sub==NULL case to return _mi_page_empty
instead of NULL, but missed the case where sub[sub_idx] is NULL.1 parent 7a2a411 commit 20ca02e
1 file changed
+3
-1
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
578 | 578 | | |
579 | 579 | | |
580 | 580 | | |
581 | | - | |
| 581 | + | |
| 582 | + | |
| 583 | + | |
582 | 584 | | |
583 | 585 | | |
584 | 586 | | |
| |||
0 commit comments