Seastar's allocator has an assertion which checks that the memory
block is freed on the same CPU on which it was allocated. This is
reasonable because all allocations in seastar need to be CPU-local.
The problem is that boost libraries (program_options,
unit_testing_framework) make heavy use of lazily-allocated static
variables, for instance:
const variable_value&
variables_map::get(const std::string& name) const
{
static variable_value empty;
// ...
}
Such variable will be allocated in in the current threads but freed in
the main thread when exit handlers are executed.
This results in:
output_stream_test: core/memory.cc:415: void memory::cpu_pages::free(void*):
Assertion `((reinterpret_cast<uintptr_t>(ptr) >> cpu_id_shift) & 0xff) == cpu_id' failed.
This change works around the problem by forcing initialization in the
main thread.
See issue #10.
2.0 KiB
2.0 KiB