News:

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

CTD when clicking on liquidated tunnel

Started by Matthew, April 25, 2022, 04:21:29 AM

Previous topic - Next topic

0 Members and 1 Guest are viewing this topic.

Matthew

Steps to reproduce
1. Open this B-B save in the latest Simutrans-Extended.
2. Jump to (235,1725)
3. Switch to Underground Mode or Sliced Underground Mode Level 0.
4. Click on the tunnel at latitude 1722 with the Info tool.

Expected results
Information about the road tunnel is displayed.

Actual results
CTD.

Notes
I think this tunnel was constructed by Zook's company, which has since been liquidated.

EDIT:
Backtrace
In colour for easy reading:


In text for those who prefer that:
Thread 1 "simutrans-exten" received signal SIGSEGV, Segmentation fault.
gui_way_detail_info_t::draw (this=0x55557edc0bf0, offset=...) at gui/../player/simplay.h:292
292             uint8 get_player_color1() const { return player_color_1; }
(gdb) bt
#0  gui_way_detail_info_t::draw (this=0x55557edc0bf0, offset=...) at gui/../player/simplay.h:292
#1  0x00005555557d4be2 in gui_scrollpane_t::draw (this=0x55557edc10a8, pos=...) at gui/components/../../display/scr_coord.h:236
#2  0x00005555557d7185 in gui_tab_panel_t::draw (this=0x55557edc19f0, parent_pos=...) at gui/components/../../descriptor/../display/scr_coord.h:39
#3  0x00005555557bdf79 in gui_container_t::draw (this=0x55557edc2000, offset=...) at gui/components/gui_container.cc:287
#4  0x0000555555844cc6 in gui_frame_t::draw (this=0x55557edc09f0, pos=..., size=...) at gui/gui_frame.cc:185
#5  0x0000555555914e80 in display_win (win=0) at gui/simwin.cc:1163
#6  display_all_win () at gui/simwin.cc:1196
#7  0x000055555591791d in win_display_flush (konto=326053624.48000002) at gui/simwin.cc:1842
#8  0x0000555555abaac5 in intr_refresh_display (dirty=dirty@entry=false) at player/finance.h:434
#9  0x0000555555b297c4 in karte_t::sync_step (this=this@entry=0x55557b6fe620, delta_t=<optimised out>, delta_t@entry=0, do_sync_step=do_sync_step@entry=false, display=display@entry=true) at simworld.cc:4943
#10 0x0000555555b52161 in karte_t::interactive (this=this@entry=0x55557b6fe620, quit_month=quit_month@entry=2147483647) at simworld.cc:11348
#11 0x0000555555ac95aa in simu_main (argc=argc@entry=5, argv=argv@entry=0x7fffffffde88) at simmain.cc:1693
#12 0x0000555555b55365 in sysmain (argc=5, argv=0x7fffffffde88) at sys/simsys.cc:1102
#13 0x00007ffff78040b3 in __libc_start_main (main=0x55555567a410 <main(int, char**)>, argc=5, argv=0x7fffffffde88, init=<optimised out>, fini=<optimised out>, rtld_fini=<optimised out>, stack_end=0x7fffffffde78) at ../csu/libc-start.c:308
#14 0x000055555567a48e in _start () at gui/components/../../tpl/vector_tpl.h:57

The presenting reason is a lack of player colour. I don't know anything how the game handles 'unowned' objects yet, so I can't diagnose further.

EDIT 2:

Perhaps there should be a
if(way->get_owner() != NULL)check in front of way_info.cc line 107 (for tunnels), as there is for example in line 122. Line 122 seems to implement it as a ternary operator, and line 93 implements the check for bridges using a ternary operator.

EDIT 3:

So I might be able to fix this with a simple copy-and-paste.
(Signature being tested) If you enjoy playing Simutrans, then you might also enjoy watching Japan Railway Journal
Available in English and simplified Chinese
如果您喜欢玩Simutrans的话,那么说不定就想看《日本铁路之旅》(英语也有简体中文字幕)。

Matthew

Fixed in PR#531 (expected results after following steps to reproduce above).

99% of the credit goes to Ranran, because I just copied and pasted his fix for unowned bridges. ;D
(Signature being tested) If you enjoy playing Simutrans, then you might also enjoy watching Japan Railway Journal
Available in English and simplified Chinese
如果您喜欢玩Simutrans的话,那么说不定就想看《日本铁路之旅》(英语也有简体中文字幕)。

jamespetts

Thank you - I have now integrated this fix.
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.