[PATCH] D91617: [sanitizer_common][test] Disable CompactRingBuffer.int64 on Solaris/sparcv9

Rainer Orth via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Tue Nov 17 04:42:13 PST 2020


ro created this revision.
ro added a reviewer: vitalybuka.
ro added a project: Sanitizers.
Herald added subscribers: Sanitizers, fedor.sergeev, jyknight.
ro requested review of this revision.

Even after D91615 <https://reviews.llvm.org/D91615>, `CompactRingBuffer.int64` continues to `FAIL` on Solaris/sparcv9: it `SEGV`s here:

  Thread 2 received signal SIGSEGV, Segmentation fault.
  [Switching to Thread 1 (LWP 1)]
  0x00000001001b4598 in __sanitizer::CompactRingBuffer<long>::push (this=0x101420250, t=0) at /vol/llvm/src/llvm-project/local/compiler-rt/lib/sanitizer_common/sanitizer_ring_buffer.h:136
  136	    *next = t;
  (gdb) p next
  $1 = (long *) 0xffffff7f59a000

The problem is that this address is unmapped:`CompactRingBuffer` uses the top 8 bits of the address for its own purposes (cf. `kNextMask`).  However, Solaris/sparcv9 uses the full 64-bit address space, so this masking breaks the test, which needs to be disabled.


Repository:
  rG LLVM Github Monorepo

https://reviews.llvm.org/D91617

Files:
  compiler-rt/lib/sanitizer_common/tests/sanitizer_ring_buffer_test.cpp


Index: compiler-rt/lib/sanitizer_common/tests/sanitizer_ring_buffer_test.cpp
===================================================================
--- compiler-rt/lib/sanitizer_common/tests/sanitizer_ring_buffer_test.cpp
+++ compiler-rt/lib/sanitizer_common/tests/sanitizer_ring_buffer_test.cpp
@@ -74,6 +74,8 @@
   TestRB<LargeStruct>();
 }
 
+// Solaris/sparcv9 uses the full 64-bit address space.
+#if !(SANITIZER_SOLARIS && defined(__sparcv9))
 template<typename T>
 CompactRingBuffer<T> *AllocCompactRingBuffer(size_t count) {
   size_t sz = sizeof(T) * count;
@@ -94,5 +96,6 @@
       EXPECT_EQ(top - i - 1, (*R)[i]);
   }
 }
+#endif  // !(SANITIZER_SOLARIS && __sparcv9)
 #endif
 }  // namespace __sanitizer


-------------- next part --------------
A non-text attachment was scrubbed...
Name: D91617.305740.patch
Type: text/x-patch
Size: 713 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20201117/4ea367ab/attachment.bin>


More information about the llvm-commits mailing list