News:

Do you need help?
Simutrans Wiki Manual can help you to play and extend Simutrans. In 9 languages.

Crash when changing player

Started by donjuan, September 13, 2013, 12:25:14 PM

Previous topic - Next topic

0 Members and 1 Guest are viewing this topic.

donjuan

Tested paks: pak64, pak128 (seems to be a pak independent bug)
Simutrans Version: 112.3-r6520

How to reproduce:
1. Just open (at last) two depot windows (No matter which kind of depot: Tram ,Train, Shipyard,Garage or Hangar)
2. Now click on "change player" (P+ -Symbol), to play as "public player", the game will crash immediately.

Can anybody confirm this bug?

prissi

Yes, it is a stack overflow. Closing depots is not needed anymore, as simutrans will ask for confirmation before you can do something with a locked player.

Dwachs

Here is a patch. Prissi what you described are just the symptoms of bugs deeper in the window management:

1) destroy_win could create a cascade of topwin/destroywin calls - just do not call topwin if window is not destroyed directly. The topwin call has to be done after process_kill_list.

2) this is more serious: if in destroy_framed_win the wins pointer points to a member of kill_list and this member gets removed, then wins->gui points to some other gui accidentally ...

Could not test nor commit due to not compiling :/
Parsley, sage, rosemary, and maggikraut.

prissi

Thank you, I also noticed that there was indeed some other problem with destruction handling. However, if got distracted by finding out if leaving depots open would allow any unwanted stuff. Your patch look fine.