The International Simutrans Forum

 

Author Topic: Client crash when partly deleted station wait graphs becomes visible in viewport  (Read 244 times)

0 Members and 1 Guest are viewing this topic.

Offline Matthew

  • *
  • Posts: 511
    • Japan Railway Journal
  • Languages: EN, some ZH, DE & SQ
Steps to reproduce
1. Open a Bridgewater-Brunel save made today (2020-01-08).
2. Open the Display Settings Dialogue and make sure that station Waiting Graphs are off.
3. Use the Cities List (SHIFT+T) to find Lydpole.
4. Find Lydpole North station, on the north edge of the town.
5. Follow the adjacent railway northwestwards until the next station (Lydpole Colliery) becomes visible in the viewport.
6. Open the Display Settings Dialogue and turn station Waiting Graphs on.
7. The client will soft crash with a message similar to this:


Expected outcome
The wait graphs of Lydpole Colliery station appears and the client continues to run.

Caveats to above
1. All of the above was before today's nightly update, i.e. #342c977.
2. I know that a Bridgewater-Brunel save is not ideal, but I had to start somewhere and it is reproducible with that station.
3. Those steps to reproduce must be incomplete, otherwise other players would be reporting the problem. Now corrected.
4. IIRC the tiles that I deleted just before the crash occurred for the first time were the Country Station and one zero-capacity freight 'platform'.

Backtrace

From debug build (courtesy of freddyhayward):


And in black-and-white here if you prefer:
Code: [Select]
0x00007f3ff55343bf in __GI___clock_nanosleep (clock_id=clock_id@entry=0, flags=flags@entry=0, req=0x7ffcf6d2f290, rem=0x7ffcf6d2f280) at ../sysdeps/unix/sysv/linux/clock_nanosleep.c:78
78      ../sysdeps/unix/sysv/linux/clock_nanosleep.c: No such file or directory.
(gdb) bt
#0  0x00007f3ff55343bf in __GI___clock_nanosleep (clock_id=clock_id@entry=0, flags=flags@entry=0, req=0x7ffcf6d2f290, rem=0x7ffcf6d2f280) at ../sysdeps/unix/sysv/linux/clock_nanosleep.c:78
#1  0x00007f3ff553a047 in __GI___nanosleep (requested_time=<optimised out>, remaining=<optimised out>) at nanosleep.c:27
#2  0x00007f3ff5b911ab in ?? () from /lib/x86_64-linux-gnu/libSDL2-2.0.so.0
#3  0x0000557d7806657d in dr_sleep (usec=50) at /home/freddy/git/simutrans-extended/sys/simsys_s2.cc:787
#4  0x0000557d7800b389 in log_t::fatal (this=0x557d7900dfd0, who=0x557d7809f96b "vector_tpl<T>::[]", format=0x557d7809f940 "%s: index out of bounds: %lu not in 0..%lu") at /home/freddy/git/simutrans-extended/utils/log.cc:311
#5  0x0000557d77f2ab0f in vector_tpl<short>::operator[] (this=0x557e37354098, i=0) at /home/freddy/git/simutrans-extended/dataobj/../dataobj/../tpl/vector_tpl.h:280
#6  0x0000557d77f1e47f in haltestelle_t::display_status (this=0x557e37353c70, xpos=-4, ypos=-93) at /home/freddy/git/simutrans-extended/simhalt.cc:5064
#7  0x0000557d77b91b83 in grund_t::display_overlay (this=0x557ddad43aa8, xpos=-68, ypos=-84) at /home/freddy/git/simutrans-extended/boden/grund.cc:1797
#8  0x0000557d77f51b36 in planquadrat_t::display_overlay (this=0x7f3eaeac0300, xpos=-68, ypos=-84) at /home/freddy/git/simutrans-extended/simplan.cc:708
#9  0x0000557d77c1a311 in main_view_t::display (this=0x557d99bf5410, force_dirty=false) at /home/freddy/git/simutrans-extended/display/simview.cc:273
#10 0x0000557d77f30173 in intr_refresh_display (dirty=false) at /home/freddy/git/simutrans-extended/simintr.cc:79
#11 0x0000557d77f9f0c6 in karte_t::sync_step (this=0x557d99b53180, delta_t=0, do_sync_step=false, display=true) at /home/freddy/git/simutrans-extended/simworld.cc:5000
#12 0x0000557d77fb6ec7 in karte_t::interactive (this=0x557d99b53180, quit_month=2147483647) at /home/freddy/git/simutrans-extended/simworld.cc:11215
#13 0x0000557d77f3d702 in simu_main (argc=1, argv=0x7ffcf6d33058) at /home/freddy/git/simutrans-extended/simmain.cc:1537
#14 0x0000557d77f5635a in sysmain (argc=1, argv=0x7ffcf6d33058) at /home/freddy/git/simutrans-extended/sys/simsys.cc:1098
#15 0x0000557d78066676 in main (argc=1, argv=0x7ffcf6d33058) at /home/freddy/git/simutrans-extended/sys/simsys_s2.cc:832
(gdb) info frame 5
Stack frame at 0x7ffcf6d2f490:
 rip = 0x557d77f2ab0f in vector_tpl<short>::operator[] (/home/freddy/git/simutrans-extended/dataobj/../dataobj/../tpl/vector_tpl.h:280); saved rip = 0x557d77f1e47f
 called by frame at 0x7ffcf6d2f530, caller of frame at 0x7ffcf6d2f460
 source language c++.
 Arglist at 0x7ffcf6d2f458, args: this=0x557e37354098, i=0
 Locals at 0x7ffcf6d2f458, Previous frame's sp is 0x7ffcf6d2f490
 Saved registers:
  rbx at 0x7ffcf6d2f470, rbp at 0x7ffcf6d2f480, r12 at 0x7ffcf6d2f478, rip at 0x7ffcf6d2f488
