News:

Simutrans Forum Archive
A complete record of the old Simutrans Forum.

SegFault when pathfinding to depot

Started by A.Badger, March 15, 2017, 06:24:41 AM

Previous topic - Next topic

0 Members and 1 Guest are viewing this topic.

A.Badger

Found a way around this but since I have a save file from which I can reliably reproduce this, I figured I'd post it.

Current nightly build: r78834b5
Current nightly pak128.britain-ex
Platform: Fedora 25 Linux x86_64
Savegame: https://toshio.fedorapeople.org/simutrans/segfault-pathfinding-to-depot.sve

Steps to reproduce:
* Open the save game
* You should see the window for (18) Brig (hull) (109, 798)
* Click on the "Go to Depot" button
* Program should segfault.

I compiled up a version of this with debugging symbols and got a stack trace as well.  I believe this is the relevant thread:


                                                  Stack trace of thread 26686:
                                                  #0  0x0000000000466d47 _ZNK5weg_t20is_height_restrictedEv (simutran
                                                  #1  0x000000000048b296 _ZN7route_t10find_routeEP7karte_t7koord3dP13
                                                  #2  0x000000000067a635 _ZN8convoi_t11go_to_depotEbb (simutrans-exte
                                                  #3  0x00000000006e90eb _ZN20tool_change_convoi_t4initEP8player_t (s
                                                  #4  0x000000000070d43e _ZN7karte_t14local_set_toolEP6tool_tP8player
                                                  #5  0x000000000070d663 _ZN7karte_t8set_toolEP6tool_tP8player_t (sim
                                                  #6  0x000000000066dedd _ZN8convoi_t16call_convoi_toolEcPKc (simutra
                                                  #7  0x0000000000508fc3 _ZN13convoi_info_t16action_triggeredEP20gui_
                                                  #8  0x00000000004e81af _ZN8button_t13infowin_eventEPK7event_t (simu
                                                  #9  0x00000000004ec544 _ZN15gui_container_t13infowin_eventEPK7event
                                                  #10 0x000000000052a507 _ZN11gui_frame_t13infowin_eventEPK7event_t (
                                                  #11 0x00000000005915d9 _Z13check_pos_winP7event_t (simutrans-extend
                                                  #12 0x00000000006b7756 _ZN13interaction_t13process_eventER7event_t
                                                  #13 0x00000000006b7de3 _ZN13interaction_t12check_eventsEv (simutran
                                                  #14 0x0000000000737876 _ZN7karte_t11interactiveEj (simutrans-extend
                                                  #15 0x00000000006c3503 _Z9simu_mainiPPc (simutrans-extended-compile
                                                  #16 0x00000000006d78a4 _Z7sysmainiPPc (simutrans-extended-compiled)
                                                  #17 0x00007f108dec2401 __libc_start_main (libc.so.6)
                                                  #18 0x000000000040fefa _start (simutrans-extended-compiled)


Opening the Core dump in gdb gives me the following (redacted for size) information:

Core was generated by `./simutrans-extended-compiled'.
Program terminated with signal SIGSEGV, Segmentation fault.
#0  obj_t::get_pos (this=this@entry=0x0) at boden/wege/../../simobj.h:319
319             inline koord3d get_pos() const {return pos;}
(gdb) l
314             virtual void finish_rd() {}
315
316             /**
317              * @return position
318              */
319             inline koord3d get_pos() const {return pos;}
320
321             /**
322              * set position - you would not have guessed it :)
323              */


Other information:

* I can get this seg fault either by pressing the go to depot button as done here or by using the Replace feature to have the ship send itself to a depot later.  It does not appear to matter where the ship is when I hit the go to depot button; the segfault still occurs.
* I was able to workaround this by opening up the ship's schedule, adding the depot as a stop, and then telling the ship that the depot was the stop I wished it to travel to next.  The ship found its way to the depot without difficulty by doing it that way.

jamespetts

Thank you very much for the report: I think that I have now found and fixed this. Would you be able to re-test? I should be most grateful.
Download Simutrans-Extended.

Want to help with development? See here for things to do for coding, and here for information on how to make graphics/objects.

Follow Simutrans-Extended on Facebook.