News:

Simutrans.com Portal
Our Simutrans site. You can find everything about Simutrans from here.

Crash on powertunnel removal built by public player

Started by captain crunch, July 15, 2014, 02:59:41 PM

Previous topic - Next topic

0 Members and 1 Guest are viewing this topic.

captain crunch

When as player trying to delete a power tunnel built by the public player the
game crashes.


simu.log:
Simutrans version 120.0.1 Nightly from Jun 22 2014 rUnversioned directory
Preparing display ...
parse_simuconf() at pak/config/simuconf.tab:
Reading compatibility sound data ...
Reading city configuration ...
Reading speedbonus configuration ...
Reading menu configuration ...
Reading object data from pak/...
Reading menu configuration ...
Midi disabled ...
Creating cities ...
Creating cities: 1
Creating factories ...
Preparing startup ...
Show banner ...
Running world, pause=0, fast forward=0 ...
World destroyed.
World destroyed.


gdb backtrace:
#0  0x00000000006b6d66 in wkz_remover_t::wkz_remover_intern (this=0x353c8c0,
    sp=0x4303a00, pos=..., msg=@0x7fffeb15a008: 0x0) at simwerkz.cc:567
#1  0x00000000006b78dc in wkz_remover_t::work (this=0x353c8c0, sp=0x4303a00,
    pos=...) at simwerkz.cc:742
#2  0x000000000069924d in interaction_t::interactive_event (this=0x3c07190,
    ev=...) at siminteraction.cc:242
#3  0x00000000006999af in interaction_t::process_event (this=0x3c07190, ev=...)
    at siminteraction.cc:378
#4  0x0000000000699a4b in interaction_t::check_events (this=0x3c07190)
    at siminteraction.cc:400
#5  0x00000000006f3255 in karte_t::interactive (this=0x3548fb0,
    quit_month=2147483647) at simworld.cc:6789
#6  0x00000000006a301b in simu_main (argc=1, argv=0x7fffeb15c2a8)
    at simmain.cc:1273
#7  0x00000000006b29d3 in sysmain (argc=1, argv=0x7fffeb15c2a8)
    at simsys.cc:700
#8  0x000000000071adcc in main (argc=1, argv=0x7fffeb15c2a8)
    at simsys_s2.cc:656



Ters

This appears to be a possible relative of http://forum.simutrans.com/index.php?topic=13787.0. What they have in common is the way powerlines are treated differently from other ways. I'm not sure what to do with this one.

Edit:
Oh, and perhaps importantly for fellow developers: When I tried to reproduce it, the offending line was 550. Line 567, as in the original post, shouldn't be able to crash. My crash is because gr->get_weg_nr(0) returns NULL because no has_way flags are set.

kierongreen

Ok, so the problem here is had a couple of parts:

As Ters says, gr->get_weg_nr(0) returns NULL due to there being no ways - this is correct as powerlines don't count as ways so a check needed to be added there when players were trying to remove other players powerline tunnels. However this section of code shouldn't have been reached when trying to remove public powerline tunnels - it was only reached because of the second part.

Normally objects can only be removed if they are unowned or owned by the player - ways are also allowed to be removed if they are owned by the public player. However this check was missing for powerlines therefore if a player tried to remove public powerlines this wouldn't work for tunnels. Another section of the code seemed to allow for powerline removal above ground anyway.

Fixed both issues in 7266.