Skip to content
This repository was archived by the owner on Jan 20, 2022. It is now read-only.

Commit dcb0a9d

Browse files
committed
[LibOS] regression: Skip mmap test case when SGX=1
This test case passes without EDMM as all the enclave pages are already EADDed but with EDMM, a SIGBUS is generated since pages are only added when needed. Since SIGBUS isn't implemented correctly for lack of memory protection, skipping the mmap test case. Also, updated the mmap test case to remove default default signal handler. Signed-off-by: Vijay Dhanraj <[email protected]>
1 parent 1fc6ffa commit dcb0a9d

File tree

2 files changed

+4
-14
lines changed

2 files changed

+4
-14
lines changed

LibOS/shim/test/regression/mmap_file.c

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -89,10 +89,5 @@ int main(int argc, const char** argv) {
8989
__asm__ volatile("nop" ::: "memory");
9090
a[page_size] = 0xff;
9191

92-
if (signal(SIGBUS, SIG_DFL) == SIG_ERR) {
93-
perror("signal");
94-
return 1;
95-
}
96-
9792
return 0;
9893
}

LibOS/shim/test/regression/test_libos.py

Lines changed: 4 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -396,7 +396,10 @@ def test_043_futex_wake_op(self):
396396

397397
self.assertIn('Test successful!', stdout)
398398

399-
def test_050_mmap(self):
399+
@unittest.skipIf(HAS_SGX,
400+
'On SGX, SIGBUS isn\'t always implemented correctly, for lack '
401+
'of memory protection. For now, some of these cases won\'t work.')
402+
def test_051_mmap_sgx(self):
400403
stdout, _ = self.run_binary(['mmap_file'], timeout=60)
401404

402405
# Private mmap beyond file range
@@ -409,14 +412,6 @@ def test_050_mmap(self):
409412
self.assertIn('mmap test 3 passed', stdout)
410413
self.assertIn('mmap test 4 passed', stdout)
411414

412-
# "test 5" and "test 8" are checked below, in test_051_mmap_sgx
413-
414-
@unittest.skipIf(HAS_SGX,
415-
'On SGX, SIGBUS isn\'t always implemented correctly, for lack '
416-
'of memory protection. For now, some of these cases won\'t work.')
417-
def test_051_mmap_sgx(self):
418-
stdout, _ = self.run_binary(['mmap_file'], timeout=60)
419-
420415
# SIGBUS test
421416
self.assertIn('mmap test 5 passed', stdout)
422417
self.assertIn('mmap test 8 passed', stdout)

0 commit comments

Comments
 (0)