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

Multiplayer bankruptcy assertion #4464

Closed
DorpsGek opened this issue Feb 4, 2011 · 5 comments
Closed

Multiplayer bankruptcy assertion #4464

DorpsGek opened this issue Feb 4, 2011 · 5 comments
Labels
flyspray This issue is imported from FlySpray (https://bugs.openttd.org/)

Comments

@DorpsGek
Copy link
Member

DorpsGek commented Feb 4, 2011

jklamo opened the ticket and wrote:

Game crashed in multiplayer, after one company sent to another large sum of money. I am not sure if crashed only client or also server.

Attachments

Reported version: 1.1.0-beta4
Operating system: All


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

DorpsGek commented Feb 4, 2011

Terkhen wrote:

kernel32.dll!7c812afb()
[Los marcos siguientes pueden no ser correctos o faltar, no se han cargado símbolos para kernel32.dll]
OpenTTD.exe!CustomAbort(int signal) Línea 547 C++
OpenTTD.exe!raise(int signum) Línea 590 + 0x4 Bytes C
OpenTTD.exe!abort() Línea 71 + 0x7 Bytes C
OpenTTD.exe!error(const char * s, ...) Línea 127 C++
OpenTTD.exe!SetLocalCompany(Owner new_company) Línea 104 C++
OpenTTD.exe!NetworkClientsToSpectators(Owner cid) Línea 1149 C++
OpenTTD.exe!ChangeOwnershipOfCompanyItems(Owner old_owner, Owner new_owner) Línea 293 C++
OpenTTD.exe!CompanyCheckBankrupt(Company * c) Línea 535 C++
OpenTTD.exe!CompaniesGenStatistics() Línea 572 + 0x7 Bytes C++
OpenTTD.exe!OnNewMonth() Línea 235 + 0x5 Bytes C++
OpenTTD.exe!IncreaseDate() Línea 295 C++
OpenTTD.exe!StateGameLoop() Línea 1272 C++
OpenTTD.exe!ClientNetworkGameSocketHandler::GameLoop() Línea 242 C++
OpenTTD.exe!NetworkGameLoop() Línea 983 + 0x5 Bytes C++
OpenTTD.exe!GameLoop() Línea 1350 C++
OpenTTD.exe!VideoDriver_Win32::MainLoop() Línea 887 C++
OpenTTD.exe!ttd_main(int argc, char * * argv) Línea 764 C++
OpenTTD.exe!WinMain(HINSTANCE__ * hInstance, HINSTANCE__ * hPrevInstance, char * lpCmdLine, int nCmdShow) Línea 431 + 0x9 Bytes C++
OpenTTD.exe!__tmainCRTStartup() Línea 263 + 0x1b Bytes C
kernel32.dll!7c817077()


This comment was imported from FlySpray: https://bugs.openttd.org/task/4464#comment9589

@DorpsGek
Copy link
Member Author

DorpsGek commented Feb 4, 2011

Rubidium wrote:

Assertion happens when the local company gets bankrupted.


This comment was imported from FlySpray: https://bugs.openttd.org/task/4464#comment9590

@DorpsGek
Copy link
Member Author

DorpsGek commented Feb 4, 2011

Rubidium wrote:

This one is tricky; solving this assertion is relatively easy by just calling the method with the assumed company, thus like in the attached patch.

What this does, though... is simply trading it for another assertion:
src/openttd.cpp:1224: void StateGameLoop(): Assertion `IsLocalCompany()' failed.

# 0 0x00002aaaadc00165 in raise (sig=) at ../nptl/sysdeps/unix/sysv/linux/raise.c:64
# 1 0x00002aaaadc02f70 in abort () at abort.c:92
# 2 0x00002aaaadbf92b1 in __assert_fail (assertion=0xaa2190 "IsLocalCompany()", file=,
line=1224, function=0xaa5580 "void StateGameLoop()") at assert.c:81
# 3 0x000000000079de84 in StateGameLoop () at /home/rubidium/openttd/clean/src/openttd.cpp:1224
# 4 0x00000000007249f6 in NetworkGameLoop () at /home/rubidium/openttd/clean/src/network/network.cpp:968
# 5 0x000000000079e065 in GameLoop () at /home/rubidium/openttd/clean/src/openttd.cpp:1288
# 6 0x00000000008ff5cf in VideoDriver_SDL::MainLoop (this=0x11a6e30)
at /home/rubidium/openttd/clean/src/video/sdl_v.cpp:577
# 7 0x000000000079c9b4 in ttd_main (argc=1, argv=0x7fffffffe3f8) at /home/rubidium/openttd/clean/src/openttd.cpp:761
# 8 0x00000000007b12b3 in main (argc=1, argv=0x7fffffffe3f8)
at /home/rubidium/openttd/clean/src/os/unix/unix.cpp:266

The problem here is that whatever we do to current company in that part of the state game loop gets reset to the company it used to be. Effectively (re)setting the current company to an invalid company. Even then, the company used to be set to the local company but as that was changed it's not anymore and thus triggers the assertion.

How to actually solve this without making a mess of stuff is something I don't really have an idea about yet.

Attachments


This comment was imported from FlySpray: https://bugs.openttd.org/task/4464#comment9591

@DorpsGek
Copy link
Member Author

DorpsGek commented Feb 5, 2011

Rubidium wrote:

Changing the DoCommand to a DoCommandP triggers company_cmd.cpp:107: void SetLocalCompany(CompanyID): Assertion `IsLocalCompany()' failed. as well.

You can trigger this assert with a normal server:
* high frame freq
* spectate
* reset_company 1
* move 1 1 (before the command is actually executed)
-> assert


This comment was imported from FlySpray: https://bugs.openttd.org/task/4464#comment9595

@DorpsGek
Copy link
Member Author

DorpsGek commented Feb 5, 2011

Rubidium closed the ticket.

Reason for closing: Fixed

In r21970


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

@DorpsGek DorpsGek closed this as completed Feb 5, 2011
@DorpsGek DorpsGek added Core flyspray This issue is imported from FlySpray (https://bugs.openttd.org/) labels Apr 7, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
flyspray This issue is imported from FlySpray (https://bugs.openttd.org/)
Projects
None yet
Development

No branches or pull requests

1 participant