Best practices for using te::TransportControl::ReallocationInhibitor

Cool! Not 100% sure why this piece is using EditPlaybackContext. We can defo get that info another way. I’ll get this change in and I’ll also add in the other TSan fixes and I’ll report back when we get new crash data in :slight_smile: Thanks very much for the TSan recommendation :metal:

Hey Dave! We’re still not any better off on crash rate with this change :frowning:

Right now our biggest crash cluster is in SummingNode::processSinglePrecision and my guess is that it’s happening here for some reason.

I’m guessing that as we’re iterating over nodes that the graph is being pulled down. Do you think there’s something we could be doing wrong which could be causing this?

Many thanks again,

Jamie

It’s not unsurprising that SummingNode::processSinglePrecision is the place where you’re seeing the crashes as with a relatively light graph, most of the time will be spent at sum points like this I imagine. So it’s more a probabilistic highlight than the cause.

But what I still can’t seem to figure out is how the graph can be being processed whilst concurrently being deleted. The only place a graph should be deleted is from LockFreeMultiThreadedNodePlayer::clearNode.

The only other thing I can think of is that you’re somehow calling LockFreeMultiThreadedNodePlayer::setNode multiple times before the audio callback has had a chance to graph the latest Node. I think the code should be secure against that but I’ll be honest I don’t think I’ve ever triggered it.

Can you try applying this patch which uses a different NodePlayer and see if you still see the same crashes?
TracktionNodePlayer.diff (1.5 KB)

If not, I really need some test code I can run to reproduce the issue to debug further I’m afraid. Can you make a little app that shows the above behaviour? Maybe base it on one of the demos?

Thanks Dave I’ve just pushed that to our branch, I’ll let you know if that makes any difference for us. If I can create a local repro then I’ll be sure to let you know. Currently we’re only able to hit this in the wild, and we get back the crash reports.

Sorry, you’ll also have to add this to avoid a hung when closing Edits:

void MultiThreadedNodePlayer::setNewGraph (std::unique_ptr<NodeGraph> newGraph)
{
    if (! newGraph)
    {
        currentPreparedNode = {};
        preparedNode = {};
        return;
    }
    

Hey Dave, thanks again for helping with the last iteration of tackling crashes! Unfortunately the last changes didn’t seem to affect the tracktion crashes. Sounds like you had a chat with Stefan and maybe we could have a chat at some point over zoom/etc about how best we might tackle these perhaps sometime next week? My email is jamie@mayk.it :slight_smile: