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

[Crash]: Game crash after ~ 1 min. #9708

Closed
maaaaaaaaaad opened this issue Nov 18, 2021 · 11 comments
Closed

[Crash]: Game crash after ~ 1 min. #9708

maaaaaaaaaad opened this issue Nov 18, 2021 · 11 comments

Comments

@maaaaaaaaaad
Copy link

Version of OpenTTD

12.1

Steps to reproduce

After running the save game for ~ 1 minute the game crashed even without any interaction on my part. I haven't experienced this issue with any of the previous releases on the same save game. The save file is 26 MB so I'm unable to upload it below but please let me know if there's another way to share it.

Thank you for all the hard work, I've been playing TTD and OPENTTD since 94

Upload crash files

crash.log
crash

@James103
Copy link
Contributor

Can you please try uploading the saved game to Google Drive, Dropbox, or Mediafire, make the download link public, and share it?

@maaaaaaaaaad
Copy link
Author

@James103
Copy link
Contributor

Can you please attach any instances of WAS.grf that you can find in your newgrf folder (zip first if uploading to GitHub)?
That GRF file is missing on my end and is missing on BaNaNaS.

@maaaaaaaaaad
Copy link
Author

maaaaaaaaaad commented Nov 18, 2021

@LordAro
Copy link
Member

LordAro commented Nov 18, 2021

@James103 Please do not ask people to upload GRFs here - we do not have the license to distribute them outside of BaNaNaS , and if they're not on BaNaNaS, they should not be shared. If it's otherwise missing, you need to go digging for it elsewhere ;)

I've replaced the link with the actual download link

@James103
Copy link
Contributor

I'm really sorry about that. I will make sure to not do that next time.

@LordAro
Copy link
Member

LordAro commented Nov 18, 2021

Yeah, the crash.sav is very much unsalvageable - @maaaaaaaaaad can you upload the save you have from before the crash? I can't promise anything, but it will at least be more useful for diagnosing the crash you get

@LordAro
Copy link
Member

LordAro commented Nov 18, 2021

Backtrace from the crash.sav:

0x00007ff6f49459df in LinkRefresher::RefreshStats (this=0x669fff2f0,
    cur=0x1f3f63a0fe0, next=0x1f3f63a1030)
    at C:/msys64/home/LordAro/OpenTTD/src/linkgraph/refresh.cpp:225
225                             uint32 time_estimate = (st_to != nullptr) ?
(gdb) bt
#0  0x00007ff6f49459df in LinkRefresher::RefreshStats (this=0x669fff2f0,
    cur=0x1f3f63a0fe0, next=0x1f3f63a1030)
    at C:/msys64/home/LordAro/OpenTTD/src/linkgraph/refresh.cpp:225
#1  0x00007ff6f49460ca in LinkRefresher::RefreshLinks (this=0x669fff2f0,
    cur=0x1f3f63a0fe0, next=0x1f3f63a1030, flags=2 '\002', num_hops=0)
    at C:/msys64/home/LordAro/OpenTTD/src/linkgraph/refresh.cpp:318
#2  0x00007ff6f4944f2e in LinkRefresher::Run (v=0x1f3f5c2b0c0,
    allow_merge=false, is_full_loading=false)
    at C:/msys64/home/LordAro/OpenTTD/src/linkgraph/refresh.cpp:38
#3  0x00007ff6f4c7f2ee in DeleteStaleLinks (from=0x1f382d8d6b0)
    at C:/msys64/home/LordAro/OpenTTD/src/station_cmd.cpp:3691
#4  0x00007ff6f4c7fd38 in OnTick_Station ()
    at C:/msys64/home/LordAro/OpenTTD/src/station_cmd.cpp:3829
#5  0x00007ff6f4b19235 in CallLandscapeTick ()
    at C:/msys64/home/LordAro/OpenTTD/src/landscape.cpp:1523
#6  0x00007ff6f4b991e5 in StateGameLoop ()
    at C:/msys64/home/LordAro/OpenTTD/src/openttd.cpp:1373
#7  0x00007ff6f4b99668 in GameLoop ()
    at C:/msys64/home/LordAro/OpenTTD/src/openttd.cpp:1468
#8  0x00007ff6f4a479e7 in VideoDriver::GameLoop (this=0x1f3bb8f9cc0)
    at C:/msys64/home/LordAro/OpenTTD/src/video/video_driver.cpp:37
#9  0x00007ff6f4a47a40 in VideoDriver::GameThread (this=0x1f3bb8f9cc0)
    at C:/msys64/home/LordAro/OpenTTD/src/video/video_driver.cpp:44
#10 0x00007ff6f4a47b49 in VideoDriver::GameThreadThunk (drv=0x1f3bb8f9cc0)
    at C:/msys64/home/LordAro/OpenTTD/src/video/video_driver.cpp:81
