Cheng Shao pushed to branch wip/terrorjack/asan at Glasgow Haskell Compiler / GHC Commits: 8e24f49a by Cheng Shao at 2025-12-30T01:16:20+01:00 rts: add ASAN instrumentation to block allocator - - - - - 0e3419d4 by Cheng Shao at 2025-12-30T01:16:20+01:00 rts: add ASAN instrumentation to per-Task InCall free list - - - - - 2 changed files: - rts/Task.c - rts/sm/BlockAlloc.c Changes: ===================================== rts/Task.c ===================================== @@ -183,6 +183,7 @@ freeTask (Task *task) stgFree(incall); } for (incall = task->spare_incalls; incall != NULL; incall = next) { + __ghc_asan_unpoison_memory_region(incall, sizeof(InCall)); next = incall->next; stgFree(incall); } @@ -252,6 +253,7 @@ newInCall (Task *task) if (task->spare_incalls != NULL) { incall = task->spare_incalls; + __ghc_asan_unpoison_memory_region(incall, sizeof(InCall)); task->spare_incalls = incall->next; task->n_spare_incalls--; } else { @@ -283,6 +285,7 @@ endInCall (Task *task) stgFree(incall); } else { incall->next = task->spare_incalls; + __ghc_asan_poison_memory_region(incall, sizeof(InCall)); task->spare_incalls = incall; task->n_spare_incalls++; } ===================================== rts/sm/BlockAlloc.c ===================================== @@ -261,6 +261,8 @@ initGroup(bdescr *head) head[i].flags = 0; } #endif + + __ghc_asan_unpoison_memory_region(head->start, (W_)head->blocks * BLOCK_SIZE); } #if SIZEOF_VOID_P == SIZEOF_LONG @@ -1052,6 +1054,8 @@ freeGroup(bdescr *p) setup_tail(p); free_list_insert(node,p); + __ghc_asan_poison_memory_region(p->start, (W_)p->blocks * BLOCK_SIZE); + IF_DEBUG(sanity, checkFreeListSanity()); } View it on GitLab: https://gitlab.haskell.org/ghc/ghc/-/compare/007f83df2ee52d139ab83c8ae3bd919... -- View it on GitLab: https://gitlab.haskell.org/ghc/ghc/-/compare/007f83df2ee52d139ab83c8ae3bd919... You're receiving this email because of your account on gitlab.haskell.org.