Author Topic: [One-way Two-lane road Fun Patch related] crash after road modification  (Read 1098 times)

0 Members and 1 Guest are viewing this topic.

Offline sheldon_cooper

My Simutrans is 120.2.2 (r8128), I am using the latest version of the OTRP 9.0 patch.
Using pak way-object.override_0
I've been playing with these updates for a long time, no problem, but after I change a road (it's a highway, and I'm trying to elevate it), this problem appears, what should it be?

« Last Edit: March 31, 2017, 11:50:37 AM by Dwachs »

Offline THLeaderH

Re: Simutrans stops working after changing the road.
« Reply #1 on: March 29, 2017, 04:56:02 AM »
Thank you for your bug report. :D
I couldn't reproduce your problem in my test code. Could you make a video to describe this problem if it's not a heavy work for you?

I should note that there was a commit which fixed "crash with elevated way tool and shift" problem in r8152.

Offline sheldon_cooper

Re: Simutrans stops working after changing the road.
« Reply #2 on: March 30, 2017, 02:11:03 AM »
Here is the video:

If I do not change anything, the error does not happen, and the game usually occurs. What should it be?

Offline prissi

  • Developer
  • Administrator
  • *
  • Posts: 8830
  • Total likes: 324
  • Helpful: 229
  • Languages: De,EN,JP
Re: Simutrans stops working after changing the road.
« Reply #3 on: March 30, 2017, 05:35:52 AM »
Maybe the code make the look ahead could not assume that there might be no longer a valid ground tile anymore. You should wait for the patch being integrated into imutrans, because I highly doubt those flagged roads will make it into the final version.

Offline THLeaderH

Re: Simutrans stops working after changing the road.
« Reply #4 on: March 31, 2017, 11:14:33 AM »
Quote
Maybe the code make the look ahead could not assume that there might be no longer a valid ground tile anymore.
I saw sheldon_cooper's video and succeeded in reproducing the bug. This is a typical null pointer access. I didn't write null pointer checks in many points. However, just enclosing by "if" may bring unexpected problems. I think route reculculation should be called when the return value of
Code: [Select]
welt->lookup(r.at(test_index));

I should leave these bugs to be solved by the great simutrans dev team, I think...?

Offline Dwachs

  • DevTeam, Coder/patcher
  • Administrator
  • *
  • Posts: 4274
  • Total likes: 195
  • Helpful: 149
  • Languages: EN, DE, AT
Re: Simutrans stops working after changing the road.
« Reply #5 on: March 31, 2017, 11:31:06 AM »
@THLeadierH Where does it crash? How can this be reproduced?
Parsley, sage, rosemary, and maggikraut.

Offline THLeaderH

Re: Simutrans stops working after changing the road.
« Reply #6 on: March 31, 2017, 11:35:46 AM »
Quote
@THLeadierH Where does it crash? How can this be reproduced?
Just follow the sheldon's video and it'll crash.
Overtaking convoys always check 4 tiles ahead to avoid head on crash. If the height of ground in route is changed using slope tools, the checking method get invalid ground. The instance of grund_t is null and this causes null pointer access.

Offline Dwachs

  • DevTeam, Coder/patcher
  • Administrator
  • *
  • Posts: 4274
  • Total likes: 195
  • Helpful: 149
  • Languages: EN, DE, AT
Re: Simutrans stops working after changing the road.
« Reply #7 on: March 31, 2017, 11:37:38 AM »
This affects unpatched version as well, I guess?  The null-pointer dereferencing happens at which position in the code?
Parsley, sage, rosemary, and maggikraut.

Offline THLeaderH

Re: Simutrans stops working after changing the road.
« Reply #8 on: March 31, 2017, 11:41:56 AM »
No. I tested on r7720 stable and it worked fine.
I found the null-pointer dereferencing happens at
  • vehicle/simvehicle.cc:2238
  • vehicle/simvehicle.cc:2591
but I don't know there are others.
« Last Edit: March 31, 2017, 11:52:02 AM by THLeaderH »

Offline sheldon_cooper

Re: [One-way Two-lane road Fun Patch related] crash after road modification
« Reply #9 on: October 16, 2017, 12:23:16 AM »
Hello, recently I went to make a change on the highway, (the same way the video added here) and the same problem occurred, the strange thing is that this mistake had already been solved, and was not happening in my game anymore. I am currently using Sim.exe 120.2.2 (Nightly r8128) pak128 2.5.2
Thank you very much in advance!
 :)

Offline THLeaderH

Re: [One-way Two-lane road Fun Patch related] crash after road modification
« Reply #10 on: October 16, 2017, 08:03:41 AM »
Thank you for your report.
In what version of OTRP did the phenomenon occur? Is that bug reproducible? Or impossible?

Offline sheldon_cooper

Re: [One-way Two-lane road Fun Patch related] crash after road modification
« Reply #11 on: October 16, 2017, 11:19:08 PM »
is the same error that occurs in the video, which I added here, see:
Here is the video:

If I do not change anything, the error does not happen, and the game usually occurs. What should it be?

OTRP Version 9.0.

I remember that the problem had been solved, after I downloaded an update on Nightly builds. I may have updated a file that corrected this problem, but I do not know which one, and I do not remember the version of Nightly builds.

Offline THLeaderH

Re: [One-way Two-lane road Fun Patch related] crash after road modification
« Reply #12 on: October 17, 2017, 12:01:23 AM »
I tested this case with OTRP v12_3 but couldn't reproduce the error. Could you test this with OTRP v12_3?

Offline sheldon_cooper

Re: [One-way Two-lane road Fun Patch related] crash after road modification
« Reply #13 on: October 17, 2017, 01:19:39 AM »
probably, this error does not occur in the OTRP v12_3 version as it is already fixed.
The last time I tested the latest version, it was giving compatibility problems with my saved game, now, I'm using version 9.0, because this version is not making an error with my saved game. But I will try to recreate this error with the newest version, as you indicated.