Intermittent shutdown memory crash in compiled ROOT app (bus error / segfault / malloc smallbin corruption) with minimal reproducer

Dear @Lorenzo ,

Indeed @Wile_E_Coyote is right , you simply got the wrong order of destruction of your custom-managed objects allocated on the heap.

As a general advice, I would discourage you from using such patterns and try to use stack-based variables as much as possible or always use std::unique_ptr for heap-allocated objects.

Cheers,
Vincenzo