The International Simutrans Forum

 

Author Topic: r2015 - Crash when I sell convoy in depot or when exiting game  (Read 3312 times)

0 Members and 1 Guest are viewing this topic.

Offline z9999

  • Devotees (Inactive)
  • *
  • Posts: 848
r2015 - Crash when I sell convoy in depot or when exiting game
« on: September 12, 2008, 04:49:12 AM »
simutrans r2015, pak64

Problem:
- If there is a convoy in train depot, monorail depot or air depot...
-- Crash when exit the game.
-- Crash when sell this convoy.

How to reproduce:
1. Load attached savegame
2. Open train depot
3. Do one of these
 a. Click "sell" button.
 b. Exit the game

Result:
Crash.

Note:
This problem happened with train, monorail and airplane depot.
This problem didn't happen with car and ship depot.

Quote
Message: depot_frame_t::build_vehicle_lists():   finally 20 passenger vehicle, 38  engines, 23 good wagons
Message: waggon_t::setze_convoi():   new=00000000 old=05BAE4C0
FATAL ERROR: vector_tpl<T>::[]
index out of bounds: 1 not in 0..-1
Aborting program execution ...
« Last Edit: September 12, 2008, 05:00:11 AM by z9999 »

Offline The Hood

  • Devotees (Inactive)
  • *
  • Posts: 2889
  • pak128.Britain developer
Re: r2015 - Crash when I sell convoy in depot or when exiting game
« Reply #1 on: September 12, 2008, 07:41:54 AM »
I got that as well with linux r2014 and pak128 r100, exactly the same error message.

Offline z9999

  • Devotees (Inactive)
  • *
  • Posts: 848
Re: r2015 - Crash when I sell convoy in depot or when exiting game
« Reply #2 on: September 12, 2008, 02:17:46 PM »
In r2016.
Problem still happens when I sell an airplane in air depot.

EDIT: It also crash when I click "start" button in air depot window.
« Last Edit: September 12, 2008, 03:20:25 PM by z9999 »

Offline z9999

  • Devotees (Inactive)
  • *
  • Posts: 848
Re: r2015 - Crash when I sell convoy in depot or when exiting game
« Reply #3 on: September 13, 2008, 03:35:26 AM »
In r2018.
Problem still happens.

- Crash when I sell an airplane in air depot.
- Crash when I exit game, if there is an airplane in depot.

Offline prissi

  • Developer
  • Administrator
  • *
  • Posts: 10622
  • Languages: De,EN,JP
Re: r2015 - Crash when I sell convoy in depot or when exiting game
« Reply #4 on: September 13, 2008, 11:31:26 AM »
Not in my version ... unsure how to handle this.

Offline z9999

  • Devotees (Inactive)
  • *
  • Posts: 848
Re: r2015 - Crash when I sell convoy in depot or when exiting game
« Reply #5 on: September 13, 2008, 03:00:50 PM »
I don't know the difference of these code, but when I used old code, crash didn't happen.
But compiler complained.

I hope this might help you.

In bool aircraft_t::block_reserver( uint32 start, uint32 end, bool reserve )

old code (r2009):
Quote
      for(  uint32 i=start; success  &&  i<end  &&  (sint32)i<=route->gib_max_n(); i++) {

new code (r2018):
Quote
      for(  uint32 i=start;  success  &&  i<end  &&  i<=route->gib_max_n();  i++) {

warning for old code:
Quote
vehicle/simvehikel.cc: In member function `bool aircraft_t::block_reserver(uint32, uint32, bool)':
vehicle/simvehikel.cc:2899: warning: comparison between signed and unsigned integer expressions

Offline prissi

  • Developer
  • Administrator
  • *
  • Posts: 10622
  • Languages: De,EN,JP
Re: r2015 - Crash when I sell convoy in depot or when exiting game
« Reply #6 on: September 13, 2008, 06:22:06 PM »
This was part of a patch to reduce warnings. But, my reluctance to fix working stuff was also justified in this case :( This value will be signed again.

Offline z9999

  • Devotees (Inactive)
  • *
  • Posts: 848
[solved]Re: r2015 - Crash when I sell convoy in depot or when exiting game
« Reply #7 on: September 14, 2008, 04:18:35 AM »
Crash didn't happen in r2020, seems to be solved this problem.
Thank you.