TVServerKodi causes a crash for TVservice (1 Viewer)

karniemi

Portal Pro
November 11, 2010
65
12
Hi,

The actual root cause for the crash is probably in TVServerKodi:
http://forum.kodi.tv/showthread.php?tid=242855

But...should the plug-in interface of MP tolerate such exceptions...without stopping the TVservice? Anything that could be done in MP side for a more robust experience?
 

azzuro

Test Group
  • Team MediaPortal
  • May 10, 2007
    9,234
    4,879
    France - IDF
    France France
    Country flag
    hello @karniemi, welcome on board,

    i'm despite to announce you, we can't help you on the kodi support, we are not able to use your Player, try on kodi forum. maybe member can have the solution.

    but, post your logs files, maybe we have an issue on our codes...
     

    mm1352000

    Development Group
  • Team MediaPortal
  • September 1, 2008
    21,571
    8,218
    New Zealand New Zealand
    Country flag
    @karniemi
    Thanks for reporting. :)
    From what I can see in the limited details you posted on the KODI forum, I agree that TVServerKodi seems to be causing the crash and there's nothing that TV Server can do to avoid it. Technically it is possible the root cause is something within TV Server itself (eg. related to accessing your recordings, or something like that). However that seems unlikely because we haven't had any similar reports of stability problems here.
     

    karniemi

    Portal Pro
    November 11, 2010
    65
    12
    Thanks for such quick response. Attaching full log -I was supposed to add that in my orig. post in kodi forum....but I really could not find means to attach files there :-(.

    So...:
    1) MP TVService has no safety net for such issues in plugins? So a crash in a nice-to-have-plugin, brings down the whole TVservice process ...and disturbs the recording of my wifes required-to-record-favorite-tv-show...or my required-to-record-ron-jeremy-film...
    2) TVService has no watchdog that would start it again after crash?
     

    Attachments

    mm1352000

    Development Group
  • Team MediaPortal
  • September 1, 2008
    21,571
    8,218
    New Zealand New Zealand
    Country flag
    1) MP TVService has no safety net for such issues in plugins? So a crash in a nice-to-have-plugin, brings down the whole TVservice process ...and disturbs the recording of my wifes required-to-record-favorite-tv-show...or my required-to-record-ron-jeremy-film...
    LOL at Ron Jeremy :D

    In answer to your question: of course TV Server has a safety net. However, plugins run in the same process as TV Server. Therefore internal plugin exceptions can still bring down the service as you have seen.

    2) TVService has no watchdog that would start it again after crash?
    No. The Windows service configuration seems to be adequate:
    upload_2015-10-13_10-47-39.png


    Change "take no action" to "restart the service" (or whatever you prefer).
     

    karniemi

    Portal Pro
    November 11, 2010
    65
    12
    OK, did some studying... I started wondering that how come is some un-handled exception in a background thread bringing down the whole process...since that's not what I've experienced on other programming envs. Well, it seems to be a special case of .net since 2.0 version. And that really calls for some strict policy in the MP plug-in framework...and/or requires very disciplined&aware plug-in developers.[DOUBLEPOST=1444769279][/DOUBLEPOST]...so basically either MP should enclose all plugins/threads in try-catch blocks...or...the plug-ins should do that themselves. Or both. But well, my recordings are not quite that critical anyway :)...
     
    Last edited:

    mm1352000

    Development Group
  • Team MediaPortal
  • September 1, 2008
    21,571
    8,218
    New Zealand New Zealand
    Country flag
    Pretty much, yes. :)

    TV Server registers to receive unhandled exceptions from any source within the process:
    https://github.com/MediaPortal/Medi...TvEngine3/TVLibrary/TvService/Service1.cs#L89

    The exception handler is here:
    https://github.com/MediaPortal/Medi...vEngine3/TVLibrary/TvService/Service1.cs#L111

    You can see that the exception handler is the source of the log entries that you found... and actually it is also responsible for stopping the service (ie. the exception isn't directly killing). We choose to stop the service because in that context (global process exception handler) it is not possible to know/determine if it is safe/appropriate to continue running... or whether the exception is really critical.
     

    mm1352000

    Development Group
  • Team MediaPortal
  • September 1, 2008
    21,571
    8,218
    New Zealand New Zealand
    Country flag

    karniemi

    Portal Pro
    November 11, 2010
    65
    12
    Would so much like to argue...but reading a few articles from ggl-srch "plugin .net catch exceptions thread" revealed that resistance is futile ;). Seems to be quite a common gotcha for AppDomains & .net plug-in applications. Thanks mm1352000!
     

    Users Who Are Viewing This Thread (Users: 0, Guests: 1)

    OP Similar threads Forum Replies Date
    S TVServerKodi Plugin für diverse MP 2 Versionen... Allgemeines Support- und Diskussionsforum 17
    Lehmden TVServerKodi Plugin for MP 2.2 MediaPortal 2 20
    RoChess Weird GPU crash -- possible cause: resizing media MediaPortal 1 Talk 8
    Rob Hexenmeister DVD Skip steps causing crash General Support 2
    D Skip to end/live during dvbip recording causes it to stop playing instead. General Support 15
    G limit upscaling, due to 4k causing audio glitches General Support 4
    A cursor.wav or click.wav set in keyboard and keys cause recordings to be set in upcoming episodes 1.20 2
    B Changing to Full HD causes crash of Video Driver General Support 13
    gibman changing TV ch. causes black screen pause. Archive 1
    S Player crash - BASS: Play caused an exception: System.NullReferenceException Watch / Listen Media 1
    U [solved] MediaPortal crashing on startup General Support 10
    torone Dritter versuch mit Mediaportal 2 Allgemeines Support- und Diskussionsforum 1
    W [solved] MP suddenly Crashes when starting live TV on most channels and on recordings from the same channels General Support 20
    W [solved] MP suddenly Crashes when starting live TV on some channels and on some recordings Television (MyTV frontend and TV-Server) 1
    D [solved] Changed username in Win10, now TV Server config crashes on fresh install Installation, configuration support 1
    ajs Trakt error when start with MP crash Trakt 1
    R TV server crash with WintTV quadHD General 0
    Dark Eyes TVService locks up or fails to restart on resuming from sleep, and crashes when grabbing EPG Installation, configuration support 7
    atlantic [solved] MP1.24 Pre released crash in TV General Support 12
    RoChess Random GPU crash leads to MePo restart, but works fine afterwards MediaPortal 1 14
    R [fixed] [MP2-819] MP2 Server crashes on ATSC OTA channel scan Submit: Bug Reports 33
    doskabouter 1.23.0 Crash when skipping in a dvd Bugreports 3
    J [fixed] [MP2-833] 2.2.2 server crash during import Submit: Bug Reports 50
    P MP2 TV Server crashes when starting - throws error remoting exception General 2
    G MP Crashed during setting up recording. Newcomers Forum 1
    Similar threads

























    Top Bottom