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

Immediate crash on new game after changing AI available vehicles #3857

Closed
DorpsGek opened this issue May 24, 2010 · 7 comments
Closed

Immediate crash on new game after changing AI available vehicles #3857

DorpsGek opened this issue May 24, 2010 · 7 comments
Labels
flyspray This issue is imported from FlySpray (https://bugs.openttd.org/)

Comments

@DorpsGek
Copy link
Member

arie_ opened the ticket and wrote:

First what I think I did:
I was trying NoCAB to see what kind of networks the AI would build. So i started a game with two AI's. After 2 decades or so i noticed it had not constructed rails and trains and I wanted to see what the rail networks would look like. To force the AI to build rail networks I fiddled around with the allowed numbers of vehicles for the different categories and (I think) later I turned off a roads and ships being available for the AI's ingame. Then, after thinking it did not work, I decided to stop the current game and start a new one with changed advanced settings beforehand. I started the new game and the game immediately crashed.

The fault message:
- Message: Assertion failed at line 666 of ..\src\command.cpp: cmd_id == CMD_COMPANY_CTRL || old_company == _current_company

The problems with my report:
- because i wanted to see what happened i could not remember my exact steps but i think it went as stated above
- due to testing i do not have the openttd.cfg with settings before and after the crash, so no comparison there
- no crash.sav
- not been able to reproduce (trunk / 1.0.1 / 1.0.1-rc2)
- it occurred in 1.0.1-RC2 so the bug might already been caught (but again, I could not reproduce the bug)
- with my little coding knowledge I doubt whether the title covers the issue and cause

What I searched for:
- Command.cpp + 666 -> gave no similar bugs (also searched through closed bugs)
- _current_company -> FS3804 might be related? But i do not have knowledge on these things

Other:
- The three fixed bugs according to the changelog for 1.0.1 compared to 1.0.1-rc2 do seem to be similar bugs (I think)

Attachments

Reported version: other
Operating system: All


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

glx wrote:

kernel32.dll!_RaiseException@16() + 0x52 octets
openttd.exe!CustomAbort(int signal=0x00000016) Ligne 417 C++
openttd.exe!raise(int signum=0x00000016) Ligne 590 + 0x4 octets C
openttd.exe!abort() Ligne 71 + 0x7 octets C
openttd.exe!error(const char * s=0x006d2528, ...) Ligne 131 C++
openttd.exe!DoCommandPInternal(unsigned int tile=0x00000000, unsigned int p1=0x00000001, unsigned int p2=0x00000001, unsigned int cmd=0x00000040, void (const CommandCost &, unsigned int, unsigned int, unsigned int)* callback=0x00000000, const char * text=0x00000000, bool my_cmd=true, bool estimate_only=false) Ligne 583 C++
openttd.exe!DoCommandP(unsigned int tile=0x00000000, unsigned int p1=0x00000001, unsigned int p2=0x00000001, unsigned int cmd=0x00000040, void (const CommandCost &, unsigned int, unsigned int, unsigned int)* callback=0x00000000, const char * text=0x00000000, bool my_cmd=true) Ligne 524 C++
openttd.exe!_GenerateWorld(void * __formal=0x00000000) Ligne 182 C++
openttd.exe!ThreadObject_Win32::ThreadProc() Ligne 65535 C++
openttd.exe!ThreadObject_Win32::stThreadProc(void * thr=0x01c60510) Ligne 77 C++
openttd.exe!_callthreadstartex() Ligne 348 + 0x6 octets C
openttd.exe!_threadstartex(void * ptd=0x0343d0a0) Ligne 326 + 0x5 octets C
kernel32.dll!_BaseThreadStart@8() + 0x37 octets


This comment was imported from FlySpray: https://bugs.openttd.org/task/3857#comment8090

@DorpsGek
Copy link
Member Author

SmatZ wrote:

Command 0x40 is CMD_PAUSE. Looks like a race condition somewhere...


This comment was imported from FlySpray: https://bugs.openttd.org/task/3857#comment8092

@DorpsGek
Copy link
Member Author

Rubidium wrote:

I'm wondering whether it's caused by the same issue as #3707.


This comment was imported from FlySpray: https://bugs.openttd.org/task/3857#comment8094

@DorpsGek
Copy link
Member Author

arie_ wrote:

Ok, maybe some additional information:
- The maps I play are smaller than 2048 * 2048
- Initially i know the newgrfs included 2cc (1.0.1 I think), but I removed these later because NoCAB only works with the standard train set. One issue though, I'm not sure whether I removed 2cc during those two games or at a later moment.
- OS is XP sp3 English; PROC XP 1800+; 1GB ram (2 * 256MB + 1 * 512MB, the occasional expansion caused the strange combination).
- I'll try to do some # 3707 stuff and see whether the behaviour matches. However, the game did not hang for me, it really crashed and gave me a windows looking error box with the red round circle and a white cross in it and, I'm not sure on this last part, the box containing that assertion message.

edit:
- Oh and i cannot remember me pushing the pause button or key.


This comment was imported from FlySpray: https://bugs.openttd.org/task/3857#comment8095

@DorpsGek
Copy link
Member Author

DorpsGek commented Jun 5, 2010

frosch wrote:

_GenerateWorld() calls CleanupGeneration() before issueing the CMD_PAUSE. So it is possible that functions like HandleMouseEvents() are run in parallel, which would change _current_company for < r19933.
For >= r19933 the assertion in InputLoop(), HandleMouseEvents() would likely get triggered instead of the command.cpp assertion.


This comment was imported from FlySpray: https://bugs.openttd.org/task/3857#comment8118

@DorpsGek
Copy link
Member Author

DorpsGek commented Jun 5, 2010

frosch wrote:

Easily reproducible with attached patch (against 1.0 branch).
Enable 'pause on new game', start a new game, and keep on moving the mouse.

Attachments


This comment was imported from FlySpray: https://bugs.openttd.org/task/3857#comment8119

@DorpsGek
Copy link
Member Author

DorpsGek commented Jun 5, 2010

frosch closed the ticket.

Reason for closing: Fixed

in r19934


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

@DorpsGek DorpsGek closed this as completed Jun 5, 2010
@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