2019-05-21 03:04 CEST

View Issue Details Jump to Notes ]
IDProjectCategoryView StatusLast Update
0006167Spring engineLuapublic2019-04-10 11:21
ReporterGoogle_Frog 
Assigned Tohokomoko 
PrioritynormalSeverityminorReproducibilityhave not tried
StatusresolvedResolutionfixed 
Product Version104.0 +git 
Target VersionFixed in Version 
Summary0006167: What does "Warning: [CmdDescrCache::GetPtr] too many unique command-descriptions" mean?
Descriptionhttps://github.com/ZeroK-RTS/CrashReports/issues/20635

This crash report has spams "Warning: [CmdDescrCache::GetPtr] too many unique command-descriptions", followed by a lua error caused by Spring.FindUnitCmdDesc returning nil. What is a command-descriptor and what is the limit on them?



TagsNo tags attached.
Checked infolog.txt for lua ErrorsYes
Attached Files

-Relationships
+Relationships

-Notes

~0019853

hokomoko (developer)

This is more suitable for a forum post, but I'll answer here.

You know Spring.{Edit,Insert,Remove}UnitCmdDesc? All of these have to be stored somewhere, and having the exact same values stored multiple times for the move command of every unit is a big waste.
Therefore we have a fixed-size (quite large, 1024) cache of these.
The most likely reason for filling the cache is if you have a tooltip or a command text that's dependent on the unitid or the unitdefid.

~0019854

hokomoko (developer)

If that is not the case, please say so and we can enlarge the cache

~0019855

Google_Frog (reporter)

I don't recall any changes to command handling recently, and I doubt ZK reaches 1024 commands. Each unit has 30-50 commands, with builders having around 80 commands, yet there are many overlaps. I would generously estimate that there are at most 100 unique targeted or instant commands, and at most 100 state commands. Even with very generous estimates this is 600 commands.

I've looked through the command desc editing in the gadgets and they are quite static. The first parameter is changed in state toggle commands to reflect the state. One-click-weapons have their description set based on unitDefID, but only a few units have one-click-weapons. So I think there is a bug in ZK or the engine. How would you go about inspecting the cache ingame via lua?

~0019858

hokomoko (developer)

seems very weird.
I've tried to reproduce this without much success (\give all, watching the replay), so I'm closing this for now until it can be consistently reproduced.

~0019935

Google_Frog (reporter)

Here is another instance: https://github.com/ZeroK-RTS/Zero-K/issues/3513

Some sort of debug output would be helpful. Printing the cache on command and when the bug occurs should tell us where the issue lies.
+Notes

-Issue History
Date Modified Username Field Change
2019-03-15 06:39 Google_Frog New Issue
2019-03-15 10:15 hokomoko Note Added: 0019853
2019-03-15 10:18 hokomoko Note Added: 0019854
2019-03-15 10:18 hokomoko Assigned To => hokomoko
2019-03-15 10:18 hokomoko Status new => feedback
2019-03-15 14:06 Google_Frog Note Added: 0019855
2019-03-15 14:06 Google_Frog Status feedback => assigned
2019-03-15 17:28 hokomoko Note Added: 0019858
2019-03-15 17:28 hokomoko Status assigned => closed
2019-03-15 17:28 hokomoko Resolution open => unable to reproduce
2019-04-10 10:57 Google_Frog Status closed => feedback
2019-04-10 10:57 Google_Frog Resolution unable to reproduce => reopened
2019-04-10 10:57 Google_Frog Note Added: 0019935
2019-04-10 11:00 hokomoko Status feedback => assigned
2019-04-10 11:21 hokomoko Status assigned => resolved
2019-04-10 11:21 hokomoko Resolution reopened => fixed
+Issue History