News:

Do you need help?
Simutrans Wiki Manual can help you to play and extend Simutrans. In 9 languages.

Hard crash on opening Stop Details window

Started by Matthew, May 15, 2023, 05:16:33 AM

Previous topic - Next topic

0 Members and 1 Guest are viewing this topic.

Matthew

Steps to reproduce

1. Open this save from B-B.
2. Jump to (3042,150)
2. Open Keldeen Carriage Sidings' Stop Details window (shift+click or button)

Expected results

Stop Details window opens.

Actual results

Hard crash.

Backtrace

Thread 1 "simutrans-exten" received signal SIGSEGV, Segmentation fault.
gui_tab_panel_t::infowin_event (this=0x5555566802c0, ev=0x7fffffff9660) at gui/components/gui_tab_panel.cc:168
168                     ev2.move_origin(get_aktives_tab()->get_pos());
(gdb) bt
#0  gui_tab_panel_t::infowin_event (this=0x5555566802c0, ev=0x7fffffff9660) at gui/components/gui_tab_panel.cc:168
#1  0x00005555557c94c4 in gui_container_t::infowin_event (this=0x555556680738, ev=0x7fffffff9660) at gui/components/gui_container.cc:176
#2  0x00005555558632f6 in gui_frame_t::infowin_event (this=0x55555667edc0, ev=0x7fffffff9750) at gui/gui_frame.cc:135
#3  0x000055555586bcf3 in halt_detail_t::infowin_event (this=0x55555667edc0, ev=0x7fffffff9750) at gui/halt_detail.cc:604
#4  0x000055555591fd8d in create_win (x=-1, y=-1, gui=0x55555667edc0, wt=w_info, magic=201504, move_to_full_view=false) at gui/simwin.cc:857
#5  0x000055555591f505 in create_win (gui=0x55555667edc0, wt=w_info, magic=201504) at gui/simwin.cc:724
#6  0x0000555555adc75f in haltestelle_t::show_detail (this=0x5555c5e357e0) at simhalt.cc:3462
#7  0x0000555555b200d4 in tool_query_t::work (this=0x5555571bd420, player=0x55555ba20470, pos=...) at simtool.cc:379
#8  0x0000555555b82a7b in karte_t::call_work (this=0x55556b9a1ca0, tool=0x5555571bd420, player=0x55555ba20470, pos=..., suspended=@0x7fffffff9996: false) at simworld.cc:10444
#9  0x0000555555af5837 in interaction_t::interactive_event (this=0x555559cc29a0, ev=...) at siminteraction.cc:242
#10 0x0000555555af6218 in interaction_t::process_event (this=0x555559cc29a0, ev=...) at siminteraction.cc:422
#11 0x0000555555af6302 in interaction_t::check_events (this=0x555559cc29a0) at siminteraction.cc:444
#12 0x0000555555b6b8f1 in karte_t::sync_step (this=0x55556b9a1ca0, delta_t=0, do_sync_step=false, display=true) at simworld.cc:4348
#13 0x0000555555b845c9 in karte_t::interactive (this=0x55556b9a1ca0, quit_month=2147483647) at simworld.cc:10847
#14 0x0000555555b04ebf in simu_main (argc=3, argv=0x7fffffffddb8) at simmain.cc:1705
#15 0x0000555555b9286b in sysmain (argc=3, argv=0x7fffffffddb8) at sys/simsys.cc:1105
#16 0x0000555555c229ea in main (argc=3, argv=0x7fffffffddb8) at sys/simsys_s2.cc:1107

Prettyprinted backtrace
Stop Details Crash.png

Comments


I had just removed what I thought was the final line from this stop.
I tried to reproduce this on a new map and couldn't.
This stop only used the new 'timing point' platform.
(Signature being tested) If you enjoy playing Simutrans, then you might also enjoy watching Japan Railway Journal
Available in English and simplified Chinese
如果您喜欢玩Simutrans的话,那么说不定就想看《日本铁路之旅》(英语也有简体中文字幕)。

Ranran

Thank you for your report.
It created the possibility of causing a crash with the addition of "timingpoint" to the pakset.
A crash occurs when trying to access the station detail dialog for a station where the station has no goods (passenger/mail/freight) attributes.

It wasn't designed with the UI in mind for cases where passenger, postal, and freight cargo types weren't all supported. This is a design error and should be fixed.

However, it can be said that a stop that does not support passenger, mail, or freight does not have the functionality of an actual station.
So it doesn't need the information of the station detail dialog.
Therefore the station detail should be inaccessible for such DUMMY stations.


I'm on long rest but I don't want to be like Japanese guys who introduce bugs and pretend they don't know, so I'm submitting a patch to fix this. Check pull request #618.


(1) The patch changes station detail to be inaccessible at such DUMMY stations.
(2) To make it clear that it is a DUMMY station, the indicator of the dummy station is changed so that it is always grayed out.

Matthew

Quote from: Ranran on indefinite leave on May 15, 2023, 10:26:38 PMThank you for your report.
It created the possibility of causing a crash with the addition of "timingpoint" to the pakset.
A crash occurs when trying to access the station detail dialog for a station where the station has no goods (passenger/mail/freight) attributes.

It wasn't designed with the UI in mind for cases where passenger, postal, and freight cargo types weren't all supported. This is a design error and should be fixed.

However, it can be said that a stop that does not support passenger, mail, or freight does not have the functionality of an actual station.
So it doesn't need the information of the station detail dialog.
Therefore the station detail should be inaccessible for such DUMMY stations.


I'm on long rest but I don't want to be like Japanese guys who introduce bugs and pretend they don't know, so I'm submitting a patch to fix this. Check pull request #618.


(1) The patch changes station detail to be inaccessible at such DUMMY stations.
(2) To make it clear that it is a DUMMY station, the indicator of the dummy station is changed so that it is always grayed out.

Thank you so much for submitting this patch, Ranran.

This bug is more my responsibility than yours, because I should have checked this before submitting the PR for timing points.

I don't know the GUI code at all though, so you have kindly fixed this far faster than I could have done.

I have tested the 2305-fix-timingpoint-crash branch and can confirm that it fixes the case in the bug report, and other stops still seem to function as intended.
(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

Quote from: Ranran on indefinite leave on May 15, 2023, 10:26:38 PMThank you for your report.
It created the possibility of causing a crash with the addition of "timingpoint" to the pakset.
A crash occurs when trying to access the station detail dialog for a station where the station has no goods (passenger/mail/freight) attributes.

It wasn't designed with the UI in mind for cases where passenger, postal, and freight cargo types weren't all supported. This is a design error and should be fixed.

However, it can be said that a stop that does not support passenger, mail, or freight does not have the functionality of an actual station.
So it doesn't need the information of the station detail dialog.
Therefore the station detail should be inaccessible for such DUMMY stations.


I'm on long rest but I don't want to be like Japanese guys who introduce bugs and pretend they don't know, so I'm submitting a patch to fix this. Check pull request #618.


(1) The patch changes station detail to be inaccessible at such DUMMY stations.
(2) To make it clear that it is a DUMMY station, the indicator of the dummy station is changed so that it is always grayed out.
Thank you very much - that is very helpful. Now incorporated.

I hope that you are having a good rest.
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.