While it fixes panics during careless use, it introduces a bug where an enormous number of samples gets dropped even when doing a single-threaded test:
CONVERSION STATISTICS:
#samples/total 782467
#callchain/dubious-frames 676348
after revert:
CONVERSION STATISTICS:
#exec/elf 2
#samples/total 1094582
#samples/unknown-function 43557
#callchain/dubious-frames 40095
This happens on several boxes.
I don't know what the bug is and I don't have time to investigate. Between having panics with careless use and bogus results I take the panics for the time being. Thus I propose a revert until someone can find out what's going on here.
I made sure that changes made past this are still there.