#11 0x00007ff6f522df1e in StartNewThread<void (*)(VideoDriver*), VideoDriver*>(std::thread*, char const*, void (*&&)(VideoDriver*), VideoDriver*&&)::{lambda(char const*, void (*&&)(VideoDriver*), VideoDriver*&&)#1}::operator()(char const*, void (*&&)(VideoDriver*), VideoDriver*&&) const (this=0x1f3bbace5e8,
    name=0x7ff6f569b6fd <MAX_SLE_INT+37> "ottd:game",
    F=@0x1f3bbace5f0: 0x7ff6f4a47b34 <VideoDriver::GameThreadThunk(VideoDriver*)>, A#0=@0x1f3bbace5e8: 0x1f3bb8f9cc0)
    at C:/msys64/home/LordAro/OpenTTD/src/thread.h:65
#12 0x00007ff6f51de383 in std::__invoke_impl<void, StartNewThread<void (*)(VideoDriver*), VideoDriver*>(std::thread*, char const*, void (*&&)(VideoDriver*), VideoDriver*&&)::{lambda(char const*, void (*&&)(VideoDriver*), VideoDriver*&&)#1}, char const*, void (*)(VideoDriver*), VideoDriver*>(std::__invoke_other, StartNewThread<void (*)(VideoDriver*), VideoDriver*>(std::thread*, char const*, void (*&&)(VideoDriver*), VideoDriver*&&)::{lambda(char const*, void (*&&&&)(VideoDriver*), VideoDriver*&&)#1}, char const*&&, void (*&&)(VideoDriver*), VideoDriver*&&) (__f=...) at C:/msys64/mingw64/include/c++/10.3.0/bits/invoke.h:60
#13 0x00007ff6f521c3fb in std::__invoke<StartNewThread<void (*)(VideoDriver*), VideoDriver*>(std::thread*, char const*, void (*&&)(VideoDriver*), VideoDriver*&&)::{lambda(char const*, void (*&&)(VideoDriver*), VideoDriver*&&)#1}, char const*, void (*)(VideoDriver*), VideoDriver*> (__fn=...)
    at C:/msys64/mingw64/include/c++/10.3.0/bits/invoke.h:95
#14 0x00007ff6f50f103b in std::thread::_Invoker<std::tuple<StartNewThread<void (*)(VideoDriver*), VideoDriver*>(std::thread*, char const*, void (*&&)(VideoDriver*), VideoDriver*&&)::{lambda(char const*, void (*&&)(VideoDriver*), VideoDriver*&&)#1}, char const*, void (*)(VideoDriver*), VideoDriver*> >::_M_invoke<0ull, 1ull, 2ull, 3ull>(std::_Index_tuple<0ull, 1ull, 2ull, 3ull>) (
    this=0x1f3bbace5e8) at C:/msys64/mingw64/include/c++/10.3.0/thread:264
#15 0x00007ff6f50f1067 in std::thread::_Invoker<std::tuple<StartNewThread<void (*)(VideoDriver*), VideoDriver*>(std::thread*, char const*, void (*&&)(VideoDriver*), VideoDriver*&&)::{lambda(char const*, void (*&&)(VideoDriver*), VideoDriver*&&)#1}, char const*, void (*)(VideoDriver*), VideoDriver*> >::operator()()
    (this=0x1f3bbace5e8) at C:/msys64/mingw64/include/c++/10.3.0/thread:271
#16 0x00007ff6f50f039c in std::thread::_State_impl<std::thread::_Invoker<std::tuple<StartNewThread<void (*)(VideoDriver*), VideoDriver*>(std::thread*, char const*, void (*&&)(VideoDriver*), VideoDriver*&&)::{lambda(char const*, void (*&&)(VideoDriver*), VideoDriver*&&)#1}, char const*, void (*)(VideoDriver*), VideoDriver*> > >::_M_run() (this=0x1f3bbace5e0)
    at C:/msys64/mingw64/include/c++/10.3.0/thread:215
#17 0x00007ff6f5238531 in execute_native_thread_routine ()
#18 0x00007ff6f4d94e83 in pthread_create_wrapper ()
#19 0x00007ffb91b3af5a in msvcrt!_beginthreadex ()
   from C:\WINDOWS\System32\msvcrt.dll
#20 0x00007ffb91b3b02c in msvcrt!_endthreadex ()
   from C:\WINDOWS\System32\msvcrt.dll
#21 0x00007ffb927e7034 in KERNEL32!BaseThreadInitThunk ()
   from C:\WINDOWS\System32\kernel32.dll
#22 0x00007ffb92d42651 in ntdll!RtlUserThreadStart ()
   from C:\WINDOWS\SYSTEM32\ntdll.dll
#23 0x0000000000000000 in ?? ()

