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

OpenTTD is crashed after hours of playing #8129

Closed
kkkozlov opened this issue May 9, 2020 · 3 comments
Closed

OpenTTD is crashed after hours of playing #8129

kkkozlov opened this issue May 9, 2020 · 3 comments

Comments

@kkkozlov
Copy link

kkkozlov commented May 9, 2020

Version of OpenTTD

Version: 1.10.1 (0)

Expected result

Normal work

Actual result

Crash dump

Steps to reproduce

cannot reproduce

After some times of playing i got message that OpenTTD is crashed.
I add all necessary information in archive.
OpenTTD.zip

@glx22
Copy link
Contributor

glx22 commented May 9, 2020

>	openttd.exe!NewsWindow::NewsWindow(WindowDesc * desc, const NewsItem * ni) Ligne 276	C++
 	openttd.exe!ShowNewspaper(const NewsItem * ni) Ligne 613	C++
 	openttd.exe!MoveToNextNewsItem() Ligne 731	C++
 	openttd.exe!DeleteNewsItem(NewsItem * ni) Ligne 763	C++
 	openttd.exe!AddNewsItem(unsigned int string, NewsType type, NewsFlag flags, NewsReferenceType reftype1, unsigned int ref1, NewsReferenceType reftype2, unsigned int ref2, void * free_data) Ligne 830	C++
 	[Cadre en ligne] openttd.exe!AddVehicleAdviceNewsItem(unsigned int) Ligne 42	C++
 	openttd.exe!AgeVehicle(Vehicle * v) Ligne 1366	C++
 	openttd.exe!RoadVehicle::OnNewDay() Ligne 1699	C++
 	[Cadre en ligne] openttd.exe!RunVehicleDayProc() Ligne 936	C++
 	openttd.exe!CallVehicleTicks() Ligne 944	C++
 	openttd.exe!StateGameLoop() Ligne 1382	C++
 	openttd.exe!NetworkGameLoop() Ligne 984	C++
 	openttd.exe!GameLoop() Ligne 1461	C++
 	openttd.exe!VideoDriver_Win32::MainLoop() Ligne 1264	C++
 	openttd.exe!openttd_main(int argc, char * * argv) Ligne 860	C++
 	openttd.exe!WinMain(HINSTANCE__ * hInstance, HINSTANCE__ * hPrevInstance, char * lpCmdLine, int nCmdShow) Ligne 442	C++
 	[Code externe]	

@frosch123
Copy link
Member

The game just reached ending_year, and the EndGameWindow is shown.
In single player it pauses the game, but it doesn't in multiplayer.
While the EndGameWindow is shown, no statusbar/toolbar exists, so the next news message crashes the game.

LordAro added a commit to LordAro/OpenTTD that referenced this issue Jun 27, 2020
@LordAro
Copy link
Member

LordAro commented Jun 27, 2020

OpenTTD/src/news_gui.cpp

Lines 998 to 1001 in b84d61e

/* There is no status bar, so no reason to show news;
* especially important with the end game screen when
* there is no status bar but possible news. */
if (FindWindowById(WC_STATUS_BAR, 0) == nullptr) return;

Well it's supposed to catch it...

But because MoveToNextNewsItem is called from DeleteNewsItem, it circumvents that check

LordAro added a commit to LordAro/OpenTTD that referenced this issue Jul 30, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants