I'm trying to measure performance of some code I wrote. I compiled it with g++ with -pg flag, and when after running it I execute grpof, I reliably get std::bad_variant_access::~bad_variant_access() among most time-consuming (% time) functions.
No exceptions are actually being thrown by the program and if I try to put a breakpoint bad_variant_access::~bad_variant_access() in gdb, it doesn't trigger and the program finishes in one go.
Is there any way to backtrace where all these mysterious calls come from? Could gprof misfire and confuse functions?