Forum Discussion

MarkRoddy's avatar
MarkRoddy
Visitor
16 years ago

Issue Causing DVP to Crash

I've come across a "bug" that is causing my DVP to crash repeatably (I hesitate to use the term bug as I was doing something more or less incorrect with a brightscript object).

The issue seems to occur when iterating over an array that does not have all it's values specified. I have a specific code segment below which will reproduce the issue (every time I've run it at least). After executing the code, the box will freeze for a few seconds before rebooting. I do not see any output on the debug console except for my telnet client telling me that the connection was closed by the remote host.

Iterating over an array which has 'empty' positions is probably not something I should be doing (and not what I had meant to do), but going through a reboot also doesn't seem like a good reaction.

My DVP is running v2.4 - build 357

Here is the code to reproduce:
Sub Main()
array = CreateObject("roArray", 3, false)
array[1] = 1
array[2] = 2
for each i in array
print i
end for
End Sub


Also, I wasn't sure what the desired channel for reporting bugs is. If there is a bug tracker some where I should report this to, please let me know.

-Mark

8 Replies

  • "MarkRoddy" wrote:
    Here is the code to reproduce:
    Sub Main()
    array = CreateObject("roArray", 3, false)
    array[1] = 1
    array[2] = 2
    for each i in array
    print i
    end for
    End Sub




    You're trying to print an uninitialized array element as the first element of the loop (array[0]); my experience is that this will cause the box to crash - I don't think that's a bug per se.
  • bcl's avatar
    bcl
    Channel Surfer
    I disagree. It should print something like 'None' or 'NaN' but not bring down the whole thing. Since we are parsing XML from remote feeds it is quite possible that we could end up with uninitialized variables at some point.
  • "bcl" wrote:
    Since we are parsing XML from remote feeds it is quite possible that we could end up with uninitialized variables at some point.


    Your code should be checking for that.
  • Nothing that a brightscript app does should cause the box to crash. A bug in the app may of course cause the app to crash, but if the box crashes it's a bug in the firmware.

    --Mark
  • uninitialized array elements should return type/value "invalid". If they don't, its a bug. I'll have someone put this in our internal bug system.

    thanks
  • Has a fixed for this been pushed out yet? I've hit the same behavior (unit crashing and rebooting) in a similar but not exactly equivalent situation, and I wasn't sure if I had hit the same bug or not.

    -Mark
  • Mark,

    There is no public bug tracker, so this forum is the best place to post bugs.

    I've confirmed that this script still causes our firmware to crash and have opened a bug on it. I do not have a date on when a fix would be rolled out, so try to avoid uninitialized array elements in your code....

    --Kevin
  • "RokuKevin" wrote:
    Mark,

    There is no public bug tracker, so this forum is the best place to post bugs.

    I've confirmed that this script still causes our firmware to crash and have opened a bug on it. I do not have a date on when a fix would be rolled out, so try to avoid uninitialized array elements in your code....

    --Kevin


    Kevin,
    Are there any other known issues which would cause the unit to reset itself? I ask as I've found what I think is a separate issue, but I'm having trouble isolating it as it is not consistently causing my unit to crash.

    -Mark