(gdb) p *this->vehicle
$8 = {<Pool<Vehicle, unsigned int, 512, 1044480, (PoolType)1, false, true>::PoolItem<&_vehicle_pool>> = {index = 4026}, <BaseVehicle> = {
    type = VEH_ROAD}, <BaseConsist> = {
    _vptr.BaseConsist = 0x7ff6f5b41b80 <vtable for RoadVehicle+16>,
    name = "", current_order_time = 2730632, lateness_counter = 0,
    timetable_start = 0, service_interval = 360,
    cur_real_order_index = 0 '\000', cur_implicit_order_index = 0 '\000',
    vehicle_flags = 8}, next = 0x0, previous = 0x0, first = 0x1f3f5c2b0c0,
  next_shared = 0x0, previous_shared = 0x0, tile = 14771300,
  dest_tile = 14771300, profit_this_year = {static T_MAX = <optimized out>,
    static T_MIN = <optimized out>, m_value = 0}, profit_last_year = {
    static T_MAX = <optimized out>, static T_MIN = <optimized out>,
    m_value = 0}, value = {static T_MAX = <optimized out>,
    static T_MIN = <optimized out>, m_value = 255}, cargo_payment = 0x0,
  coord = {left = 317648, top = 302684, right = 317735, bottom = 302751},
  hash_viewport_next = 0x0, hash_viewport_prev = 0x1f3f5d390a8,
  hash_tile_next = 0x0, hash_tile_prev = 0x1f3f5d390b8,
  hash_tile_current = 0x7ff6f76cfd00 <_vehicle_tile_hash+23328>,
  colourmap = 0, build_year = 2445, age = 142369, max_age = 9150,
  date_of_last_service = 893043, reliability = 63590,
  reliability_spd_dec = 0, breakdown_ctr = 0 '\000',
  breakdown_delay = 0 '\000', breakdowns_since_last_service = 0 '\000',
  breakdown_chance = 0 '\000', x_pos = 17989, y_pos = 57700, z_pos = 8,
  direction = DIR_NW, owner = OWNER_BEGIN, spritenum = 253 '▒',
  x_extent = 3 '\003', y_extent = 7 '\a', z_extent = 6 '\006',
  x_bb_offs = 0 '\000', y_bb_offs = -1 '▒', x_offs = -1 '▒', y_offs = -3 '▒',
  engine_type = 1106, fill_percent_te_id = 65535, unitnumber = 703,
  cur_speed = 0, subspeed = 87 'W', acceleration = 0 '\000',
  motion_counter = 0, progress = 191 '▒', random_bits = 196 '▒',
  waiting_triggers = 13 '\r', last_station_visited = 6398,
  last_loading_station = 6335, cargo_type = 0 '\000',
  cargo_subtype = 0 '\000', cargo_cap = 100, refit_cap = 100,
  cargo = {<CargoList<VehicleCargoList, std::__cxx11::list<CargoPacket*, std::allocator<CargoPacket*> > >> = {count = 60, cargo_days_in_transit = 15300,
      packets = std::__cxx11::list = {[0] = 0x1f387368a70}}, feeder_share = {
      static T_MAX = <optimized out>, static T_MIN = <optimized out>,
      m_value = 0}, action_counts = {0, 0, 60, 0}}, cargo_age_counter = 97,
  trip_occupancy = 60 '<', day_counter = 33 '!', tick_counter = 116 't',
  running_ticks = 0 '\000', vehstatus = 10 '\n',
  current_order = {<Pool<Order, unsigned int, 256, 16711680, (PoolType)1, false, true>::PoolItem<&_order_pool>> = {index = 0}, type = 195 '▒',
    flags = 0 '\000', dest = 6398, refit_cargo = 254 '▒', wait_time = 0,
    travel_time = 666, max_speed = 65535, next = 0x0}, orders = {
    list = 0x1f3f63eb8b0, old = 0x1f3f63eb8b0}, load_unload_ticks = 9,
  group_id = 65534, subtype = 1 '\001', grf_cache = {
    position_consist_length = 0, position_same_id_length = 0,
    consist_cargo_information = 0, company_information = 0,
    position_in_vehicle = 0, cache_valid = 0 '\000'}, vcache = {
    cached_max_speed = 0, cached_cargo_age_period = 185,
    cached_vis_effect = 64 '@'}, sprite_cache = {last_direction = DIR_BEGIN,
    revalidate_before_draw = false, old_coord = {left = 317648, top = 302684,
      right = 317735, bottom = 302751}, is_viewport_candidate = false,
    sprite_seq = {seq = {{sprite = 3291, pal = 0}, {sprite = 0, pal = 0}, {
          sprite = 0, pal = 0}, {sprite = 0, pal = 0}}, count = 1}}}
(gdb) p this->vehicle->GetDisplayMaxSpeed()
$9 = 0  # <-- ultimate cause of crash

@LordAro
Copy link
Member

LordAro commented Nov 18, 2021

image

@maaaaaaaaaad
Copy link
Author

Hey,
Here's the most recent autosave of the same gameplay.

https://www.dropbox.com/s/apnnynwyfp59u1p/autosave0.sav?dl=0

@2TallTyler
Copy link
Member

This looks to me like a NewGRF was added or removed, making the problem vehicle invalid.

That said, #9693 would avoid this crash.

nchappe added a commit to nchappe/OpenTTD that referenced this issue Oct 29, 2022
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