The International Simutrans Forum

Development => Patches & Projects => Incorporated Patches and Solved Bug Reports => Topic started by: wernieman on May 31, 2009, 12:24:14 pm

Title: CTD with Click on the minimap
Post by: wernieman on May 31, 2009, 12:24:14 pm
Hey,

with this Savegame:
http://simutrans-germany.com/files/upload/Test 62.sve (http://simutrans-germany.com/files/upload/Test 62.sve)
I get a Problem when I Click on the button, how open the Minimap
Then the Minimap don't show, the game CTD

Simutrans Version (Testet): 2493/2489
PAK: Clean PAK 64, rev 155

Could the Game be rescue?

Werner
Title: Re: CTD with Click on the minimap
Post by: jamespetts on May 31, 2009, 12:40:01 pm
That's odd - it works fine for me.
Title: Re: CTD with Click on the minimap
Post by: wernieman on May 31, 2009, 12:42:54 pm
Wich simutransversion?

Edit:
When I open it 3-4x, at now it "only" CDT in 10-20%
Title: Re: CTD with Click on the minimap
Post by: jamespetts on May 31, 2009, 01:01:27 pm
I was using the latest version of Simutrans-Experimental (3.14).
Title: Re: CTD with Click on the minimap
Post by: whoami on June 04, 2009, 08:37:23 pm
I tried with ST-main r2489 Windows-SDL with Pak64 r155, and haven't seen a crash with this savegame yet.

I see that there are no trees outside of a rectangular area of the map. Have you used the map resizer?
Title: Re: CTD with Click on the minimap
Post by: wernieman on June 04, 2009, 09:40:18 pm
After loading the Game you must Try it  .. not waiting a little time ...

 make some test and so I see, when you wait a little bit and scroll a little bit, you can open it without a problem.

But when you load an open without waiting/scrolling, it cashed.

I think there is a variable not set at loading .. but after a little time ..
Title: Re: CTD with Click on the minimap
Post by: z9999 on June 04, 2009, 10:07:00 pm
Default view of minimap is different for each person. It is saved in settings.xml.
It crashed only when default view is something related station - e.g. P****engers, Stop status, Origin etc..

How to reproduce:
1. Start simutrans
2. Open minimap and click "P****engers"
3. Load Test 62.sve
4. Open minimap as fast as possible

Result:
Crash
Title: Re: CTD with Click on the minimap
Post by: wernieman on June 05, 2009, 09:13:38 am
O.K. .. If have Aktivate " Waiting" ...
Title: Re: CTD with Click on the minimap
Post by: whoami on June 05, 2009, 03:07:50 pm
With the button "p****engers" being pressed in the minimap, I can reproduce the crash, also in r2502.

I see that there are no trees outside of a rectangular area of the map. Have you used the map resizer?
What about this? The reason for the crash might be related to map resizing, if it happened. Rotation, esp. in combination with resizing, is another thing to check.
Title: Re: CTD with Click on the minimap
Post by: wernieman on June 06, 2009, 05:43:08 pm
I rezise the Map. I don't know if I rotate the map.

What I dont understand:
If you wait a litte, after loading, you could open the game, so it could be a Problem of a not initialized variable
Title: Re: CTD with Click on the minimap
Post by: wernieman on June 07, 2009, 10:54:33 pm
I check it with older savegames. After resizing I don't have the Problem. I get it with "newer" savegames .... but a this Moment there was the rezising a "little big" old. It only could a Problem of rotating
Title: Re: CTD with Click on the minimap
Post by: Dwachs on June 08, 2009, 06:06:37 am
I could not reproduce this bug inside a debugger (Visual Studio) :/ Can anyone try with gdb and provide a back-trace?
Title: Re: CTD with Click on the minimap
Post by: z9999 on June 08, 2009, 03:03:03 pm
Not so useful, sorry.
calc_map is not yet called and relief is NULL ?

Quote
Program received signal SIGSEGV, Segmentation fault.
0x00613344 in array2d_tpl<unsigned char>::get_width() const (this=0x5b80a1)
    at gui/../tpl/array2d_tpl.h:44
44                      return w;
Current language:  auto; currently c++
(gdb) bt
#0  0x00613344 in array2d_tpl<unsigned char>::get_width() const (this=0x5b80a1)
    at gui/../tpl/array2d_tpl.h:44

Quote
sim.exe caused an Access Violation at location 00613424 in module sim.exe Reading from location 00000004.

Registers:
eax=00000000 ebx=0000002d ecx=0023e8b4 edx=00000032 esi=01c9e844 edi=da0ce78e
eip=00613424 esp=0023e87c ebp=0023fa18 iopl=0         nv up ei pl nz ac po nc
cs=001b  ss=0023  ds=0023  es=0023  fs=003b  gs=0000             efl=00000216

Call stack:
00613424  sim.exe:00613424  array2d_tpl<unsigned char>::get_width() const  array2d_tpl.h:44
   ...
   
   unsigned int get_width() const {
>   return w;
   }
   
   ...

005B8181  sim.exe:005B8181  WinMain  simsys_w16.cc:774
00401247  sim.exe:00401247
00401298  sim.exe:00401298
7C817077  kernel32.dll:7C817077  RegisterWaitForInputIdle
Title: Re: CTD with Click on the minimap
Post by: z9999 on June 09, 2009, 10:30:58 am
I don't know this is  a correct patch or not. Please test it.

[EDIT]
Replace the patch

Code: [Select]
diff --git a/gui/karte.cc b/gui/karte.cc
index 66468a4..4713043 100644
--- a/gui/karte.cc
+++ b/gui/karte.cc
@@ -586,6 +586,7 @@ void reliefkarte_t::calc_map()
  cur_off = new_off;
  cur_size = new_size;
  needs_redraw = false;
+ is_visible = true;
 
  // redraw the map
  if(  !rotate45  ) {
@@ -707,7 +708,7 @@ void reliefkarte_t::set_welt(karte_t *welt)
  }
  rotate45 = false;
  needs_redraw = true;
-// is_visible = false;
+ is_visible = false;
 
  if(welt) {
  calc_map_groesse();
diff --git a/gui/map_frame.cc b/gui/map_frame.cc
index d7e5f79..881be4c 100644
--- a/gui/map_frame.cc
+++ b/gui/map_frame.cc
@@ -290,7 +290,6 @@ void map_frame_t::infowin_event(const event_t *ev)
 {
  if(ev->ev_cl**** == INFOWIN) {
  if(ev->ev_code == WIN_OPEN) {
- reliefkarte_t::get_karte()->is_visible = true;
  reliefkarte_t::get_karte()->set_xy_offset_size( koord(0,0), koord(0,0) );
  }
  else if(ev->ev_code == WIN_CLOSE) {
--
1.6.3.msysgit.0