News:

Simutrans Wiki Manual
The official on-line manual for Simutrans. Read and contribute.

Road + Tram combinated tunnel issues (+ crash)

Started by Amelek, August 05, 2009, 04:32:33 PM

Previous topic - Next topic

0 Members and 1 Guest are viewing this topic.

Amelek

There are several issues with road+tram tunnels. I think they are similar in origin, so i don't think all of them require different topics. Correct me if I'm wrong.

1) Building forks from such tunnels. In last stable (nightly 102.1 from page), nothing happens: you click on tunnel, then click on ground somewhere and nothing. Both if you try with tram and road tunnel. If you build road tunnel, fork it and then try to build tram over it, it will seek different route (ie, ignore possibility of building through tunnel).
2) If you build forked road tunnel and try pushing tram track while holding ctrl, even more odd thing will happen: see attached screenshot
both bugs do not happen on head revision from SVN i compiled on my own. Although it might require some attention. However, in SVN HEAD it's still not possible to fork tram from such tunnel. If you click on it - it will tell that ground is not suitable (as when clicking nowhere in underground mode)
3) Now, to the crash: There are two possibilities
a) In stable: just use (in underground mode) tram track delete tool and delete some track. It doesn't really matter how big. Then, you will see that something went wrong: instead of removing track you got track with "end of track" marks all over. Now, if you go to normal view and remove entire tunnel game will crash.
b) In SVN head: Get a tunnel, get tram track over it, then delete tunnel. Sometimes this will crash at weg.h 155 (this = 0)

backtrace is:
>   SimDebug.exe!weg_t::get_besch()  Line 155 + 0x11 bytes   C++
   SimDebug.exe!tunnel_t::entferne(spieler_t * sp2=0x030339f8)  Line 119 + 0x8 bytes   C++
   SimDebug.exe!tunnelbauer_t::remove(karte_t * welt=0x01e7cd68, spieler_t * sp=0x030339f8, koord3d start={...}, waytype_t wegtyp=road_wt)  Line 506 + 0x19 bytes   C++
   SimDebug.exe!wkz_remover_t::wkz_remover_intern(spieler_t * sp=0x030339f8, karte_t * welt=0x01e7cd68, koord3d pos={...}, const char * & msg=0x00000000)  Line 466 + 0x53 bytes   C++
   SimDebug.exe!wkz_remover_t::work(karte_t * welt=0x01e7cd68, spieler_t * sp=0x030339f8, koord3d pos={...})  Line 630 + 0x23 bytes   C++
   SimDebug.exe!karte_t::interactive_event(event_t & ev={...})  Line 4431 + 0x42 bytes   C++
   SimDebug.exe!karte_t::interactive()  Line 4567   C++
   SimDebug.exe!simu_main(int argc=1, char * * argv=0x0012fa4c)  Line 941 + 0xb bytes   C++
   SimDebug.exe!WinMain(HINSTANCE__ * hInstance=0x00400000, HINSTANCE__ * hPrevInstance=0x00000000, char * lpCmdLine=0x00222086, int nShowCmd=1)  Line 783 + 0x13 bytes   C++
   SimDebug.exe!__tmainCRTStartup()  Line 578 + 0x35 bytes   C
   SimDebug.exe!WinMainCRTStartup()  Line 403   C

save attached.

I can try to provide more detailed information if required. I'm C++ programmer and tester.

Dwachs

When you say SVN head, you mean revision 2611? I ask, because I thought I fixed these issues. I will look into it, when I will be back from vaction.
Parsley, sage, rosemary, and maggikraut.

Amelek

#2
I mean 2610, I will check again on 2611

edit: still crashes on 2611

edit2: this patch seem to fix crash issue, however I'm not sure what this was supposed to do, so it might break something else

Dwachs

Imho the patch cures the symptom not the bug itself, which must originate from elsewhere. Somehow, the way is removed before the tunnel object gets deleted. However, I cannot reproduce this bug (under Windows, MS VS).
Parsley, sage, rosemary, and maggikraut.

Amelek

well, while it most likely isn't the cause, it still fixes bug prone point. I guest there should be a in-game fatal error message if that happens, rather then nothing though

Dwachs

#5
Sorry, I did not saw that you attached a savegame. I can confirm the crash now.

Edit: should be fixed in revision 2614.
Parsley, sage, rosemary, and maggikraut.

gerw