Skip to content

Commit 752594e

Browse files
committed
add test for #414
1 parent 728be93 commit 752594e

File tree

1 file changed

+15
-0
lines changed

1 file changed

+15
-0
lines changed

test/main-override.cpp

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -33,6 +33,7 @@ void padding_shrink(); // issue #209
3333
void various_tests();
3434
void test_mt_shutdown();
3535
void fail_aslr(); // issue #372
36+
void tsan_numa_test(); // issue #414
3637

3738
int main() {
3839
mi_stats_reset(); // ignore earlier allocations
@@ -41,6 +42,8 @@ int main() {
4142
heap_late_free();
4243
padding_shrink();
4344
various_tests();
45+
tsan_numa_test();
46+
4447
//test_mt_shutdown();
4548
//fail_aslr();
4649
mi_stats_print(NULL);
@@ -216,4 +219,16 @@ void fail_aslr() {
216219
void* p = malloc(sz);
217220
printf("pointer p: %p: area up to %p\n", p, (uint8_t*)p + sz);
218221
*(int*)0x5FFFFFFF000 = 0; // should segfault
222+
}
223+
224+
// issues #414
225+
void dummy_worker() {
226+
void* p = mi_malloc(0);
227+
mi_free(p);
228+
}
229+
230+
void tsan_numa_test() {
231+
auto t1 = std::thread(dummy_worker);
232+
dummy_worker();
233+
t1.join();
219234
}

0 commit comments

Comments
 (0)