Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

Bars.IsFirstBarOfSession NullReferenceException

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

    Bars.IsFirstBarOfSession NullReferenceException

    I got a NullReferenceException while calling Bars.IsFirstBarOfSession.

    Take note that the Bars property/object was NOT NULL. I had the Visual Studio debugger
    attached at the time that it happened and was able to confirm this. I was able to query the Bars object in the immediate window of the debugger.

    Fyi, The value of the CurrentBars property was something over 200 bars ( didn't get a chance to capture more details before the Rithimic connection timed out due do being blocked in the debugger and my call stack disappeared )

    I had loaded a new workspace and TickReplay backfill was in progress.

    Somewhere in the logic of the IsFirstBarOfSession there is a null reference being accessed.

    Log file entry:

    2016-11-10 11:48:30:563|3|4|Indicator 'AtsVolumeLadderVector': Error on calling 'OnBarUpdate' method on bar 224: Object reference not set to an instance of an object.

    #2
    Hello Brillo,

    What version of the Beta are you using?
    (You can find this in Help -> About...)

    I have created a very simple script that simply prints if Bars is null or if Bars.IsFirstBarOfSession is null.

    I am not able to reproduce this behavior with tick replay enabled or disabled.

    Are you able to reproduce this behavior using the attached script?

    If so, please attached the output this script prints to the Output Window with your next post.
    Attached Files
    Chelsea B.NinjaTrader Customer Service

    Comment


      #3
      Hi Chelsea,
      I'm running NT8 RC2.
      The exception is difficult to reproduce on a regular basis. As are a lot of the issues that remain in system, it's probably due to a race condition. The reason I had the debugger attached to NT8 in the first place was because I was trying to reproduce a different exception that had just happened prior.
      I point out the property IsFirstBarOfSession as a code area that should be reviewed on theoretical basis and any object references used in the implementation should be candidates for checking for null prior to use ( and possibly logging )

      Comment


        #4
        Hello Brillo,

        To report an issue to our development, I will need to reproduce this behavior on my end.

        Currently, I am not able to reproduce behavior that I can report to our development.

        Please let me know the steps I need to take with the example I have posted so that I may reproduce the behavior and enter a report on your behalf.
        Chelsea B.NinjaTrader Customer Service

        Comment


          #5
          I can't give you a use case but it's happening on a pretty regular basis in my setup.
          It's got multi-threaded issues and that's a whole class of debugging that use cases will not be found.
          It simply requires code review.
          It happened again though and this time I was able to get a screen capture. I was loading a workspace w/out a connection.
          See attached.

          Fyi about the screen shot attached.... the "Autos" debugging tab is showing members of the Bars object. The list of members is long and I scrolled it so that you could see the null exception happening when the debugger itself is trying to query the IsFirstBarOfSession. That line has the small red X and the line has a message explaining that it threw the null reference. Note that the rest of members are valid indicating that the Bars object itself is okay.
          Attached Files
          Last edited by Brillo; 11-10-2016, 07:16 PM.

          Comment


            #6
            I have more info on this ( please see prior post as well as this post will push it down before it's reviewed ).
            I've been reporting NT8 crashes over the last couple of weeks and I just received another but this time I had the Visual Studio debugger attached at the time and got a look at the callstack.
            It's the same call stack as the one in this thread but instead of the result being a null reference exception, it's a CLR Execution Exception which results in the Windows Process hosting the CLR ( and in turn NT8 ) to crash.
            See screen shot.
            Clearly something is getting corrupted in the memory of the CLR. Sometimes it's manifesting itself as null references and sometimes it's just a crash like this one.

            UPDATE. I just got another one. Attaching screenshot. Different callstack. I'm leaving it on screen in case you want to remote in and see.
            Attached Files
            Last edited by Brillo; 11-11-2016, 08:57 AM.

            Comment


              #7
              If no one is interested in connecting to my computer today to see this then I'm going to restart NT8 because I want to continue development. I'll wait until 2pm EST.

              Comment


                #8
                Hello Brillo,

                Thank you for your response.

                Can you send us a note to platformsupport[at]ninjatrader[dot]com and reference this thread with 'ATTN: Patrick H' in the subject line?
                We can then schedule a time to look into this on your PC.

                Comment

                Latest Posts

                Collapse

                Topics Statistics Last Post
                Started by prdecast, Today, 06:07 AM
                1 response
                4 views
                0 likes
                Last Post NinjaTrader_LuisH  
                Started by Christopher_R, Today, 12:29 AM
                1 response
                13 views
                0 likes
                Last Post NinjaTrader_LuisH  
                Started by chartchart, 05-19-2021, 04:14 PM
                3 responses
                577 views
                1 like
                Last Post NinjaTrader_Gaby  
                Started by bsbisme, Yesterday, 02:08 PM
                1 response
                15 views
                0 likes
                Last Post NinjaTrader_Gaby  
                Started by i019945nj, 12-14-2023, 06:41 AM
                3 responses
                60 views
                0 likes
                Last Post i019945nj  
                Working...
                X