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

Program crashes when opening Game Options #7494

Closed
nikolas opened this issue Apr 10, 2019 · 2 comments
Closed

Program crashes when opening Game Options #7494

nikolas opened this issue Apr 10, 2019 · 2 comments
Labels
bug

Comments

@nikolas
Copy link
Member

@nikolas nikolas commented Apr 10, 2019

Version of OpenTTD

master 01f957c

Expected result

No crash

Actual result

$ ./bin/openttd
Crash encountered, generating crash log...
*** OpenTTD Crash Report ***

Crash at: Wed Apr 10 13:25:27 2019
In game date: 2051-05-09 (27)

Crash reason:
 Signal:  Segmentation fault (11)
 Message: <none>

OpenTTD version:
 Version:    20190409-master-g01f957c51f (0)
 NewGRF ver: 1a006d64
 Bits:       64
 Endian:     little
 Dedicated:  no
 Build date: Apr 10 2019 09:21:03

Stacktrace:
 [00] ./bin/openttd(_ZNK12CrashLogUnix13LogStacktraceEPcPKc+0x40) [0x55825ad889d0]
 [01] ./bin/openttd(_ZNK8CrashLog12FillCrashLogEPcPKc+0xf0) [0x55825ac4d990]
 [02] ./bin/openttd(_ZNK8CrashLog12MakeCrashLogEv+0x63) [0x55825ac4dc13]
 [03] ./bin/openttd(+0x3a68f5) [0x55825ad888f5]
 [04] /lib/x86_64-linux-gnu/libc.so.6(+0x37940) [0x7f5e02845940]
 [05] ./bin/openttd(_ZN22DropDownListStringItem11NatSortFuncERKSt10unique_ptrIK16DropDownListItemSt14default_deleteIS2_EES7_+0x12) [0x55825af06852]
 [06] ./bin/openttd(_ZSt16__introsort_loopIN9__gnu_cxx17__normal_iteratorIPSt10unique_ptrIK16DropDownListItemSt14default_deleteIS4_EESt6vectorIS7_SaIS7_EEEElNS0_5__ops15_Iter_comp_iterIPFiRKS7_SG_EEEEvT_SK_T0_T1_+0xad) [0x55825ae3572d]
 [07] ./bin/openttd(_ZNK17GameOptionsWindow17BuildDropDownListEiPi+0x531) [0x55825ae35e41]
 [08] ./bin/openttd(_ZN17GameOptionsWindow16UpdateWidgetSizeEiP9DimensionRKS0_S1_S1_+0x3ac) [0x55825ae36c5c]
 [09] ./bin/openttd(_ZN11NWidgetLeaf17SetupSmallestSizeEP6Windowb+0x542) [0x55825af01002]
 [10] ./bin/openttd(_ZN15NWidgetVertical17SetupSmallestSizeEP6Windowb+0x57) [0x55825aeffd77]
 [11] ./bin/openttd(_ZN17NWidgetBackground17SetupSmallestSizeEP6Windowb+0x44) [0x55825af00884]
 [12] ./bin/openttd(_ZN15NWidgetVertical17SetupSmallestSizeEP6Windowb+0x57) [0x55825aeffd77]
 [13] ./bin/openttd(_ZN17NWidgetHorizontal17SetupSmallestSizeEP6Windowb+0x57) [0x55825aeffb67]
 [14] ./bin/openttd(_ZN15NWidgetVertical17SetupSmallestSizeEP6Windowb+0x57) [0x55825aeffd77]
 [15] ./bin/openttd(_ZN17NWidgetBackground17SetupSmallestSizeEP6Windowb+0x44) [0x55825af00884]
 [16] ./bin/openttd(_ZN15NWidgetVertical17SetupSmallestSizeEP6Windowb+0x57) [0x55825aeffd77]
 [17] ./bin/openttd(_ZN6Window14InitializeDataEi+0x15e) [0x55825af0a7ce]
 [18] ./bin/openttd(_ZN6Window16FinishInitNestedEi+0x10) [0x55825af0af60]
 [19] ./bin/openttd(_Z15ShowGameOptionsv+0x81) [0x55825ae2cde1]
 [20] ./bin/openttd(_Z17HandleMouseEventsv+0x1681) [0x55825af0e761]
 [21] ./bin/openttd(_ZN15VideoDriver_SDL9PollEventEv+0xe8) [0x55825aee2208]
 [22] ./bin/openttd(_ZN15VideoDriver_SDL8MainLoopEv+0x90) [0x55825aee2510]
 [23] ./bin/openttd(_Z12openttd_mainiPPc+0x1500) [0x55825ad77cc0]
 [24] /lib/x86_64-linux-gnu/libc.so.6(__libc_start_main+0xeb) [0x7f5e0283209b]
 [25] ./bin/openttd(_start+0x2a) [0x55825ab9843a]

