Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Transfer + auto-refit combo causing Assertion failure #5861

Closed
DorpsGek opened this issue Jan 12, 2014 · 3 comments
Closed

Transfer + auto-refit combo causing Assertion failure #5861

DorpsGek opened this issue Jan 12, 2014 · 3 comments
Labels
component: NewGRF This issue is related to NewGRFs flyspray This issue is imported from FlySpray (https://bugs.openttd.org/)

Comments

@DorpsGek
Copy link
Member

Simons_Mith opened the ticket and wrote:

1.4.0-beta 2, Mac OS 10.5.8.

Hey, I think this is my first ever crash bug! A testament to the high quality of your normal work. I flagged it as high because it's an actual crash bug, albeit under quite contrived circumstances - lemme know if you have different preferences. Ta.

Reproduction is reasonably plainless. I'm presuming it's not FIRS-specific, even though FIRS is where I encountered it.

Find a coal mine. And a scrap yard. Build a road vehicle line from Scrap yard to coal mine, and transfer scrap metal using road vehicles with Transfer and Leave Empty orders. Build a train station at the coal mine. Contrive for the coal train to fill up with coal and leave before the first scrap transfer arrives.

Give the train orders to Full load with refit to available cargo.

On its first trip, that's pure coal. For the second trip, it has coal plus scrap available, but instead of refitting, it dies with an assertion failure. The saved game I'm attaching crashes for me as soon as the coal train returns to collect its second load.

I suspect it's the combination of a transfer plus an auto-refit that the problematic part. I doubt it's FIRS, coal, or scrap metal specific.

Attachments

Reported version: other
Operating system: Mac OS X


This issue was imported from FlySpray: https://bugs.openttd.org/task/5861
@DorpsGek
Copy link
Member Author

Alberth wrote:

It crashes with an assert failure:
~/openttd/play/src/economy.cpp:1325: void ReserveConsist(Station*, Vehicle*, CargoArray*, StationIDStack): Assertion `v->cargo_cap >= v->cargo.RemainingCount()' failed.

# 7 0x00007fe3c8a6ec62 in __assert_fail () from /lib64/libc.so.6
# 8 0x000000000077202b in ReserveConsist (st=0x1f2d280, u=0x19d5440, consist_capleft=0x0, next_station=...) at ~/openttd/play/src/economy.cpp:1325
# 9 0x0000000000772b9f in LoadUnloadVehicle (front=0x19d5440) at ~/openttd/play/src/economy.cpp:1459
# 10 0x0000000000773cd6 in LoadUnloadStation (st=0x1f2d280) at ~/openttd/play/src/economy.cpp:1778
# 11 0x0000000000a9ef82 in CallVehicleTicks () at ~/openttd/play/src/vehicle.cpp:879
# 12 0x00000000008f063b in StateGameLoop () at ~/openttd/play/src/openttd.cpp:1386
# 13 0x00000000008f0985 in GameLoop () at ~/openttd/play/src/openttd.cpp:1480
# 14 0x0000000000ab8840 in VideoDriver_SDL::MainLoop (this=0x177d400) at ~/openttd/play/src/video/sdl_v.cpp:776
# 15 0x00000000008eecf2 in openttd_main (argc=1, argv=0x7fff8d649878) at ~/openttd/play/src/openttd.cpp:869
# 16 0x000000000090426b in main (argc=1, argv=0x7fff8d649878) at ~/openttd/play/src/os/unix/unix.cpp:275

Looks like the same kind of crash as in #5828


This comment was imported from FlySpray: https://bugs.openttd.org/task/5861#comment12913

@DorpsGek
Copy link
Member Author

fonsinchen wrote:

Thanks for the report. This should fix it: ulfhermann/openttd@3a3abae


This comment was imported from FlySpray: https://bugs.openttd.org/task/5861#comment12914

@DorpsGek
Copy link
Member Author

fonsinchen closed the ticket.

Reason for closing: Fixed

in r26236


This comment was imported from FlySpray: https://bugs.openttd.org/task/5861

@DorpsGek DorpsGek added flyspray This issue is imported from FlySpray (https://bugs.openttd.org/) component: NewGRF This issue is related to NewGRFs bug labels Apr 7, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
component: NewGRF This issue is related to NewGRFs flyspray This issue is imported from FlySpray (https://bugs.openttd.org/)
Projects
None yet
Development

No branches or pull requests

1 participant