Forum C# MDA Error

MDA Error

Postby mfranzs » May 11th, 2011, 11:31 pm

Hello-

Just recently, I started getting this error at seemingly random times when running my game. It will be running smoothly, then suddenly crash, and I get this error in a pop up box in visual studio (not in the output window).

DisconnectedContext was detected
Message: Context 0x4f0bf0' is disconnected. Releasing the interfaces from the current context (context 0x4f09c8).This may cause corruption or data loss. To avoid this problem, please ensure that all contexts/apartments stay alive until the applicationis completely done with the RuntimeCallableWrappers that represent COM components that liveinside them.


Does anyone know why this happens?

Any help would be greatly appreciated!
mfranzs
 
Posts: 98
Joined: August 29th, 2010, 3:27 am

Re: MDA Error

Postby mfranzs » May 14th, 2011, 8:01 pm

I think I've figured out the problem:

I'm outputting an immense amount of debug text... for debugging

Once I close the flash window, the server continues to output text for another 20 seconds or so, before it crashes or stops.

Is there a better way to debug?

(Im using Console.WriteLine() right now)
mfranzs
 
Posts: 98
Joined: August 29th, 2010, 3:27 am

Re: MDA Error

Postby WindieGames » May 15th, 2011, 4:09 am

What are you outputing that's so intense?
WindieGames
 
Posts: 35
Joined: January 30th, 2011, 1:36 am

Re: MDA Error

Postby mfranzs » May 15th, 2011, 4:10 am

Uhm...

Im trying to output everything thats going on (meaning lots of output every 60 ms... around 20 lines :| ) to figure out bugs...

So.. yeah ^_^
mfranzs
 
Posts: 98
Joined: August 29th, 2010, 3:27 am

Re: MDA Error

Postby Oliver » May 17th, 2011, 12:49 pm

Hey,

Great feedback -- We haven't battletested the developmentserver with TONS of text output, so you found a bug there. Now we just need to get it fixed.

- Oliver
User avatar
Oliver
.IO
 
Posts: 1159
Joined: January 12th, 2010, 8:29 am

Re: MDA Error

Postby Oliver » May 17th, 2011, 3:08 pm

Hey,

I can't reproduce it... even with this code:

Code: Select all
   public class GringoGame : Game<MPlayer> {
      public override void UserJoined(MPlayer player) {
         AddTimer(delegate{
            Console.WriteLine("heeey");
            Console.WriteLine("heeey");
            Console.WriteLine("heeey");
            Console.WriteLine("heeey");
            Console.WriteLine("heeey");
            Console.WriteLine("heeey");
            Console.WriteLine("heeey");
            Console.WriteLine("heeey");
            Console.WriteLine("heeey");
         },30);
      }

      public override void UserLeft(MPlayer player) {
         for(int i = 0; i != 1000; i++) {
            Console.WriteLine("heeey");
            Console.WriteLine("heeey");
            Console.WriteLine("heeey");
            Console.WriteLine("heeey");
            Console.WriteLine("heeey");
            Console.WriteLine("heeey");
            Console.WriteLine("heeey");
            Console.WriteLine("heeey");
            Console.WriteLine("heeey");
            Console.WriteLine("heeey");
         }
      }

      public override void GameClosed() {
         for(int i = 0; i != 1000; i++) {
            Console.WriteLine("heeey");
            Console.WriteLine("heeey");
            Console.WriteLine("heeey");
            Console.WriteLine("heeey");
            Console.WriteLine("heeey");
            Console.WriteLine("heeey");
            Console.WriteLine("heeey");
            Console.WriteLine("heeey");
            Console.WriteLine("heeey");
            Console.WriteLine("heeey");
         }
      }
   }


Is is possible for you to zip up your project (server+client) and send it to me for the purpose of debugging this issue?

- Oliver
User avatar
Oliver
.IO
 
Posts: 1159
Joined: January 12th, 2010, 8:29 am

Re: MDA Error

Postby mfranzs » May 17th, 2011, 8:45 pm

