Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Another periodic startup crash #560

Closed
TwitchBronBron opened this issue Apr 14, 2022 · 10 comments · Fixed by #710
Closed

Another periodic startup crash #560

TwitchBronBron opened this issue Apr 14, 2022 · 10 comments · Fixed by #710
Labels
bug Something isn't working

Comments

@TwitchBronBron
Copy link
Contributor

TwitchBronBron commented Apr 14, 2022

Describe the bug

Sideloading the app causes a crash, but only occasionally. It's hard to reproduce. I'm a little behind, running 5bf3a68 so perhaps someone has already solved this issue?

image

To Reproduce

  1. Sideload the channel
  2. Hope it crashes?

Expected behavior

Don't crash.

Logs
These might be from several runs, and it has some of the vscode extension logging included as well. I don't see anything stick out as helpful.

DebugServer: Moving selected files to staging area
DebugServer: Adding stop statements for active breakpoints
DebugServer: Creating zip archive from project sources
DebugServer: Connecting to Roku via telnet at 192.168.1.36
04-14 16:08:24.791 [beacon.signal] |AppLaunchInitiate ---------> TimeBase(0 ms)
04-14 16:08:24.792 [beacon.signal] |AppCompileInitiate --------> TimeBase(0 ms)
Note: Translation file loaded: pkg:/locale/en_US/translations.ts: 105 items.
04-14 16:08:24.795 [scrpt.cmpl] Compiling 'Jellyfin', id 'dev'
04-14 16:08:24.806 [scrpt.load.mkup] Loading markup dev 'Jellyfin'
04-14 16:08:24.814 [scrpt.unload.mkup] Unloading markup dev 'Jellyfin'
04-14 16:08:24.855 [scrpt.parse.mkup.time] Parsed markup dev 'Jellyfin' in 49 milliseconds
------ Compiling dev 'Jellyfin' ------
BRIGHTSCRIPT: WARNING: unused variable 'tracks' in function 'selectsubtitletrack' in #12
BRIGHTSCRIPT: WARNING: unused variable 'current' in function 'selectsubtitletrack' in #13
BRIGHTSCRIPT: WARNING: unused variable 'id' in function 'sortsubtitles' in #14
BRIGHTSCRIPT: WARNING: unused variable 'press' in function 'onkeyevent' in #15
BRIGHTSCRIPT: WARNING: unused variable 'key' in function 'onkeyevent' in #16
BRIGHTSCRIPT: WARNING: unused variable 'press' in function 'onkeyevent' in #17
BRIGHTSCRIPT: WARNING: unused variable 'msg' in function 'onstate' in #18
BRIGHTSCRIPT: WARNING: unused variable 'msg' in function 'buffercheck' in #19
BRIGHTSCRIPT: WARNING: unused variable 'e' in function 'processclientdiscoveryresponse' in #20
BRIGHTSCRIPT: WARNING: unused variable 'key' in function 'onkeyevent' in #21
BRIGHTSCRIPT: WARNING: unused variable 'press' in function 'onkeyevent' in #22
BRIGHTSCRIPT: WARNING: unused variable 'press' in function 'onkeyevent' in #23
BRIGHTSCRIPT: WARNING: unused variable 'key' in function 'onkeyevent' in #24
BRIGHTSCRIPT: WARNING: unused variable 'press' in function 'onkeyevent' in #25
Displayed 14 of 14 warnings
04-14 16:08:25.237 [scrpt.ctx.cmpl.time] Compiled 'Jellyfin', id 'dev' in 382 milliseconds (BCVer:0)
04-14 16:08:25.240 [scrpt.proc.mkup.time] Processed markup dev 'Jellyfin' in 0 milliseconds
------ Compiling dev 'Jellyfin' ------
BRIGHTSCRIPT: WARNING: unused variable 'tracks' in function 'selectsubtitletrack' in #30
BRIGHTSCRIPT: WARNING: unused variable 'current' in function 'selectsubtitletrack' in #31
BRIGHTSCRIPT: WARNING: unused variable 'id' in function 'sortsubtitles' in #32
Displayed 3 of 3 warnings
04-14 16:08:25.309 [scrpt.ctx.cmpl.time] Compiled 'Jellyfin', id 'dev' in 68 milliseconds (BCVer:0)
04-14 16:08:25.321 [beacon.signal] |AppCompileComplete --------> Duration(530 ms)
04-14 16:08:25.325 [ui.frm.plugin.running.enter] Entering PLUGIN_RUNNING for dev
04-14 16:08:25.325 [beacon.signal] |AppLaunchInitiate ---------> TimeBase(0 ms)
04-14 16:08:25.356 [beacon.signal] |AppSplashInitiate ---------> TimeBase(31 ms)
04-14 16:08:26.212 [beacon.signal] |AppSplashComplete ---------> Duration(856 ms)
04-14 16:08:26.359 [scrpt.ctx.run.enter] UI: Entering 'Jellyfin', id 'dev'
------ Running dev 'Jellyfin' main ------
SceneManager.init() begin
SceneManager.init() end
04-14 16:08:28.003 [beacon.signal] |AppDialogInitiate ---------> TimeBase(2678 ms)
DebugServer: Moving selected files to staging area
DebugServer: Adding stop statements for active breakpoints
DebugServer: Creating zip archive from project sources
DebugServer: Connecting to Roku via telnet at 192.168.1.36
04-14 16:22:15.517 [beacon.signal] |AppLaunchInitiate ---------> TimeBase(0 ms)
04-14 16:22:15.517 [beacon.signal] |AppCompileInitiate --------> TimeBase(0 ms)
Note: Translation file loaded: pkg:/locale/en_US/translations.ts: 105 items.
04-14 16:22:15.521 [scrpt.cmpl] Compiling 'Jellyfin', id 'dev'
04-14 16:22:15.534 [scrpt.load.mkup] Loading markup dev 'Jellyfin'
04-14 16:22:15.542 [scrpt.unload.mkup] Unloading markup dev 'Jellyfin'
04-14 16:22:15.656 [scrpt.parse.mkup.time] Parsed markup dev 'Jellyfin' in 122 milliseconds
------ Compiling dev 'Jellyfin' ------
BRIGHTSCRIPT: WARNING: unused variable 'tracks' in function 'selectsubtitletrack' in #57
BRIGHTSCRIPT: WARNING: unused variable 'current' in function 'selectsubtitletrack' in #58
BRIGHTSCRIPT: WARNING: unused variable 'id' in function 'sortsubtitles' in #59
BRIGHTSCRIPT: WARNING: unused variable 'press' in function 'onkeyevent' in #60
BRIGHTSCRIPT: WARNING: unused variable 'key' in function 'onkeyevent' in #61
BRIGHTSCRIPT: WARNING: unused variable 'press' in function 'onkeyevent' in #62
BRIGHTSCRIPT: WARNING: unused variable 'msg' in function 'onstate' in #63
BRIGHTSCRIPT: WARNING: unused variable 'msg' in function 'buffercheck' in #64
BRIGHTSCRIPT: WARNING: unused variable 'e' in function 'processclientdiscoveryresponse' in #65
BRIGHTSCRIPT: WARNING: unused variable 'key' in function 'onkeyevent' in #66
BRIGHTSCRIPT: WARNING: unused variable 'press' in function 'onkeyevent' in #67
BRIGHTSCRIPT: WARNING: unused variable 'press' in function 'onkeyevent' in #68
BRIGHTSCRIPT: WARNING: unused variable 'key' in function 'onkeyevent' in #69
BRIGHTSCRIPT: WARNING: unused variable 'press' in function 'onkeyevent' in #70
Displayed 14 of 14 warnings
04-14 16:22:15.994 [scrpt.ctx.cmpl.time] Compiled 'Jellyfin', id 'dev' in 337 milliseconds (BCVer:0)
04-14 16:22:15.997 [scrpt.proc.mkup.time] Processed markup dev 'Jellyfin' in 0 milliseconds
------ Compiling dev 'Jellyfin' ------
BRIGHTSCRIPT: WARNING: unused variable 'tracks' in function 'selectsubtitletrack' in #75
BRIGHTSCRIPT: WARNING: unused variable 'current' in function 'selectsubtitletrack' in #76
BRIGHTSCRIPT: WARNING: unused variable 'id' in function 'sortsubtitles' in #77
Displayed 3 of 3 warnings
04-14 16:22:16.037 [scrpt.ctx.cmpl.time] Compiled 'Jellyfin', id 'dev' in 39 milliseconds (BCVer:0)
04-14 16:22:16.045 [beacon.signal] |AppCompileComplete --------> Duration(528 ms)
04-14 16:22:16.047 [ui.frm.plugin.running.enter] Entering PLUGIN_RUNNING for dev
04-14 16:22:16.047 [beacon.signal] |AppLaunchInitiate ---------> TimeBase(0 ms)
04-14 16:22:16.078 [beacon.signal] |AppSplashInitiate ---------> TimeBase(30 ms)
04-14 16:22:16.826 [beacon.signal] |AppSplashComplete ---------> Duration(749 ms)
04-14 16:22:16.932 [scrpt.ctx.run.enter] UI: Entering 'Jellyfin', id 'dev'
------ Running dev 'Jellyfin' main ------
04-14 16:22:18.750 [beacon.signal] |AppDialogInitiate ---------> TimeBase(2703 ms)
BrightScript Micro Debugger.
Enter any BrightScript statement, debug commands, or HELP.
Suspending threads...
Thread selected:  1*   ...ponents/data/SceneManager.brs(13)    currentGroup = m.groups.peek()
Current Function:
012:  sub pushScene(newGroup)
013:*     currentGroup = m.groups.peek()
014:      if currentGroup <> invalid
015:          'Search through group and store off last focused item
016:          if currentGroup.focusedChild <> invalid
017:              focused = currentGroup.focusedChild
Source Digest(s): 
pkg: dev 1.4.12 05b7d892a3eecb5cf64e1d553fc89f21 Jellyfin
Interface not a member of BrightScript Component (runtime error &hf3) in #101
Backtrace:
#0  Function pushscene(newgroup As Dynamic) As Void
   file/line: #104
