1.11.0 No connection could be made because the target machine actively refused it (3 Viewers)

Snoopy87

Portal Pro
August 12, 2012
470
167
Home Country
Germany Germany
Same happens with switching between 3 different channels in the same test scenario.

Edit:

Ok, the bug is not happening while deleting the timeshift files. I compiled the TVService and added detailed output. There is happening an IO Exception because of not deleting a timeshift file (a process is accessing this file, which should be fixed because it is the same process), but the TV Server is then still running a few moments until crash, so the crash happens somewhere elese.
 
Last edited:

Snoopy87

Portal Pro
August 12, 2012
470
167
Home Country
Germany Germany
Please, I need help!

I made hundreds of tests and added tons of log output to find the method where TVServer is crashing. I can't find it. It seems to be an issue with multiple threads, because I am unable to find the issue in the main workflow of TVService.

This method in TVController.cs runs until the end:
private TvResult StartTimeShifting(ref IUser user, int idChannel, out VirtualCard card, bool forceCardId,
out bool cardChanged)

which is called by (also in TVController.cs):
public TvResult StartTimeShifting(ref IUser user, int idChannel, out VirtualCard card, bool forceCardId)


But will happen then?
public bool StopTimeShifting(ref IUser user) in TVController.cs is not called when TVService is crashed. So the crash happens after StartTimeshift is called successfully and before StopTimeShifting was started. I can't see what's happening between those calls within the source code. Are there any threads running? Where does the timeshifting itselfs happen in code?

Edit:
@Mods: Please move this thread to TV Server Bug Reports or Development, etc.
 

mm1352000

Retired Team Member
  • Premium Supporter
  • September 1, 2008
    21,577
    8,224
    Home Country
    New Zealand New Zealand
    I made hundreds of tests and added tons of log output to find the method where TVServer is crashing. I can't find it.
    Adding log output is unlikely to help.
    Did you try to attach a debugger to the TV service (or try to run the TV service with VS) as I previously suggested? That is probably the most efficient way to find when/where the crash is occurring.

    It seems to be an issue with multiple threads, because I am unable to find the issue in the main workflow of TVService.
    So you think a background thread that is running in the TV service (eg. the scheduler thread) is causing the crash? If this were the case I would expect to see output in the logs. I doubt your theory because I don't see log output.

    This method in TVController.cs runs until the end:
    private TvResult StartTimeShifting(ref IUser user, int idChannel, out VirtualCard card, bool forceCardId,
    out bool cardChanged)

    which is called by (also in TVController.cs):
    public TvResult StartTimeShifting(ref IUser user, int idChannel, out VirtualCard card, bool forceCardId)
    Isn't your plugin using the TV control interface? If so, you should be checking the functions in TvServer.cs, not TVController.cs.
    Command flow is: plugin -> TV control -> .NET remoting -> TV controller.
    You are missing quite a lot of the code when you only check the TV controller.

    But will happen then?
    After the command finishes (control passes back to your plugin) TV Server just waits for another command. See the "main loop":
    https://github.com/MediaPortal/Medi...vEngine3/TVLibrary/TvService/Service1.cs#L945

    public bool StopTimeShifting(ref IUser user) in TVController.cs is not called when TVService is crashed. So the crash happens after StartTimeshift is called successfully and before StopTimeShifting was started. I can't see what's happening between those calls within the source code.
    The function of the TV service is mostly just to obey commands from clients or plugins. If there are no commands then TV service will be doing nothing.
    In other words: your plugin is responsible for what happens between StartTimeShifting() and StopTimeShifting().

    Are there any threads running?
    Of course! There are many background threads running in the TV service. You can see them if you attach a debugger.

    Having said that, as I said above: I don't think the crash is caused by an existing thread. Two reasons:
    1. No log output.
    2. TV service does not normally crash like this.
    I think something in your environment or that you have introduced - most likely something about your plugin - is causing the crash. I can't tell you what it is because I'm not able to test your plugin, and I don't even have the code to look at.

    It's fine if you don't believe me. You'll just have to check every thread in the TV service.

    Where does the timeshifting itselfs happen in code?
    I don't understand your question.
     

    Hell_Angel

    Portal Pro
    June 17, 2005
    79
    10
    Home Country
    Finland Finland
    After I updated to 1.11.0, my TV server started to crash suddenly too. No logs, no error messages, no nothing. It just exits and werfault.exe starts at the same time. I also had serious trouble to get TV server installed. After I did clean install, it worked okay for a while, but now it started to do it again. So, I'm with Snoopy87 on this one, I think there really is something mysterious going on with TV server. Never seen it acting like this before.
     
    Last edited:

    mm1352000

    Retired Team Member
  • Premium Supporter
  • September 1, 2008
    21,577
    8,224
    Home Country
    New Zealand New Zealand
    @Hell_Angel
    That's all well and good... but it doesn't give anybody anything to go on.
    There have been few if any changes in TV Server recently:
    https://github.com/MediaPortal/MediaPortal-1/commits/master/TvEngine3

    Mostly changes in the TV plugin, and tuning details. Those won't cause TV Server to crash.
    In other words, there's no reason for crashing to start after an upgrade unless something else changed or your installation is bad.
     

    Hell_Angel

    Portal Pro
    June 17, 2005
    79
    10
    Home Country
    Finland Finland
    Yes, I know. You have kind of funny attitude. There clearly is something going on with TV server, since many members have informed, they've had problems installing TV server and now these mysterious disappearings of it's process. What can we do to help you, when nothing gets produced? There is problems with MP, but you deny it, because we can't send you logs, that doesn't even get produced? I get warning from time to time, when TV service cannot start, so I can send a screenshot, when it happens next time. Why does it matter, if not much have changed, since this clearly is problem with TV server? Older versions never did this, there are problems with installing and even when I did clean install and got it right, after a week, it started doing it again. You're not even trying to help, just denying that there even is problem. I don't run any plugins or processes of my own, just clean install of MP, so it's definitely not only Snoopy87's problem. I hope more people show up, if they're having same problems. Maybe we can convince developers to look into it.

    EDIT: It happened again. TV Service won't start at all anymore. This warning pops up every now and then.
     

    Attachments

    • error.jpg
      error.jpg
      130.4 KB
    Last edited:

    Users who are viewing this thread

    Top Bottom