Wow, sure, thanks! How can I send it to you?
mfranzs
 
Posts: 98
Joined: August 29th, 2010, 3:27 am

Re: MDA Error

Postby Benjaminsen » May 18th, 2011, 9:57 am

mfranzs wrote:Wow, sure, thanks! How can I send it to you?


You can send it to Oliver using his email oliver [at] player.io
Benjaminsen
.IO
 
Posts: 1444
Joined: January 12th, 2010, 11:54 am
Location: Denmark

Re: MDA Error

Postby mfranzs » May 18th, 2011, 8:41 pm

Thanks!

I sent it :D
mfranzs
 
Posts: 98
Joined: August 29th, 2010, 3:27 am

Re: MDA Error

Postby mfranzs » May 22nd, 2011, 3:23 am

Hey Oliver:

Thanks for the fix!

You guys are incredible on your feedback and support! :D
mfranzs
 
Posts: 98
Joined: August 29th, 2010, 3:27 am

Re: MDA Error

Postby Oliver » May 25th, 2011, 11:40 am

Hey,

The fix is in the latest build, version 2.2.2.

- Oliver
User avatar
Oliver
.IO
 
Posts: 1159
Joined: January 12th, 2010, 8:29 am

Re: MDA Error

Postby mfranzs » May 25th, 2011, 9:42 pm

Wow, thanks!
mfranzs
 
Posts: 98
Joined: August 29th, 2010, 3:27 am

Re: MDA Error

Postby mfranzs » May 26th, 2011, 12:36 am

Just tested it out-

Works perfectly.

You guys are AWESOME!
mfranzs
 
Posts: 98
Joined: August 29th, 2010, 3:27 am

Re: MDA Error

Postby mechanicallyseparatedgames » September 24th, 2014, 8:57 am

Sorry if anyone is offended by me necro bumping such an old thread, but I believe I have a similar issue. If you have any insight into this issue, I'd appreciate the help.

I'm also getting the MDA errors, and like the OP, I am printing a lot of writelines to the development server (if that ever was the real issue) and on the client. However, I'm doing it with a twist: I'm trying to "simultaneously" launch lots of clients on my PC via a batch file to stress test my game. I can get 4 clients to run at a time without a problem (my game is a 4 player game), but as soon as I increase to 8 or more, I'll get the MDA error.

My batch file is essentially like:

This works:

Code: Select all
START C:\MyGame\bin\mygame.exe
START C:\MyGame\bin\mygame.exe
START C:\MyGame\bin\mygame.exe
START C:\MyGame\bin\mygame.exe


This results in an MDA error:

Code: Select all
START C:\MyGame\bin\mygame.exe
START C:\MyGame\bin\mygame.exe
START C:\MyGame\bin\mygame.exe
START C:\MyGame\bin\mygame.exe
ECHO.
START C:\MyGame\bin\mygame.exe
START C:\MyGame\bin\mygame.exe
START C:\MyGame\bin\mygame.exe
START C:\MyGame\bin\mygame.exe


If I "manually" execute the batch file and wait until each set of 4 clients has loaded most of their data, it seems that I can get quite a few clients to load without the MDA error, but that's not surprising due to the wait that I'm injecting.

BTW, if I keep adding clients, I get the following error once I go over 45 clients:

NetworkManager.ConnectToServiceRoom.CreateJoinRoom.Error(Cannot join room $service-room$ because: PlayerIOClient.PlayerIOError: NoServersAvailable; There is no server in any of the selected server clusters [mechanicallyseparatedgames: Development Cluster] that are eligible to start a new room in (they're all at full capacity or there are no servers in any of the clusters). Either change the selected clusters for your game in the admin panel, try again later or start some more servers for one of your clusters.)

It appears that $service-room$ doesn't spawn new rooms at the 75% capacity point on the local development server. Maybe that's documented somewhere and I haven't yet read it.
mechanicallyseparatedgames
 
Posts: 18
Joined: June 18th, 2014, 6:24 am


Return to C#