Operating system:
 Name:     Linux
 Release:  5.0.7
 Version:  #14 SMP Tue Apr 9 21:50:51 EDT 2019
 Machine:  x86_64
 Compiler: GCC 8.3.0 "8.3.0"

Configuration:
 Blitter:      32bpp-sse2-anim
 Graphics set: original_windows (0)
 Language:     /home/nik/src/OpenTTD/bin/lang/spanish_MX.lng
 Music driver: fluidsynth
 Music set:    original_windows (1)
 Network:      no
 Sound driver: sdl
 Sound set:    original_windows (0)
 Video driver: sdl

Fonts:
 Small:  sprite
 Medium: sprite
 Large:  sprite
 Mono:   sprite

AI Configuration (local: 0) (current: 0):
  0: Human

Libraries:
 FontConfig: 2.13.1
 FreeType:   2.9.1
 ICU i18n:   63.1
 LZMA:       5.2.4
 LZO:        2.10
 PNG:        1.6.36
 SDL:        1.2.15
 Zlib:       1.2.11

---- gamelog start ----
Tick 62675: game loaded
Conversion from OTTD savegame without gamelog: version 4, 1
Revision text changed to g01f957c51fcb2, savegame version 213, not modified, _openttd_newgrf_version = 0x1a006d64     
New game mode: 0 landscape: 1
---- gamelog end ----

Recent news messages:

*** End of OpenTTD Crash Report ***

Crash log generated.

Writing crash log to disk...
Crash log written to /home/nik/.openttd/crash.log. Please add this file to any bug reports.                           

Writing crash savegame...
ALSA lib pcm.c:8424:(snd_pcm_recover) underrun occurred
Crash savegame written to /home/nik/.openttd/crash.sav. Please add this file and the last (auto)save to any bug reports.

Writing crash screenshot...
Crash screenshot written to /home/nik/.openttd/crash.png. Please add this file to any bug reports.                    

Aborted

Steps to reproduce

  • Run OpenTTD
  • Click on "game options"

I can also reproduce this crash by opening Game Options from within an OpenTTD game.

I'm on Debian buster/testing, with game language set to Mexican Spanish. I usually have the language set to English. Right now I can't go into the game options to change it back to English to test that as well.

@nikolas nikolas changed the title Program crashes when opening Game Options on title screen Program crashes when opening Game Options Apr 10, 2019
@glx22 glx22 added the bug label Apr 10, 2019
@glx22
Copy link
Contributor

@glx22 glx22 commented Apr 10, 2019

Debug Assertion Failed!

Program: ...t\GitHub\glx22\OpenTTD\projects..\objs\x64\Debug\openttd.exe
File: C:\Program Files (x86)\Microsoft Visual Studio\2019\Community\VC\Tools\MSVC\14.20.27508\include\xutility
Line: 632

Expression: invalid comparator

For information on how your program can cause an assertion
failure, see the Visual C++ documentation on asserts.

(Press Retry to debug the application)

 	openttd.exe!std::_Debug_lt_pred<int (__cdecl*&)(std::unique_ptr<DropDownListItem const ,std::default_delete<DropDownListItem const > > const &,std::unique_ptr<DropDownListItem const ,std::default_delete<DropDownListItem const > > const &),std::unique_ptr<DropDownListItem const ,std::default_delete<DropDownListItem const > > &,std::unique_ptr<DropDownListItem const ,std::default_delete<DropDownListItem const > > &>(int(*)(const std::unique_ptr<DropDownListItem const ,std::default_delete<DropDownListItem const > > &, const std::unique_ptr<DropDownListItem const ,std::default_delete<DropDownListItem const > > &) & _Pred, std::unique_ptr<DropDownListItem const ,std::default_delete<DropDownListItem const > > & _Left, std::unique_ptr<DropDownListItem const ,std::default_delete<DropDownListItem const > > & _Right) Ligne 632	C++
 	openttd.exe!std::_Insertion_sort_unchecked<std::unique_ptr<DropDownListItem const ,std::default_delete<DropDownListItem const > > *,int (__cdecl*)(std::unique_ptr<DropDownListItem const ,std::default_delete<DropDownListItem const > > const &,std::unique_ptr<DropDownListItem const ,std::default_delete<DropDownListItem const > > const &)>(std::unique_ptr<DropDownListItem const ,std::default_delete<DropDownListItem const > > * _First, std::unique_ptr<DropDownListItem const ,std::default_delete<DropDownListItem const > > * const _Last, int(*)(const std::unique_ptr<DropDownListItem const ,std::default_delete<DropDownListItem const > > &, const std::unique_ptr<DropDownListItem const ,std::default_delete<DropDownListItem const > > &) _Pred) Ligne 3211	C++
 	openttd.exe!std::_Sort_unchecked<std::unique_ptr<DropDownListItem const ,std::default_delete<DropDownListItem const > > *,int (__cdecl*)(std::unique_ptr<DropDownListItem const ,std::default_delete<DropDownListItem const > > const &,std::unique_ptr<DropDownListItem const ,std::default_delete<DropDownListItem const > > const &)>(std::unique_ptr<DropDownListItem const ,std::default_delete<DropDownListItem const > > * _First, std::unique_ptr<DropDownListItem const ,std::default_delete<DropDownListItem const > > * _Last, __int64 _Ideal, int(*)(const std::unique_ptr<DropDownListItem const ,std::default_delete<DropDownListItem const > > &, const std::unique_ptr<DropDownListItem const ,std::default_delete<DropDownListItem const > > &) _Pred) Ligne 3351	C++
 	openttd.exe!std::sort<std::_Vector_iterator<std::_Vector_val<std::_Simple_types<std::unique_ptr<DropDownListItem const ,std::default_delete<DropDownListItem const > > > > >,int (__cdecl*)(std::unique_ptr<DropDownListItem const ,std::default_delete<DropDownListItem const > > const &,std::unique_ptr<DropDownListItem const ,std::default_delete<DropDownListItem const > > const &)>(const std::_Vector_iterator<std::_Vector_val<std::_Simple_types<std::unique_ptr<DropDownListItem const ,std::default_delete<DropDownListItem const > > > > > _First, const std::_Vector_iterator<std::_Vector_val<std::_Simple_types<std::unique_ptr<DropDownListItem const ,std::default_delete<DropDownListItem const > > > > > _Last, int(*)(const std::unique_ptr<DropDownListItem const ,std::default_delete<DropDownListItem const > > &, const std::unique_ptr<DropDownListItem const ,std::default_delete<DropDownListItem const > > &) _Pred) Ligne 3358	C++
