Skip to content

Commit fb19400

Browse files
committed
tsan: fix mmap_lots test
If tsan runtime will try to allocate something during exit handling, the allocation will fail because there is no VA whatsoever. It's observed to fail with the following error in some cases: failed to allocate 0x1000 (4096) bytes of DTLS_NextBlock. So terminate the process immediately. Reviewed-in: https://reviews.llvm.org/D96874
1 parent c73cbf2 commit fb19400

File tree

1 file changed

+6
-0
lines changed

1 file changed

+6
-0
lines changed

compiler-rt/test/tsan/mmap_lots.cpp

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,12 @@ int main() {
2424
fprintf(stderr, "allocated %zu with size %zu\n", allocated, mmap_size);
2525
}
2626
fprintf(stderr, "DONE\n");
27+
// If tsan runtime will try to allocate something during exit handling,
28+
// the allocation will fail because there is no VA whatsoever.
29+
// It's observed to fail with the following error in some cases:
30+
// failed to allocate 0x1000 (4096) bytes of DTLS_NextBlock.
31+
// So terminate the process immediately.
32+
_exit(0);
2733
}
2834

2935
// CHECK: DONE

0 commit comments

Comments
 (0)