Some routes crash TSRE

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • necrails
    Senior Member
    • Jul 2003
    • 152
    • Fanwood, N, Union.

    #1

    Some routes crash TSRE

    I have been learning TSRE with the hope of eventually building my own route. I do this by selecting an existing route and attempting to add scenic objects or additional track. I always have at least 2 backups in the event of a catastrophic failure. What I am finding is several routes either freeze after a minute or so or fail to open at all. Most notably this has happened with Surfliner 2.3 and So cal which simply freeze after opening. B & O west end just fails to open at all so activity creation is a non starter. I recently downloaded the max overhaul version of TSRE just to see what would happen. For whatever reason I the program stays open longer but B & O West end remains a non starter. Changing direction I downloaded the L&PS Bathurst St. Yard Module figuring it was smaller and easier to work on as a practice route. To my surprise and disappointment this route also crashes every version of TSRE. If it does open any attempt at navigation or selection of an object crashes the program. Now this is an old route posted before London and Port Stanley, seems not overly object intensive and maybe one or 2 tiles total not at all like B & O West end or Surfliner. My theory is this little route is missing something that TSRE wants to see so my question which may or may not have an answer is what does TSRE look for when opening a route. BTW, all of the aforementioned routes load and run in Open Rails with no problem. Now I can mess with other routes this size like Sweethaven or Timesaver but it is a mystery why a few routes just will not play nice with TSRE. This sounds like a coding issue, any thoughts?
  • baldwin
    6000 Post Veteran


    • Nov 1999
    • 6358
    • Chippenham, Wiltshire, UK.
    • ORTS

    #2
    I have a British route that does the same with all but one version of TSRE. The original version by Goku will open the route, but then crashes as soon as the view is changed.
    Beer is not a matter of life or death, it is much more serious than that.

    Comment

    • GokuMK
      Senior Member

      • Oct 2015
      • 729
      • Poland

      #3
      Usually it is caused by a corrupted file and memory leak caused by it. TSRE is vulnerable to this kind of "attack".
      That is why TSRE versions compiled by different compilers behave differently.

      You can give me the route, I could maybe check it for you.

      Comment

      • baldwin
        6000 Post Veteran


        • Nov 1999
        • 6358
        • Chippenham, Wiltshire, UK.
        • ORTS

        #4
        I think dropbox will be easiest. I can send you a link via PM\DM later.
        Beer is not a matter of life or death, it is much more serious than that.

        Comment

        • baldwin
          6000 Post Veteran


          • Nov 1999
          • 6358
          • Chippenham, Wiltshire, UK.
          • ORTS

          #5
          PM not working link here ( link removed ) 5th August
          It is a very old payware route, it does open in the old MSTS RE.
          Last edited by baldwin; 08-05-2026, 13:02.
          Beer is not a matter of life or death, it is much more serious than that.

          Comment

          • GokuMK
            Senior Member

            • Oct 2015
            • 729
            • Poland

            #6
            Thanks, downloaded it.

            Comment

            • GokuMK
              Senior Member

              • Oct 2015
              • 729
              • Poland

              #7
              Does this route use custom Global or default one?

              Edit, ok found compatibile tsection. Good thing, it works well in 0.7.6. But indeed something crashes in old 0.7 version.
              Last edited by GokuMK; 08-04-2026, 14:31.

              Comment

              • GokuMK
                Senior Member

                • Oct 2015
                • 729
                • Poland

                #8
                Originally posted by baldwin
                PM not working link here https://www.dropbox.com/scl/fi/g0qnmb40ll0tp39wwxuhk/PeakRail.zip?rlkey=j31s3vtfrnm3piwc5jk0toevu&st=ys 5g1r4p&dl=0
                It is a very old payware route, it does open in the old MSTS RE.
                The issue is here:
                Code:
                    Signal (
                        UiD ( 1542 )
                        FileName ( Peak_DarleySouth.s )
                        Position ( -452.328 101.432 564.537 )
                        QDirection ( 0 0.346117 0 0.938191 )
                        VDbId ( 4294967295 )
                        StaticDetailLevel ( 5 )
                        SignalSubObj ( 00000000 )
                    )
                Broken signal crashed TSRE. My new TSRE 0.7.6 build has fix for it. You can download some version on my page.
                To fix the route, delete this object.

                Short AI explanation below:
                ---
                The crash is an out-of-bounds access in the old signal interactive-marker renderer.

                SignalSubObj ( 00000000 ) is only correlated with the fault. The decisive problem is that Signal UID 1542 has no SignalUnits block:
                Code:
                Signal (
                UiD ( 1542 )
                FileName ( Peak_DarleySouth.s )
                ...
                SignalSubObj ( 00000000 )
                )
                In v0.7.012:
                Code:
                int i = getBaseSignalItemId(); // returns -1: no enabled signal unit
                if (drawPositions[i] == NULL) return; // accesses drawPositions[-1]
                That is undefined behavior and can crash. It occurs only when the object enters the rendering path and interactive markers are enabled, explaining why rotating the camera toward it triggers the failure. Renaming it to Signal22 makes the world loader ignore the object entirely.

                The current code explicitly fixes this at SignalObj.cpp:
                Code:
                int i = getBaseSignalItemId();
                if (i < 0)
                return;
                if (drawPositions[i] == NULL)
                return;
                That guard was introduced by commit b5ac855 (“New renderer by 5.3”), when the source version was v0.7.605. So signal parsing was largely unchanged, but this particular signal rendering path was changed.

                For the route data, UID 1542 appears to be an orphan decorative signal: it has no corresponding track-item reference. It should normally be deleted or changed to Static, unless a proper SignalUnits/TDB connection is restored.

                ​

                Comment

                • GokuMK
                  Senior Member

                  • Oct 2015
                  • 729
                  • Poland

                  #9
                  And here can you download new not crashing TSRE:
                  Contribute to GokuMK/TSRE5vc development by creating an account on GitHub.

                  Comment

                  • baldwin
                    6000 Post Veteran


                    • Nov 1999
                    • 6358
                    • Chippenham, Wiltshire, UK.
                    • ORTS

                    #10
                    Thanks for the detailed explanation of why the route crashed all of my TSRE versions and for the link to your latest release.
                    Beer is not a matter of life or death, it is much more serious than that.

                    Comment

                    • eric
                      9500 Post Veteran and Administrator



                      • Dec 2002
                      • 9583
                      • NS MP245.4 CNO&TP South District
                      • English, SQL
                      • General

                      #11
                      Originally posted by GokuMK
                      Code:
                      int i = getBaseSignalItemId();
                      if (i < 0) return;
                      if (drawPositions[i] == NULL) return;
                      I've added that same fix into the 8.006 code base
                      If you like what you see here at Trainsim.com, be it the discussions and knowledge in the forums, or items available in our library, I hope you'll consider a paid membership to help support keeping the site operating.... Thanks!

                      Comment

                      • necrails
                        Senior Member
                        • Jul 2003
                        • 152
                        • Fanwood, N, Union.

                        #12
                        Originally posted by GokuMK
                        Usually it is caused by a corrupted file and memory leak caused by it. TSRE is vulnerable to this kind of "attack".
                        That is why TSRE versions compiled by different compilers behave differently.

                        You can give me the route, I could maybe check it for you.
                        Thank you but not necessary. I'm just wondering why this happens. With B & O West end I end up starting the route in TSRE multiple times and then after several random attempts it loads but then fails. I have no intention of modifying this route but would like the editor to remain open for activity creation. The small route London route written almost 15 years ago I thought would be a simple one given its size. As I said I really want to play with small already built routes to learn all the necessary steps involved with TSRE and not have to navigate across multiple tiles. Same issue with So Cal and Surfliner 2.3. I thought these were just too big or object intensive and my computer said no mas. All other routes load fine and navigation is a breeze which makes me think there is something in one of the files in the route that either isn't present or corrupt. I'm not familiar with the term memory leak but will take your word for it. I'll try the latest release from GOKU.
                        All that being said TSRE is a great tool, takes a bit of practice but very robust once one learns how to use it.

                        Comment

                        Working...