Just ran some benchmarks with this patch. Eventually the program segfaults with the following stracktrace:
#0 0x00007ffff4cf8406 in TProcessID::GetObjectWithID(unsigned int) () from /nix/store/zvcvwyzv1ywfvqsrm2akik74msnp4d18-root-6.16/lib/libCore.so
#1 0x00007ffff4d062b2 in TRef::GetObject() const () from /nix/store/zvcvwyzv1ywfvqsrm2akik74msnp4d18-root-6.16/lib/libCore.so
Presuming this is not reproducable in the minimal example above, I’ll see about amending it, but that might be a while.