summaryrefslogtreecommitdiff
path: root/Tests/Kernel/null-deref-crash-during-pthread_join.cpp
blob: 409cbe90f333244509721118bbd8faf5ee61cf47 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
#include <pthread.h>
#include <stdio.h>
#include <sys/select.h>
#include <unistd.h>

int main(int, char**)
{
    pthread_t tid;
    pthread_create(
        &tid, nullptr, [](void*) -> void* {
            sleep(1);
            asm volatile("ud2");
            return nullptr;
        },
        nullptr);

    pthread_join(tid, nullptr);

    printf("ok\n");
    return 0;
}