EMX freezes after Garbage Collection

@ leforban -

in my explanation post 38#, it can be easy to reproduce it.

Hello @ Dat

Youā€™re right it seems that it starts to appear just after including eth stuff in our code (using UDP socket). My code is not supposed to open more than one socket but I will checkā€¦

@ leforban -


void TestConnect()
{
        socket a;
      a = new socket(...);
       a.connect(...);
       .....
} 

If TestConnect is called more than 32 times, it also mean more than 32 socket object have been created. Because that function will be broken at a.connect() (if connection is failed) and a is NOT destroyed.

We may need only one socket to connect, but usually if there is a failed connection (and this bug is only happened when connection fails), and we try again, again => more than 32 times, maybe it will be crashed.

It should be :


socket a; // or static socket a;
void TestConnect()
{
        if (a!=null)
       {
          a.Dispose()
          
       }
       a = null;
       Debug.gc()
       a = new socket(...);
       a.connect(...);
       .....
} 

We are only creating 3 maybe 4 connections at any one time so this does not solve the issue in our case. Is there any update on the expected resolution date or the plan to resolve this issue, or can anyone suggest anything else? Is there any update from Microsoft on whether they plan to fix this in 4.2 or has it been fixed in 4.3.

We just need to be able to provide our customer with information so they can be reassured that it will be resolved.

@ GarethM -

if you are sure there is only 3-4 connections so I donā€™t think your problem is related to this.
And actually until now we havenā€™t seen any bug crash when call GC after 3-4 failed connections.

So, try to post your code here or start a new thread.

As my explanation, you can not count these connections in your code, only one way to know that is debug it. Like my first code (#44), there is only one connection at one time, but it will be crashed if call it more than 32 times and all of them are failed.

@ Dat - I colleague and I were the ones that originally raised this issue and in our code we are only opening one socket to the server and we still get this issue.

It only occurs when the server is offline, since our device opens a connection attempts to connect then disconnects. Could it be that the socket is not being freed up when the connection fails and causing the retries to build up to 32 connections.

@ Evan Khizkial -

Yes.
Then did you apply the way we posted? how is it now?

@ Evan Khizkial -

We fixed this issue, if you want a test firmware you can email to GHI