Don't check __asan_region_is_poisoned in objspace_each_objects
This returns whether or not _any_ piece of memory in the range is poisoned, not if _all_ of it is. That means that currently, with ASAN enabled, pages which contain a single poisoned object are skipped entirely from being iterated with objspace_each* family of functions. [Bug #20220]
This commit is contained in:
parent
719db18b50
commit
4f4f3a6dec
16
gc.c
16
gc.c
@ -3984,15 +3984,13 @@ objspace_each_objects_try(VALUE arg)
|
||||
uintptr_t pstart = (uintptr_t)page->start;
|
||||
uintptr_t pend = pstart + (page->total_slots * size_pool->slot_size);
|
||||
|
||||
if (!__asan_region_is_poisoned((void *)pstart, pend - pstart)) {
|
||||
if (data->each_obj_callback &&
|
||||
(*data->each_obj_callback)((void *)pstart, (void *)pend, size_pool->slot_size, data->data)) {
|
||||
break;
|
||||
}
|
||||
if (data->each_page_callback &&
|
||||
(*data->each_page_callback)(page, data->data)) {
|
||||
break;
|
||||
}
|
||||
if (data->each_obj_callback &&
|
||||
(*data->each_obj_callback)((void *)pstart, (void *)pend, size_pool->slot_size, data->data)) {
|
||||
break;
|
||||
}
|
||||
if (data->each_page_callback &&
|
||||
(*data->each_page_callback)(page, data->data)) {
|
||||
break;
|
||||
}
|
||||
|
||||
page = ccan_list_next(&SIZE_POOL_EDEN_HEAP(size_pool)->pages, page, page_node);
|
||||
|
Loading…
x
Reference in New Issue
Block a user