Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

NT8b9 Crash: StackOverflow on start up

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

    NT8b9 Crash: StackOverflow on start up

    After some minor change to my strategy code NT8 crashed on me. I wasn't worried much but then I couldn't start NT again as it crashed every time on start up. I tried removing existing workspaces but it didn't help. Log and Trace files are clear but debugging in VS showed stack overflow error:
    System.StackOverflowException was unhandled
    Message: An unhandled exception of type 'System.StackOverflowException' occurred in NinjaTrader.Custom.dll

    Deleting existing NinjaTrader.Custom.dll finally helped to start NT with no problems

    #2
    I tried to backtrack changes I made to a strategy to find what was causing the crash and subsequent corruption and realised I applied the change that was working with no problems for a while in Indicators - adding fallback exception handling in custom base class. Only it seems the following:
    Code:
    [FONT=Consolas][SIZE=2][COLOR=#0000ff][FONT=Consolas][SIZE=2][COLOR=#0000ff][FONT=Consolas][SIZE=2][COLOR=#0000ff]protected [/COLOR][/SIZE][/FONT][/COLOR][/SIZE][/FONT][/COLOR][/SIZE][/FONT][FONT=Consolas][SIZE=2][COLOR=#0000ff][FONT=Consolas][SIZE=2][COLOR=#0000ff][FONT=Consolas][SIZE=2][COLOR=#0000ff]virtual [/COLOR][/SIZE][/FONT][/COLOR][/SIZE][/FONT][/COLOR][/SIZE][/FONT][FONT=Consolas][SIZE=2][COLOR=#0000ff][FONT=Consolas][SIZE=2][COLOR=#0000ff][FONT=Consolas][SIZE=2][COLOR=#0000ff]void[/COLOR][/SIZE][/FONT][/COLOR][/SIZE][/FONT][/COLOR][/SIZE][/FONT][FONT=Consolas][SIZE=2][FONT=Consolas][SIZE=2] SafeOnStateChange()[/SIZE][/FONT]
    [SIZE=2][FONT=Consolas]{[/FONT][/SIZE]
    [SIZE=2][FONT=Consolas]}[/FONT][/SIZE]
    [SIZE=2][FONT=Consolas][FONT=Consolas][SIZE=2][COLOR=#0000ff][FONT=Consolas][SIZE=2][COLOR=#0000ff][FONT=Consolas][SIZE=2][COLOR=#0000ff]protected [/COLOR][/SIZE][/FONT][/COLOR][/SIZE][/FONT][/COLOR][/SIZE][/FONT][FONT=Consolas][SIZE=2][COLOR=#0000ff][FONT=Consolas][SIZE=2][COLOR=#0000ff][FONT=Consolas][SIZE=2][COLOR=#0000ff]override [/COLOR][/SIZE][/FONT][/COLOR][/SIZE][/FONT][/COLOR][/SIZE][/FONT][FONT=Consolas][SIZE=2][COLOR=#0000ff][FONT=Consolas][SIZE=2][COLOR=#0000ff][FONT=Consolas][SIZE=2][COLOR=#0000ff]void[/COLOR][/SIZE][/FONT][/COLOR][/SIZE][/FONT][/COLOR][/SIZE][/FONT][FONT=Consolas][SIZE=2][FONT=Consolas][SIZE=2] OnStateChange()[/SIZE][/FONT]
    [SIZE=2][FONT=Consolas]{[/FONT][/SIZE]
    [/SIZE][/FONT][FONT=Consolas][SIZE=2][COLOR=#0000ff][FONT=Consolas][SIZE=2][COLOR=#0000ff][FONT=Consolas][SIZE=2][COLOR=#0000ff]  try[/COLOR][/SIZE][/FONT]
    [/COLOR][/SIZE][/FONT][/COLOR][/SIZE][/FONT][FONT=Consolas][SIZE=2][FONT=Consolas][SIZE=2]  {[/SIZE][/FONT]
    [SIZE=2][FONT=Consolas]      SafeOnStateChange();[/FONT][/SIZE]
    [SIZE=2][FONT=Consolas]  }[/FONT][/SIZE]
    [/SIZE][/FONT][FONT=Consolas][SIZE=2][COLOR=#0000ff][FONT=Consolas][SIZE=2][COLOR=#0000ff][FONT=Consolas][SIZE=2][COLOR=#0000ff]  catch[/COLOR][/SIZE][/FONT][/COLOR][/SIZE][/FONT][/COLOR][/SIZE][/FONT][FONT=Consolas][SIZE=2][FONT=Consolas][SIZE=2] ([/SIZE][/FONT][/SIZE][/FONT][FONT=Consolas][SIZE=2][COLOR=#2b91af][FONT=Consolas][SIZE=2][COLOR=#2b91af][FONT=Consolas][SIZE=2][COLOR=#2b91af]Exception[/COLOR][/SIZE][/FONT][/COLOR][/SIZE][/FONT][/COLOR][/SIZE][/FONT][FONT=Consolas][SIZE=2][FONT=Consolas][SIZE=2] ex)[/SIZE][/FONT]
    [SIZE=2][FONT=Consolas]  {[/FONT][/SIZE]
    [SIZE=2][FONT=Consolas]      Print(ex);[/FONT][/SIZE]
    [SIZE=2][FONT=Consolas]  }[/FONT][/SIZE]
    [/SIZE][/FONT][FONT=Consolas][SIZE=2][COLOR=#0000ff][FONT=Consolas][SIZE=2][COLOR=#0000ff][FONT=Consolas][SIZE=2][COLOR=#0000ff]  base[/COLOR][/SIZE][/FONT][/COLOR][/SIZE][/FONT][/COLOR][/SIZE][/FONT][FONT=Consolas][SIZE=2][FONT=Consolas][SIZE=2].OnStateChange();[/SIZE][/FONT]
    [SIZE=2][FONT=Consolas]}[/FONT][/SIZE]
    [/SIZE][/FONT][/FONT][/SIZE][/SIZE][/FONT]
    And using SafeOnStateChange in the strategy, will generate the following fatal error:
    Attached Files

    Comment


      #3
      Hello gregid,

      Thank you for reporting this item.

      I am unable to reproduce this on my end. Can you attach the full script used to test this?

      Comment


        #4
        I can't attach the full script but I will try to make a minimal version that reproduces this problem and attach it here

        Comment


          #5
          Update

          Update:

          You can close the issue - the overflow was due me accidentally leaving a call back to original method eg. base.OnStateChange();
          from my "Safe" method causing a loop.

          Comment


            #6
            Thank you for the update, gregid.

            Comment

            Latest Posts

            Collapse

            Topics Statistics Last Post
            Started by andrewtrades, Today, 04:57 PM
            1 response
            10 views
            0 likes
            Last Post NinjaTrader_Manfred  
            Started by chbruno, Today, 04:10 PM
            0 responses
            6 views
            0 likes
            Last Post chbruno
            by chbruno
             
            Started by josh18955, 03-25-2023, 11:16 AM
            6 responses
            436 views
            0 likes
            Last Post Delerium  
            Started by FAQtrader, Today, 03:35 PM
            0 responses
            9 views
            0 likes
            Last Post FAQtrader  
            Started by rocketman7, Today, 09:41 AM
            5 responses
            20 views
            0 likes
            Last Post NinjaTrader_Jesse  
            Working...
            X