Skip to content
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Donate
Collapse

Plutonium

  1. Home
  2. BO2 Server Hosting Support
  3. Preventing potentially infinite loops in T6 Server/Spitting errors in log file

Preventing potentially infinite loops in T6 Server/Spitting errors in log file

Scheduled Pinned Locked Moved BO2 Server Hosting Support
11 Posts 3 Posters 502 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • Rex109undefined Offline
    Rex109undefined Offline
    Rex109
    wrote on last edited by Rex109
    #1

    Hello! My server keeps crashing everyday or so and i strongly believe that there's an infinte loop in one of my scripts that causes this since it keeps sending heartbeats but i can't see the server unless i restart it. Having said so, is there a way to prevent infinite script loops on a T6 server? (just like the old cod4 did... if there was an infinite loop the server would just crash with a log instead of hanging forever). Do i need to set a dvar in order to show runtime errors/loops on the log?

    Thanks in advance!

    Dss0undefined JezuzLizardundefined 2 Replies Last reply
    0
    • Rex109undefined Rex109

      Hello! My server keeps crashing everyday or so and i strongly believe that there's an infinte loop in one of my scripts that causes this since it keeps sending heartbeats but i can't see the server unless i restart it. Having said so, is there a way to prevent infinite script loops on a T6 server? (just like the old cod4 did... if there was an infinite loop the server would just crash with a log instead of hanging forever). Do i need to set a dvar in order to show runtime errors/loops on the log?

      Thanks in advance!

      Dss0undefined Offline
      Dss0undefined Offline
      Dss0
      Plutonium Staff
      wrote on last edited by
      #2

      Rex109 no, you need to fix the scripts so they don't contain infinite loops.

      Rex109undefined 1 Reply Last reply
      0
      • Dss0undefined Dss0

        Rex109 no, you need to fix the scripts so they don't contain infinite loops.

        Rex109undefined Offline
        Rex109undefined Offline
        Rex109
        wrote on last edited by
        #3

        Dss0 Ofc i have to fix them, but there's no way to get a traceback to the error since the server doesn't spit any runtime errors in the log file... are you 100% sure there's no way to get a traceback?

        Dss0undefined 1 Reply Last reply
        0
        • Rex109undefined Rex109

          Dss0 Ofc i have to fix them, but there's no way to get a traceback to the error since the server doesn't spit any runtime errors in the log file... are you 100% sure there's no way to get a traceback?

          Dss0undefined Offline
          Dss0undefined Offline
          Dss0
          Plutonium Staff
          wrote on last edited by
          #4

          Rex109 yea i'm pretty sure. Does your server stop crashing without custom scripts?

          Rex109undefined 1 Reply Last reply
          0
          • Rex109undefined Rex109

            Hello! My server keeps crashing everyday or so and i strongly believe that there's an infinte loop in one of my scripts that causes this since it keeps sending heartbeats but i can't see the server unless i restart it. Having said so, is there a way to prevent infinite script loops on a T6 server? (just like the old cod4 did... if there was an infinite loop the server would just crash with a log instead of hanging forever). Do i need to set a dvar in order to show runtime errors/loops on the log?

            Thanks in advance!

            JezuzLizardundefined Offline
            JezuzLizardundefined Offline
            JezuzLizard
            Plutonium Staff
            wrote on last edited by
            #5

            Rex109 Infinite loops are pretty easy to find. All you need to do is check every loop in your scripts and make sure the loop can exit when its supposed to.

            If for some reason the condition for the for loop or while loop becomes undefined it can cause an infinite loop. Additionally with the current compiler you cannot nest foreachs inside another foreach nor can you use a continue in a for loop or foreach.

            https://github.com/xensik/gsc-tool is recommended because it has none of these issues.

            Rex109undefined 1 Reply Last reply
            0
            • JezuzLizardundefined JezuzLizard

              Rex109 Infinite loops are pretty easy to find. All you need to do is check every loop in your scripts and make sure the loop can exit when its supposed to.

              If for some reason the condition for the for loop or while loop becomes undefined it can cause an infinite loop. Additionally with the current compiler you cannot nest foreachs inside another foreach nor can you use a continue in a for loop or foreach.

              https://github.com/xensik/gsc-tool is recommended because it has none of these issues.

              Rex109undefined Offline
              Rex109undefined Offline
              Rex109
              wrote on last edited by Rex109
              #6

              JezuzLizard First of all thanks for your reply. Yeah you are right, it's not absolutely hard to find one, but i was thinking that on T6 there was something like on IW3 (cod4): a timeout thread that prevented infinite loops by terminating the server with a runtime error instead of hanging it forever. Second of all thanks for the compiler, i wasn't searching for a new one but the one you provided me seems way better than the one on the plutonium guide, so thanks alot! Also i think i've found the error (not 100% sure but it seems it hasn't crashed for a while now), but i wanna point out that i'm not searching for a solution for a problem of mine but rather a way to better debug my scripts and provide better maintainability to my projects.

              1 Reply Last reply
              0
              • Dss0undefined Dss0

                Rex109 yea i'm pretty sure. Does your server stop crashing without custom scripts?

                Rex109undefined Offline
                Rex109undefined Offline
                Rex109
                wrote on last edited by
                #7

                Dss0 Never tried it but i'm sure it does not. I'm absolutely sure that one of my gsc is causing the issue

                1 Reply Last reply
                0
                • Rex109undefined Offline
                  Rex109undefined Offline
                  Rex109
                  wrote on last edited by
                  #8
                  This post is deleted!
                  1 Reply Last reply
                  0
                  • Rex109undefined Offline
                    Rex109undefined Offline
                    Rex109
                    wrote on last edited by Rex109
                    #9

                    Update: server is still hanging randomly, sending heartbeats infinitely and saying they were successful when neither IW4Madmin and a client can connect to it. I suppose it's another infinite loop? Plus not my actual client crashes whenever i search a server? Dafuq?

                    JezuzLizardundefined 1 Reply Last reply
                    0
                    • Rex109undefined Rex109

                      Update: server is still hanging randomly, sending heartbeats infinitely and saying they were successful when neither IW4Madmin and a client can connect to it. I suppose it's another infinite loop? Plus not my actual client crashes whenever i search a server? Dafuq?

                      JezuzLizardundefined Offline
                      JezuzLizardundefined Offline
                      JezuzLizard
                      Plutonium Staff
                      wrote on last edited by
                      #10

                      Rex109 Try using this plugin in your server:

                      https://github.com/fedddddd/t6-gsc-utils/releases/tag/v1.9.9

                      Rex109undefined 1 Reply Last reply
                      0
                      • JezuzLizardundefined JezuzLizard

                        Rex109 Try using this plugin in your server:

                        https://github.com/fedddddd/t6-gsc-utils/releases/tag/v1.9.9

                        Rex109undefined Offline
                        Rex109undefined Offline
                        Rex109
                        wrote on last edited by Rex109
                        #11

                        JezuzLizard This is EXACTLY what i was looking for. Thank you so much!

                        Edit: i see it's uploaded yesterday. super duper ultra useful update dude. tysm!

                        1 Reply Last reply
                        0
                        Reply
                        • Reply as topic
                        Log in to reply
                        • Oldest to Newest
                        • Newest to Oldest
                        • Most Votes


                        • Login

                        • Don't have an account? Register

                        • Login or register to search.
                        • First post
                          Last post
                        0
                        • Recent
                        • Tags
                        • Popular
                        • Users
                        • Groups
                        • Donate