(core) possible detach corruption
This seem to be triggered by a rare and ugly edge case. Best place to reproduce so far has been a release-build using safespaces on a PSVR, i.e. a relatively complex sharing graph with aggressive optimizations.
The first set symptom is a live-lock on detach_object when cleaning up the context. Slightly closer inspection gives that it is part of the:
torem = dst->first;
while (torem){
if (torem->elem == src)
break;
torem = torem->next;
}
Block that never terminates. This means that torem->next manages to run into a cycle. Did not have access to more debug info or tracing options at the time of discovery, so just documenting here.
Another (more likely?) possibility is that this comes from a linked rendertarget and we are seeing an optimization of the recursion. This fits the part about safespaces triggering it as it is the only active user of define_linktarget, and it is relatively speaking a less tested feature.