Local Variables:
newgroup         roSGNode:ConfigScene refcnt=2
global           Interface:ifGlobal
m                roAssociativeArray refcnt=2 count:2
currentgroup     <uninitialized>
focused          <uninitialized>
Threads:
ID    Location                                Source Code
 0[u] ??
 1*   ...ponents/data/SceneManager.brs(13)    currentGroup = m.groups.peek()
  *selected   [u]unattached(not debuggable)
Brightscript Debugger> 
@TwitchBronBron TwitchBronBron added the bug Something isn't working label Apr 14, 2022
@neilsb
Copy link
Member

neilsb commented Apr 22, 2022

Interesting. I've not personally seen it crash there, and the init() for SceneManager sets m.groups = [], so not sure why it would be undefined at that point.

Easy enough to add a check for - but a little odd. May need to investigate further.

@cewert
Copy link
Member

cewert commented May 27, 2022

I haven't run into this yet. Is this still happening for you guys after merging #544?

@cewert
Copy link
Member

cewert commented May 28, 2022

Just ran into a startup crash myself using latest dev but it's a different line. Not sure if related.

start-up crash

Edit: This is the third unique startup crash that traces back to scenemanager. They seem related somehow.
Edit2: Just had it happen again. I've ran the debugger maybe 20 times today? so that's a ~10% failure rate for me

