The International Simutrans Forum

 

Author Topic: Consistant rotation bug  (Read 2455 times)

0 Members and 1 Guest are viewing this topic.

Offline Cyrus Hall

  • *
  • Posts: 20
Consistant rotation bug
« on: May 29, 2009, 11:27:48 AM »
Ciao-

Linux user here.  Pretty much anytime I rotate on a large and active map I get a seg-fault with the exp branch.  Stack dump is the same each time, as follows:

Program received signal SIGSEGV, Segmentation fault.
[Switching to Thread 0xf7a678e0 (LWP 10577)]
0x082095b1 in waggon_t::ist_blockwechsel ()
Current language:  auto; currently asm
(gdb) bt
#0  0x082095b1 in waggon_t::ist_blockwechsel ()
#1  0x0820e3ea in waggon_t::ist_weg_frei ()
#2  0x082070dd in vehikel_t::hop_check ()
#3  0x08204264 in vehikel_basis_t::fahre_basis ()
#4  0x0818a925 in convoi_t::sync_step ()
#5  0x081edbbe in karte_t::sync_step ()
#6  0x081b49fe in interrupt_check ()
#7  0x081b0d7a in haltestelle_t::rebuild_connexions ()
#8  0x081b15c2 in haltestelle_t::get_connexions ()
#9  0x081c5e40 in planquadrat_t::add_to_haltlist ()
#10 0x081983ff in fabrik_t::link_halt ()
#11 0x081a2c5f in haltestelle_t::verbinde_fabriken ()
#12 0x081ab2d9 in haltestelle_t::rotate90 ()
#13 0x081e6851 in karte_t::rotate90 ()
#14 0x081c3cc0 in wkz_rotate90_t::init ()
#15 0x081e39e3 in karte_t::set_werkzeug ()
#16 0x081e3c29 in karte_t::interactive_event ()
#17 0x081ee2a4 in karte_t::interactive ()
#18 0x081bcb94 in simu_main ()
#19 0x08222469 in main ()

If you point me at a debug version, I'd be happy to give you some line numbers.  I don't have time to build myself currently.

Cheers!

Offline jamespetts gb

  • Simutrans-Extended project coordinator
  • Moderator
  • *
  • Posts: 18763
  • Cake baker
    • Bridgewater-Brunel
  • Languages: EN
Re: Consistant rotation bug
« Reply #1 on: May 29, 2009, 04:59:02 PM »
Pugget,

welcome to the forums! Thank you very much for your interest in Simutrans-Experimental, and for your bug report. I am currently at work and do not have the code with me - I will look into this and get back to you when I can. Thank you very much again for your report.

Offline Cyrus Hall

  • *
  • Posts: 20
Re: Consistant rotation bug
« Reply #2 on: May 29, 2009, 05:40:30 PM »
James-

No problem; thanks for the welcome.  Do you use a formal bug tracker somewhere (bugzilla, trac, etc) such that I can file more formal reports?  Also, I had some time and tried to build out of git, but gcc started spitting out errors fairly heavily. Some of the problems appeared to be 32/64-bit issues (int v.s long int), others were just bad typecasts.  I didn't have the time in the end to fix them all, so still no line numbers on the crash.

Cheers,
Pugget

Offline jamespetts gb

  • Simutrans-Extended project coordinator
  • Moderator
  • *
  • Posts: 18763
  • Cake baker
    • Bridgewater-Brunel
  • Languages: EN
Re: Consistant rotation bug
« Reply #3 on: May 29, 2009, 10:20:54 PM »
Pugget,

thank you very much for your help, and also for attempting to compile it. Sorry that you're having 64-bit related difficulties. I don't have any 64-bit hardware myself, so I can't test that. Can you send me your compiler output? I may not have time to look into that aspect of things for a long while, but it might be helpful anyway.

As to bug tracking, I haven't set up any such system yet, but it might be a good idea. Is there any particular (free) system that you recommend?

As for the bug - I have taken a guess at where the problem might be manifesting and coded in an extra null pointer check in the last method in your list. Can you upload a saved game so that I can test it?

Thank you again for your interest in Simutrans-Experimental! :-)

Offline Cyrus Hall

  • *
  • Posts: 20
Re: Consistant rotation bug
« Reply #4 on: May 29, 2009, 11:10:12 PM »
The following is the save file:
http://atelier.inf.unisi.ch/~hallc/64-stat-2.sve

In terms of bug tracking, I don't really have a preference.  Trac seems to be the friendliest to setup and use, but I'm not an expert.

For compiler errors, all sorts of stuff crops up.  Giving an exhaustive list would require I fix them as they come up, which I'm not in a position to do right now.  In general, it's stuff like:

simsys_x8.cc:214: error: invalid conversion from ‘void*’ to ‘char*’
simsys_x8.cc:245: error: cannot convert ‘unsigned char*’ to ‘short unsigned int*’ in return

etc, etc.  I'd guess you are using a compiler besides gcc that is less picky about ANSI C.  Try turning on more warnings or an ANSI strict mode.

Also, another segfault to report.  When I try to create a station on particular squares in the save game linked to at top, I get seg faults:

Program received signal SIGSEGV, Segmentation fault.
[Switching to Thread 0xf7ace8e0 (LWP 20312)]       
0x0809abfa in translator::translate ()             
Current language:  auto; currently asm
(gdb) bt
#0  0x0809abfa in translator::translate ()         
#1  0x081a6e05 in haltestelle_t::create_name ()     
#2  0x081d761a in wkz_station_t::wkz_station_aux ()
#3  0x081da7ec in wkz_station_t::work ()           
#4  0x081e3d4d in karte_t::interactive_event ()     
#5  0x081ee2a4 in karte_t::interactive ()           
#6  0x081bcb94 in simu_main ()                     
#7  0x08222469 in main ()

For example, go into underground mode and try and place a train station at 225,191,3.  This is the first underground station I've had issues with, but other overground stations have been issues as well.

Cheers,
Pugget

Offline jamespetts gb

  • Simutrans-Extended project coordinator
  • Moderator
  • *
  • Posts: 18763
  • Cake baker
    • Bridgewater-Brunel
  • Languages: EN
Re: Consistant rotation bug
« Reply #5 on: May 30, 2009, 03:49:22 PM »
Pugget,

thank you very much for your detailed report. Both the rotation bug and the 64-bit compile errors should be fixed in 3.13. Do let me know how you get along!

Offline Cyrus Hall

  • *
  • Posts: 20
Re: Consistant rotation bug
« Reply #6 on: June 02, 2009, 02:43:31 PM »
James-

Don't have a lot of time right now, but I just tested rotations in .14.  I can now rotate once, but then the following assert happens:

simutrans-exp-latest: simhalt.cc:494: void haltestelle_t::rotate90(sint16): Assertion `k_2 != koord::invalid' failed.
Calculating textures ...Aborted

I'm away for the next several days, and then I'll play with it some more.

Cheers,
Pugget

Offline jamespetts gb

  • Simutrans-Extended project coordinator
  • Moderator
  • *
  • Posts: 18763
  • Cake baker
    • Bridgewater-Brunel
  • Languages: EN
Re: Consistant rotation bug
« Reply #7 on: June 02, 2009, 08:11:52 PM »
Pugget,

I can't reproduce that on Windows, I'm afraid. Has your saved game changed much since you uploaded it? If so, I'd be grateful for an updated version. Thank you very much for your report.