CUtlRBTree overflow

I’ve recently encountered crashes on my server that occur after I precache (or just load) a certain amount of cars. When it crashes it gives me the very helpful error message “CUtlRBTree overflow”.
The stack trace is as follows:

I assume this means that while loading the model, specifically while loading the sequences, it reaches a limit and crashes.
I can confirm that the server is not running out of memory. Especially weird is that it only ever crashes on the tick after all precaching is done (if no player is on the server, it does not crash at all until someone joins).

The question I have is, what counts towards the limit of the CUtlRBTree and is there a way for me to see what is in the tree?

It looks like you are correct, a model is overflowing the seqtable. Unloaded sequences for each virtual model are inserted into the seqtable. Just from a quick glance, it looks like the problem is that seqtable is a short dictionary, even though an integer element is being inserted, causing it to overflow. Why that many sequences are being inserted, however, is the root cause that I can’t seem to find thus far.

That actually helps a lot. I can see that there is only one such dictionary for all models, which probably means I am using too many sequences?
I’ll try and count how many I have in all of the models I am using.
Thanks for the help so far.

I just counted the sequences of all of the models I am including and I got around ~56K total sequences. But as far as I saw what matters is really just the unique sequences, which are only ~2.6K.

Unfortunately it does not seem to be a problem of having too many sequences though. After I deleted all models, except for tdmcars, the server still crashed with exactly the same error.
What is weird is that the on sandbox on the same server, this error does not seem to happen at all. Even after precaching all models (which is more than what I am doing in the other gamemode). So clearly there must be something that I am doing in the gamemode that fucks things up, but I have no clue what could possibly cause such an error.


I am pretty sure that is C_SENT, not CS_ENT. Since this is on the serverside I don’t think there should exist any clientside entities.

You’re right, was confused why physics methods were being ran on clientside entities :v: