News:

Simutrans Chat Room
Where cool people of Simutrans can meet up.

[assert] factorylist_stats_t.cc:60 assert(max_capacity>0);

Started by PJMack, April 15, 2022, 10:25:37 PM

Previous topic - Next topic

0 Members and 1 Guest are viewing this topic.

PJMack

Assertion occurs when changing from operation rate to ... what the next item is in the factory dialog.  Difficult to reproduce on a new game.

jamespetts

Quote from: PJMack on April 15, 2022, 10:25:37 PMAssertion occurs when changing from operation rate to ... what the next item is in the factory dialog.  Difficult to reproduce on a new game.

Thank you for the report. Is there any reliable reproduction case for this?
Download Simutrans-Extended.

Want to help with development? See here for things to do for coding, and here for information on how to make graphics/objects.

Follow Simutrans-Extended on Facebook.

PJMack

So far, the issue has only appeared on a specific map (and has consistently appeared on that map).  I have been using the map for testing of other features, however since I did not touch any of the industry code, I do not think it is anything I did.  Unfortunately, the map is far too large to attach.

jamespetts

I do not think that I will feasibly be able to look into this without a reliable reproduction case, I am afraid.
Download Simutrans-Extended.

Want to help with development? See here for things to do for coding, and here for information on how to make graphics/objects.

Follow Simutrans-Extended on Facebook.

PJMack

PR#539 fixes the crash.  It was caused by an apothecary that for some reason has a maximum capacity of zero.

Ranran(Hibernating)

PR#539 appears to be a change that is only intended to avoid crashes by avoiding division by zero.
I don't have a clear way to reproduce that, so I can't confirm it, but I think it will break the display. (Perhaps the bar pops out of the frame because the width is not calculated accurately).

The essence of the problem is that the capacity is not supposed to be zero, yet it is getting zero. I think that for some reason the factory is not getting the data or there is an industry with a capacity of 0 due to an anomaly in the calculation.
If the storage capacity is 0, it means that shipping or consumption cannot be done correctly, so I don't think it would take such a value.

Anyway, I think it would be smarter not to display the bar by changing assert to return and terminating the process.
(´・ω・`)シミュトランスのアップデート履歴(日本語) (※更新停止中)
bit.ly/3AuKHHP