@@ -147,13 +147,12 @@ void __asan_poison_memory_region(void const volatile *addr, uptr size) {
147
147
148
148
u32 poison_magic = kAsanUserPoisonedMemoryMagic ;
149
149
150
- GET_CALLER_PC_BP;
151
- GET_STORE_STACK_TRACE_PC_BP (pc, bp);
152
- // TODO: garbage collect stacks once they fall off the ring buffer?
153
- // StackDepot doesn't currently have a way to delete stacks.
154
- u32 stack_id = StackDepotPut (stack);
155
-
156
150
if (flags ()->track_poison > 0 ) {
151
+ GET_STACK_TRACE (/* max_size=*/ 16 , /* fast=*/ false );
152
+ // TODO: garbage collect stacks once they fall off the ring buffer?
153
+ // StackDepot doesn't currently have a way to delete stacks.
154
+ u32 stack_id = StackDepotPut (stack);
155
+
157
156
u32 current_tid = GetCurrentTidOrInvalid ();
158
157
u32 poison_index = ((stack_id * 151157 ) ^ (current_tid * 733123 )) %
159
158
NumPoisonTrackingMagicValues;
@@ -162,7 +161,7 @@ void __asan_poison_memory_region(void const volatile *addr, uptr size) {
162
161
.thread_id = current_tid,
163
162
.begin = beg_addr,
164
163
.end = end_addr};
165
- // This is racy : with concurrent writes, some records may be lost,
164
+ // This is a data race : with concurrent writes, some records may be lost,
166
165
// but it's a sacrifice I am willing to make for speed.
167
166
// The sharding across PoisonRecords reduces the likelihood of
168
167
// concurrent writes.
0 commit comments