[PATCH] D25945: [lsan] Relax check for allocator_end in ProcessGlobalRegionsCallback.

Maxim Ostapenko via llvm-commits llvm-commits at lists.llvm.org
Tue Oct 25 08:45:57 PDT 2016

m.ostapenko created this revision.
m.ostapenko added reviewers: kcc, eugenis, aizatsky.
m.ostapenko added subscribers: llvm-commits, ygribov.
m.ostapenko set the repository for this revision to rL LLVM.
m.ostapenko added a project: Sanitizers.

While testing I hit on //CHECK_LE(allocator_end, end)// randomly from one build to another. Looking to //GetAllocatorGlobalRange(&allocator_begin, &allocator_end)// just few lines above this check, It appears that **allocator_end** theoretically may become equal to **end** (if allocator locates in top addresses of corresponding global section).
Just relax this check to avoid such failure.




Index: lib/lsan/lsan_common_linux.cc
--- lib/lsan/lsan_common_linux.cc
+++ lib/lsan/lsan_common_linux.cc
@@ -71,7 +71,7 @@
     GetAllocatorGlobalRange(&allocator_begin, &allocator_end);
     if (begin <= allocator_begin && allocator_begin < end) {
       CHECK_LE(allocator_begin, allocator_end);
-      CHECK_LT(allocator_end, end);
+      CHECK_LE(allocator_end, end);
       if (begin < allocator_begin)
         ScanRangeForPointers(begin, allocator_begin, frontier, "GLOBAL",

-------------- next part --------------
A non-text attachment was scrubbed...
Name: D25945.75711.patch
Type: text/x-patch
Size: 593 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20161025/945154eb/attachment.bin>

More information about the llvm-commits mailing list