MCPcopy Create free account
hub / github.com/apache/impala / DangerousOperationThread

Function DangerousOperationThread

be/src/kudu/util/debug-util-test.cc:334–367  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

332 MALLOC_AND_FREE));
333
334void DangerousOperationThread(DangerousOp op, CountDownLatch* l) {
335 while (l->count()) {
336 switch (op) {
337 case DLOPEN_AND_CLOSE: {
338 // Check races against dlopen/dlclose.
339 void* v = dlopen("libc.so.6", RTLD_LAZY);
340 CHECK(v);
341 dlclose(v);
342 break;
343 }
344
345 case DL_ITERATE_PHDR: {
346 // Check for races against dl_iterate_phdr.
347 dl_iterate_phdr(&DoNothingDlCallback, nullptr);
348 break;
349 }
350
351 case GET_STACK_TRACE: {
352 // Check for reentrancy issues
353 GetStackTrace();
354 break;
355 }
356
357 case MALLOC_AND_FREE: {
358 // Check large allocations in tcmalloc.
359 volatile char* x = new char[1024 * 1024 * 2];
360 delete[] x;
361 break;
362 }
363 default:
364 LOG(FATAL) << "unknown op";
365 }
366 }
367}
368
369// Starts a thread performing dangerous operations and then gathers
370// its stack trace in a loop trying to trigger races.

Callers 1

TEST_PFunction · 0.85

Calls 5

dlopenFunction · 0.85
dlcloseFunction · 0.85
dl_iterate_phdrFunction · 0.85
GetStackTraceFunction · 0.70
countMethod · 0.45

Tested by

no test coverage detected