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 cmtjoancolmenero, Yesterday, 03:58 PM
            11 responses
            39 views
            0 likes
            Last Post cmtjoancolmenero  
            Started by FrazMann, Today, 11:21 AM
            0 responses
            5 views
            0 likes
            Last Post FrazMann  
            Started by geddyisodin, Yesterday, 05:20 AM
            8 responses
            52 views
            0 likes
            Last Post NinjaTrader_Gaby  
            Started by DayTradingDEMON, Today, 09:28 AM
            4 responses
            27 views
            0 likes
            Last Post DayTradingDEMON  
            Started by George21, Today, 10:07 AM
            1 response
            22 views
            0 likes
            Last Post NinjaTrader_ChristopherJ  
            Working...
            X