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

Function TEST_F

be/src/runtime/bufferpool/buffer-allocator-test.cc:84–94  ·  view source on GitHub ↗

Confirm that ASAN will catch use-after-free errors, even if the BufferAllocator caches returned memory.

Source from the content-addressed store, hash-verified

82// Confirm that ASAN will catch use-after-free errors, even if the BufferAllocator caches
83// returned memory.
84TEST_F(BufferAllocatorTest, Poisoning) {
85 BufferAllocator allocator(dummy_pool_, test_env_->metrics(), TEST_BUFFER_LEN,
86 2 * TEST_BUFFER_LEN, 2 * TEST_BUFFER_LEN);
87 BufferHandle buffer;
88 ASSERT_OK(allocator.Allocate(&dummy_client_, TEST_BUFFER_LEN, &buffer));
89 uint8_t* data = buffer.data();
90 allocator.Free(move(buffer));
91
92 // Should trigger a ASAN failure.
93 ASSERT_DEATH({data[10] = 0;}, "use-after-poison");
94}
95
96#endif
97

Callers

nothing calls this directly

Calls 15

moveFunction · 0.85
push_backMethod · 0.80
metricsMethod · 0.45
AllocateMethod · 0.45
dataMethod · 0.45
FreeMethod · 0.45
is_openMethod · 0.45
DebugStringMethod · 0.45
MaintenanceMethod · 0.45
GetNumFreeBuffersMethod · 0.45
GetFreeBufferBytesMethod · 0.45
ReleaseMemoryMethod · 0.45

Tested by

no test coverage detected