JosiahWI commented on code in PR #13170:
URL: https://github.com/apache/trafficserver/pull/13170#discussion_r3405441790


##########
src/tscore/ink_queue.cc:
##########
@@ -248,13 +291,26 @@ freelist_new(InkFreeList *f)
       if (f->advice) {
         ats_madvise(static_cast<caddr_t>(newp), INK_ALIGN(alloc_size, 
alignment), f->advice);
       }
-      SET_FREELIST_POINTER_VERSION(item, newp, 0);
+      // LSan root-region registration. Each cell on the free-chain stores its
+      // successor as a bitwise-tagged pointer (version bits merged into the 
high
+      // bits of the word by SET_FREELIST_POINTER_VERSION / FROM_PTR). LSan's
+      // pointer scanner sees the tagged word and cannot recognize it as a heap
+      // pointer, so it classifies the cells as direct leaks. Registering the
+      // entire chunk as a root region tells LSan to scan the chunk's bytes for
+      // pointers; through that scan every cell on the chain becomes reachable 
and
+      // is reclassified as "still reachable." Registration happens once per 
chunk
+      // (amortized over chunk_size cells) and is a no-op in non-ASan builds.
+#if defined(__SANITIZE_ADDRESS__) || (defined(__has_feature) && 
__has_feature(address_sanitizer))

Review Comment:
   Looks correct; not sure why this is failing



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to