>	openttd.exe!GameOptionsWindow::BuildDropDownList(int widget, int * selected_index) Ligne 266	C++
 	openttd.exe!GameOptionsWindow::UpdateWidgetSize(int widget, Dimension * size, const Dimension & padding, Dimension * fill, Dimension * resize) Ligne 421	C++
 	openttd.exe!NWidgetLeaf::SetupSmallestSize(Window * w, bool init_array) Ligne 2385	C++
 	openttd.exe!NWidgetVertical::SetupSmallestSize(Window * w, bool init_array) Ligne 1312	C++
 	openttd.exe!NWidgetBackground::SetupSmallestSize(Window * w, bool init_array) Ligne 1766	C++
 	openttd.exe!NWidgetVertical::SetupSmallestSize(Window * w, bool init_array) Ligne 1312	C++
 	openttd.exe!NWidgetHorizontal::SetupSmallestSize(Window * w, bool init_array) Ligne 1147	C++
 	openttd.exe!NWidgetVertical::SetupSmallestSize(Window * w, bool init_array) Ligne 1312	C++
 	openttd.exe!NWidgetBackground::SetupSmallestSize(Window * w, bool init_array) Ligne 1766	C++
 	openttd.exe!NWidgetVertical::SetupSmallestSize(Window * w, bool init_array) Ligne 1312	C++
 	openttd.exe!Window::InitializeData(int window_number) Ligne 1461	C++
 	openttd.exe!Window::FinishInitNested(int window_number) Ligne 1831	C++
 	openttd.exe!Window::InitNested(int window_number) Ligne 1845	C++
 	openttd.exe!GameOptionsWindow::GameOptionsWindow(WindowDesc * desc) Ligne 187	C++
 	openttd.exe!ShowGameOptions() Ligne 692	C++
 	openttd.exe!SelectGameWindow::OnClick(Point pt, int widget, int click_count) Ligne 147	C++
 	openttd.exe!DispatchLeftClickEvent(Window * w, int x, int y, int click_count) Ligne 760	C++
 	openttd.exe!MouseLoop(MouseClick click, int mousewheel) Ligne 2935	C++
 	openttd.exe!HandleMouseEvents() Ligne 3036	C++
 	openttd.exe!WndProcGdi(HWND__ * hwnd, unsigned int msg, unsigned __int64 wParam, __int64 lParam) Ligne 695	C++
 	[Code externe]	
 	openttd.exe!VideoDriver_Win32::MainLoop() Ligne 1235	C++
 	openttd.exe!openttd_main(int argc, char * * argv) Ligne 859	C++
 	openttd.exe!WinMain(HINSTANCE__ * hInstance, HINSTANCE__ * hPrevInstance, char * lpCmdLine, int nCmdShow) Ligne 444	C++
 	[Code externe]	

@glx22
Copy link
Contributor

@glx22 glx22 commented Apr 10, 2019

If I understand correctly, the assert means DropDownListStringItem::NatSortFunc(a, b) != !DropDownListStringItem::NatSortFunc(b, a)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug
Projects
None yet
Development

No branches or pull requests

2 participants