(gdb) info frame 6
Stack frame at 0x7ffcf6d2f530:
 rip = 0x557d77f1e47f in haltestelle_t::display_status (/home/freddy/git/simutrans-extended/simhalt.cc:5064); saved rip = 0x557d77b91b83
 called by frame at 0x7ffcf6d2f590, caller of frame at 0x7ffcf6d2f490
 source language c++.
 Arglist at 0x7ffcf6d2f488, args: this=0x557e37353c70, xpos=-4, ypos=-93
 Locals at 0x7ffcf6d2f488, Previous frame's sp is 0x7ffcf6d2f530
 Saved registers:
  rbx at 0x7ffcf6d2f508, rbp at 0x7ffcf6d2f520, r12 at 0x7ffcf6d2f510, r13 at 0x7ffcf6d2f518, rip at 0x7ffcf6d2f528
(gdb) frame 6
#6  0x0000557d77f1e47f in haltestelle_t::display_status (this=0x557e37353c70, xpos=-4, ypos=-93) at /home/freddy/git/simutrans-extended/simhalt.cc:5064
5064    /home/freddy/git/simutrans-extended/simhalt.cc: No such file or directory.
(gdb) info args
this = 0x557e37353c70
xpos = -4
ypos = -93
(gdb) info locals
sum = 6
v = 2
j = 0
catg_sum = 6
g_class = 1 '\001'
wtyp = 0x557d820e7ae0
i = 0 '\000'
count = 0
x = -4
bar_height_index = 0
max_capacity = 0
total_ware = 0
dirty = 23
(gdb) p this
$1 = (haltestelle_t * const) 0x557e37353c70
(gdb) p * 0x557e37353c70
$2 = 10
(gdb) p * (haltestelle_t) 0x557e37353c70
Invalid cast.
(gdb) gdb p this->desc
Undefined command: "gdb".  Try "help".
(gdb) p this->desc
There is no member or method named desc.
(gdb) p this->desc_t
There is no member or method named desc_t.
(gdb) p goods_manager_t::passengers->get_number_of_classes()
$3 = 5 '\005'
(gdb) p get_pax_enabled()
$4 = false

From optimized debug build (text here):



Possible cause

Perhaps the status bar waiting graphs cannot be correctly displayed now that the station has lost its passenger and mail capacity?

Offline Ranran

  • Devotee
  • *
  • Posts: 1412
  • Languages: ja
EDIT:
No, I was able to reproduce it. I misread the report. When I removed it, it crashed.
I'll look it up.

EDIT2:
Unfortunately, I haven't been able to reproduce the crash since then.
It would be nice to be able to see which options can be reliably reproduced.
« Last Edit: January 08, 2021, 12:46:51 PM by Ranran »

Offline Ranran

  • Devotee
  • *
  • Posts: 1412
  • Languages: ja
Unfortunately I can't reproduce the "crash".

The strange thing is that 0 is in the range 0-4294967295??? So I don't understand the meaning of the message.
It looks like a debug message is stopping the game, not a crash.

Offline Matthew

  • *
  • Posts: 511
    • Japan Railway Journal
  • Languages: EN, some ZH, DE & SQ
Unfortunately I can't reproduce the "crash".The strange thing is that 0 is in the range 0-4294967295??? So I don't understand the meaning of the message.
It looks like a debug message is stopping the game, not a crash.

Thank you for investigating. I agree that it is a strange message.  ???

I now have a more reproducible example which does not have the strange thing.  ;D

Steps to reproduce with a small save
1. Download and open this save game.
2. Open the Display Settings Dialogue and make sure that station Waiting Graphs are on.
3. Jump to (4,119).
4. Wait for the bus to depart from Douggairn Marsh Stop.
5. Demolish the bus stop at (4,119,2).
6. The client will soft crash and the message will say "index out of bounds: 7 not in 0..6"

This was tested with both yesterday's Bridgewater-Brunel build #901a35c and this debug build of #342c977. The backtrace is very similar to the examples above. If anyone needs a core dump, I have one to use with that debug build, but it's >5GiB so I won't upload it unless necessary.


Offline Ranran

  • Devotee
  • *
  • Posts: 1412
  • Languages: ja
Thank you for providing a reproducible case. It was very helpful.
I think I've fixed it. Check pull request # 337.

Offline Matthew

  • *
  • Posts: 511
    • Japan Railway Journal
  • Languages: EN, some ZH, DE & SQ
Thank you for providing a reproducible case. It was very helpful.
I think I've fixed it. Check pull request # 337.

The fix has been tested and it works. Thank you, Ranran! That was so quick!  :thumbsup: