Skip to content

Commit ce6524d

Browse files
committed
[sanitizer_common][test] Disable FastUnwindTest.* on SPARC
Many of the `FastUnwindTest.*` tests `FAIL` on SPARC, both Solaris and Linux. The issue is that the fake stacks used in those tests don't match the requirements of the SPARC unwinder in `sanitizer_stacktrace_sparc.cpp` which has to look at the register window save area. I'm disabling the failing tests. Tested on `sparcv9-sun-solaris2.11`. Differential Revision: https://reviews.llvm.org/D91618
1 parent 44c96be commit ce6524d

File tree

1 file changed

+12
-5
lines changed

1 file changed

+12
-5
lines changed

compiler-rt/lib/sanitizer_common/tests/sanitizer_stacktrace_test.cpp

Lines changed: 12 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -70,11 +70,18 @@ void FastUnwindTest::TearDown() {
7070

7171
#if SANITIZER_CAN_FAST_UNWIND
7272

73+
#ifdef __sparc__
74+
// Fake stacks don't meet SPARC UnwindFast requirements.
75+
#define SKIP_ON_SPARC(x) DISABLED_##x
76+
#else
77+
#define SKIP_ON_SPARC(x) x
78+
#endif
79+
7380
void FastUnwindTest::UnwindFast() {
7481
trace.UnwindFast(start_pc, fake_bp, fake_top, fake_bottom, kStackTraceMax);
7582
}
7683

77-
TEST_F(FastUnwindTest, Basic) {
84+
TEST_F(FastUnwindTest, SKIP_ON_SPARC(Basic)) {
7885
UnwindFast();
7986
// Should get all on-stack retaddrs and start_pc.
8087
EXPECT_EQ(6U, trace.size);
@@ -85,7 +92,7 @@ TEST_F(FastUnwindTest, Basic) {
8592
}
8693

8794
// From: https://github.com/google/sanitizers/issues/162
88-
TEST_F(FastUnwindTest, FramePointerLoop) {
95+
TEST_F(FastUnwindTest, SKIP_ON_SPARC(FramePointerLoop)) {
8996
// Make one fp point to itself.
9097
fake_stack[4] = (uhwptr)&fake_stack[4];
9198
UnwindFast();
@@ -97,7 +104,7 @@ TEST_F(FastUnwindTest, FramePointerLoop) {
97104
}
98105
}
99106

100-
TEST_F(FastUnwindTest, MisalignedFramePointer) {
107+
TEST_F(FastUnwindTest, SKIP_ON_SPARC(MisalignedFramePointer)) {
101108
// Make one fp misaligned.
102109
fake_stack[4] += 3;
103110
UnwindFast();
@@ -122,7 +129,7 @@ TEST_F(FastUnwindTest, ZeroFramesStackTrace) {
122129
EXPECT_EQ(0U, trace.top_frame_bp);
123130
}
124131

125-
TEST_F(FastUnwindTest, FPBelowPrevFP) {
132+
TEST_F(FastUnwindTest, SKIP_ON_SPARC(FPBelowPrevFP)) {
126133
// The next FP points to unreadable memory inside the stack limits, but below
127134
// current FP.
128135
fake_stack[0] = (uhwptr)&fake_stack[-50];
@@ -133,7 +140,7 @@ TEST_F(FastUnwindTest, FPBelowPrevFP) {
133140
EXPECT_EQ(PC(1), trace.trace[1]);
134141
}
135142

136-
TEST_F(FastUnwindTest, CloseToZeroFrame) {
143+
TEST_F(FastUnwindTest, SKIP_ON_SPARC(CloseToZeroFrame)) {
137144
// Make one pc a NULL pointer.
138145
fake_stack[5] = 0x0;
139146
UnwindFast();

0 commit comments

Comments
 (0)