LLNL / metall

Persistent memory allocator for data-centric analytics
Other
53 stars 13 forks source link

metall manager capacity limit SEGFAULT #328

Open liss-h opened 1 month ago

liss-h commented 1 month ago

The following code causes a segfault:

std::string const path{std::format("/tmp/metall-test-capacity-{}", std::random_device{}())};

metall::manager manager{metall::create_only, path, 1};
std::vector<uint64_t, metall::manager::allocator_type<uint64_t>> vec{manager.get_allocator<uint64_t>()};

for (size_t cap = 0; cap < 100'000'000; cap += 1'000'000) {
    vec.resize(cap);
}

Whereas it throws bad_alloc (as expected) if you immediately .resize() to 100'000'000.

KIwabuchi commented 3 weeks ago

Thanks for reporting the issue. I'll investigate why bad_alloc is not thrown.

KIwabuchi commented 2 weeks ago

Unfortunately, I cannot reproduce the issue on my side. I also checked Metall code but couldn't find an issue. I'll keep investigating and let you know once I find something.

liss-h commented 3 days ago

You are on MacOS, right? Maybe there is some difference between MacOS and Linux that prevents you from being able to reproduce it.

Could you try increasing the maximum cap value?