@1hitsong
Copy link
Member

Just happened to me as well. Same spot as @cewert

Screenshot from 2022-06-17 07-59-07

@cewert
Copy link
Member

cewert commented Jul 11, 2022

Still happening on latest version of master. Crashed on me the second time I ran the debugger 😢
jellyfin-startup-crash

@neilsb
Copy link
Member

neilsb commented Jul 14, 2022

Actually this is a bigger problem than I thought. m.content is invalid at this point, which is bizarre given it's set in the init(). I guess we could try calling findNode() again at this point if it's invalid in case there's something causing it not to be set on the initial call.

If it's invalid we could not try to push the scene - would just need to test how this appears to the user, and whether we'd want to acknowledge something went wrong.

@TwitchBronBron
Copy link
Contributor Author

I spoke with a Roku developer friend about this issue a month ago, and if I remember correctly, I think there's actually some quirks around extending ContentNode. Could SceneManager extend Group instead, and just add the content field directly to SceneManager's interface?

@neilsb
Copy link
Member

neilsb commented Jul 14, 2022

The only thing that should be using content is the SceneManager itself, so shouldn't even need added to the interface. I've just changed it to extent Group and with no other changes it all seems to be working properly.

Will need to do a fair bit more testing to confirm it's not broken anything else, and even more to see if it stops the error occurring - but that change and some extra checking or try/catch's certainly shouldn't hurt.

@cewert
Copy link
Member

cewert commented Jul 14, 2022

@TwitchBronBron Thanks for your help. Are these weird roku quirks documented anywhere online? or should we start our own list?

Recently stumbled on this page where you talk about using callfunc() without parameters for example. Hoping you have more of these typed up somewhere I haven't found yet 🙏

@cewert cewert pinned this issue Jul 22, 2022
@cewert cewert unpinned this issue Jul 24, 2022
@TwitchBronBron
Copy link
Contributor Author

@TwitchBronBron Thanks for your help. Are these weird roku quirks documented anywhere online? or should we start our own list?

Recently stumbled on this page where you talk about using callfunc() without parameters for example. Hoping you have more of these typed up somewhere I haven't found yet 🙏

I'm not aware of this being documented anywhere, and I don't really know of somewhere that documents other weird quirks. RokuCommunity did start a website for documenting common patterns and stuff, so perhaps that would be the eventual place where something like this would go, but there's not a lot of content on there yet.

https://rokucommunity.github.io/roku-guide/

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants