1*3b14d80aSVedant Kumar #include <stdlib.h>
2*3b14d80aSVedant Kumar #include <thread>
3*3b14d80aSVedant Kumar #include <unistd.h>
4*3b14d80aSVedant Kumar #include <vector>
5*3b14d80aSVedant Kumar 
sleep_worker(void * in)6*3b14d80aSVedant Kumar void *sleep_worker(void *in) {
7*3b14d80aSVedant Kumar   sleep(30);
8*3b14d80aSVedant Kumar   sleep(30);
9*3b14d80aSVedant Kumar   return nullptr;
10*3b14d80aSVedant Kumar }
11*3b14d80aSVedant Kumar 
crash_worker(void * in)12*3b14d80aSVedant Kumar void *crash_worker(void *in) {
13*3b14d80aSVedant Kumar   sleep(1);
14*3b14d80aSVedant Kumar   volatile int *p = nullptr; // break here
15*3b14d80aSVedant Kumar   return (void *)*p;
16*3b14d80aSVedant Kumar }
17*3b14d80aSVedant Kumar 
main()18*3b14d80aSVedant Kumar int main() {
19*3b14d80aSVedant Kumar   std::vector<std::thread> threads;
20*3b14d80aSVedant Kumar   threads.push_back(std::move(std::thread(crash_worker, nullptr)));
21*3b14d80aSVedant Kumar   for (int i = 0; i < 15; i++)
22*3b14d80aSVedant Kumar     threads.push_back(std::move(std::thread(sleep_worker, nullptr)));
23*3b14d80aSVedant Kumar   sleep(10);
24*3b14d80aSVedant Kumar }
25