Changeset 287991 in webkit
- Timestamp:
- Jan 13, 2022 1:12:09 PM (2 years ago)
- Location:
- trunk/Source/bmalloc
- Files:
-
- 4 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/Source/bmalloc/ChangeLog
r287968 r287991 1 2022-01-13 Filip Pizlo <fpizlo@apple.com> 2 3 [libpas] add assertions that we aren't switching to a NULL lock 4 https://bugs.webkit.org/show_bug.cgi?id=235190 5 6 Reviewed by Yusuke Suzuki. 7 8 This adds a pas_panic call when pas_local_allocator_stop sees a NULL page->lock_ptr. That's one 9 possible explanation of a very rare crash I'm seeing where return_memory_to_page fails its assertion 10 that we are holding the page lock. 11 12 This also adds TESTING asserts in a bunch of other places. The PAS_TESTING_ASSERTS about this are in 13 places that are perf-sensitive, so we probably cannot assert in production. The hope behind those is 14 that it will help to catch this issue in test_pas. 15 16 * libpas/src/libpas/pas_local_allocator.c: 17 (stop_impl): 18 * libpas/src/libpas/pas_segregated_page.c: 19 (pas_segregated_page_switch_lock_and_rebias_while_ineligible_impl): 20 * libpas/src/libpas/pas_segregated_page_inlines.h: 21 (pas_segregated_page_lock_with_unbias_not_utility): 22 (pas_segregated_page_lock_with_unbias): 23 (pas_segregated_page_lock): 24 (pas_segregated_page_switch_lock_impl): 25 (pas_segregated_page_switch_lock_with_mode): 26 1 27 2022-01-12 Filip Pizlo <fpizlo@apple.com> 2 28 -
trunk/Source/bmalloc/libpas/src/libpas/pas_local_allocator.c
r287968 r287991 181 181 if (!pas_segregated_page_switch_lock_with_mode(page, &held_lock, page_lock_mode, page_config)) 182 182 return false; 183 184 if (!pas_segregated_page_config_is_utility(page_config) && !held_lock) 185 pas_panic("Should be holding a lock after pas_segregated_page_switch_lock_with_mode in stop_impl\n"); 183 186 184 187 page_config.specialized_local_allocator_return_memory_to_page( -
trunk/Source/bmalloc/libpas/src/libpas/pas_segregated_page.c
r287192 r287991 1 1 /* 2 * Copyright (c) 2018-202 1Apple Inc. All rights reserved.2 * Copyright (c) 2018-2022 Apple Inc. All rights reserved. 3 3 * 4 4 * Redistribution and use in source and binary forms, with or without … … 126 126 127 127 page_lock = page->lock_ptr; 128 PAS_TESTING_ASSERT(page_lock); 128 129 129 130 if (*held_lock == page_lock && *held_lock == &cache_node->page_lock) { -
trunk/Source/bmalloc/libpas/src/libpas/pas_segregated_page_inlines.h
r287192 r287991 1 1 /* 2 * Copyright (c) 2018-202 1Apple Inc. All rights reserved.2 * Copyright (c) 2018-2022 Apple Inc. All rights reserved. 3 3 * 4 4 * Redistribution and use in source and binary forms, with or without … … 131 131 pas_lock* lock_ptr) 132 132 { 133 PAS_TESTING_ASSERT(lock_ptr); 134 133 135 *held_lock = lock_ptr; 134 136 … … 152 154 } 153 155 156 PAS_TESTING_ASSERT(lock_ptr); 157 154 158 return pas_segregated_page_lock_with_unbias_not_utility(page, held_lock, lock_ptr); 155 159 } … … 171 175 172 176 lock_ptr = page->lock_ptr; 173 177 174 178 if (pas_segregated_page_lock_with_unbias(page, &held_lock_ignored, lock_ptr, page_config)) 175 179 return; … … 209 213 held_lock_value = *held_lock; 210 214 page_lock = page->lock_ptr; 215 216 PAS_TESTING_ASSERT(page_lock); 211 217 212 218 if (PAS_LIKELY(held_lock_value == page_lock)) { … … 233 239 234 240 switch (lock_mode) { 235 case pas_lock_lock_mode_try_lock: 236 return pas_lock_switch_with_mode(held_lock, page->lock_ptr, pas_lock_lock_mode_try_lock); 241 case pas_lock_lock_mode_try_lock: { 242 pas_lock* page_lock; 243 page_lock = page->lock_ptr; 244 PAS_TESTING_ASSERT(page_lock); 245 return pas_lock_switch_with_mode(held_lock, page_lock, pas_lock_lock_mode_try_lock); 246 } 237 247 238 248 case pas_lock_lock_mode_lock: {
Note: See TracChangeset
for help on using the changeset viewer.