4.2.11.1 - G120 crash in socket.accept :-(

Unfortunately i have to discover that network is still unreliable. :wall:

Socket.Accept() either returns error code 10054 or 10056 which might be acceptable but in 50% of the cases the board crashes and start to output low level MCU Exceptions.

below is part of debug out to COM1

12:25:41.266 GetData.OpenCloseCounter: 2
12:25:41.323 GetData.OpenCloseCounter: 1
12:25:41.426 GetData.OpenCloseCounter: 0
12:25:41.470 call FileStream() on file: SD\wwwroot\images\trade\bgslaapid.png openCloseCounter=1
12:25:41.505 call FileStream() on file: SD\wwwroot\images\trade\downloadbutton.png openCloseCounter=2
12:25:41.720 GetData.OpenCloseCounter: 1
12:25:41.795 GetData.OpenCloseCounter: 0

HERE THE LOW LEVEL OUTPUT START <<<<<
EXCEPTION 0x05:
cpsr=0x21000000
pc =0x0005ebce
lr =0x0006273d
sp =0x1000f968
r00 =0x00000000
r01 =0x00000000
r02 =0x00000001
r03 =0x00000fff
r04 =0xa014511c

While that output should not happen, if it does and we have a test program we can relatively easy find the problem.

Anything you can provide that we can run to see this issue? We are done with SDK so we should be able to get back on this quickly.

I am going back to the previous SDK who didn’t showed this issue. Will use that for the time being and keep my fingers crossed. I will not spoil any minute more on G120/GHI netmf 4.2 It already gave me to much sleepless nights. Time to take radical steps.

@ RobvanSchelven -

what interface are you using?

@ Dat I am afraid i don’t understand your question. Interface of what? If you mean network interface its the RS9110 Wi-Fi

Update:
Returning back to SDK R2 also shows the error as first discovered in SDK R3 by me. Unfortunately it wasn’t noticed before.

The attachment shows 2 network traffic traces. In one trace the G120 crashes and in the other trace the socket.accept returned error 10056 4 times but finally the requested files were delivered to the client browser.

If can make this happen regularly, can you please try with Ethernet instead of WiFi? Do you still see the same behavior? We want to solve this ASAP but we need more info if you can help.

@ RobvanSchelven -

Can you provide some more information like what kind of switch (part #), and show us some code, please.

@ Dat - Hope to send you some details in the course of the week. What i already can share is that the problem until now only shows up when using the Opera webbrowser version 12 running on windows7 32 bit. The webbrowser is requesting an image file and then it goes wrong. It looks like that the socket or underlying TCP/IP network code on the G120 does not handle the request properly.

time for network monitor/wireshark to get a capture of the communication going on.

1 Like

@ RobvanSchelven -

[quote]
Opera webbrowser version 12 running on windows7 32 bit. The webbrowser is requesting an image file [/quote]

  • So other webbrowser work???
  • How did you load the image? how big is it? is it cached in a buffer or will be loaded from media device for every single request?

Try fiddler first before you dive into wireshark…

@ Dat - Yes, other browsers do work. The following piece of JavaScript add html code to the DOM and as a result the webbrowser requests for the 2 image files.


 $('#allmeasurings').append('<div class="map_name"><div class="mapFrame"><div class="mapData"><canvas class="smallpMap" id="pol' + i + '" onmouseover="OnMouseOverPolaroid(' + i + ');" onclick="OnClickPolaroid(' + i + ');" style="background-color: grey;"></canvas></div><div id="homepMapIcon' + i + '" class="homepMapIcon"><img src="images/trade/HomeIcon.png" alt="" /></div><div class="deletepMapIcon"><img src="images/trade/CloseButton.png" style="width:100%; height:100%;" alt="" onclick="onclickDeletepMan(' + i + ');" /></div></div><label id="tm' + i + '">meting ' + (i + 1) + '</label></div>');

The requested image “HomeIcon.png” is 3208 bytes in size and “CloseButton.png” is 4328 bytes in size. The files are stored on an SD memory card.

When the webbrowser starts to execute the process of getting the images some negotiating network traffic can been seen in a network protocol analyzer. Sometimes this result in G120 crash and sometimes this results in delivering the requested files. When the G120 does not crash the first 4 socket.Accept’s generates a socketexception with code 10056 but the next 2 socket.Accept’s are legal and results in the delivering of the requested files.

Only the first time the browser request this files it goes wrong. Once loaded new requests does not fail.

@ andre.m - Yes, the browser picks them from his cache. I checked if maybe for additional requests a http request was made like IsModifiedSince… but that’s not the case, so yes the 2nd attempt it comes from the browser cache.

When the system does not crash this is what i can see from debug output… 4 x an exception and then 2 normal socket.accepts

10:45:26.160 10/30/2013 10:45:26,2,Exception Message: Exception was thrown: System.Net.Sockets.SocketException StackTrace: Microsoft.SPOT.Net.SocketNative::acceptSystem.Net.Sockets.Socket::AcceptSenticsLib.MyHttpServer::RunBedApplication.Program::Main, Exeption in Accept SocketErrorCode: 10056
10:45:26.557 10/30/2013 10:45:26,2,Exception Message: Exception was thrown: System.Net.Sockets.SocketException StackTrace: Microsoft.SPOT.Net.SocketNative::acceptSystem.Net.Sockets.Socket::AcceptSenticsLib.MyHttpServer::RunBedApplication.Program::Main, Exeption in Accept SocketErrorCode: 10056
10:45:26.947 10/30/2013 10:45:26,2,Exception Message: Exception was thrown: System.Net.Sockets.SocketException StackTrace: Microsoft.SPOT.Net.SocketNative::acceptSystem.Net.Sockets.Socket::AcceptSenticsLib.MyHttpServer::RunBedApplication.Program::Main, Exeption in Accept SocketErrorCode: 10056
10:45:27.341 10/30/2013 10:45:27,2,Exception Message: Exception was thrown: System.Net.Sockets.SocketException StackTrace: Microsoft.SPOT.Net.SocketNative::acceptSystem.Net.Sockets.Socket::AcceptSenticsLib.MyHttpServer::RunBedApplication.Program::Main, Exeption in Accept SocketErrorCode: 10056
10:45:27.448 ACCEPT received
10:45:27.498 incdecREQ:1
10:45:27.508 Do Socket.Poll
10:45:27.519 Socket.Poll Select Read TRUE
10:45:27.533 ACCEPT received
10:45:27.598 incdecREQ:2
10:45:27.608 Do Socket.Poll
10:45:27.640 Socket.Poll Select Read TRUE
10:45:27.694 /images/trade/HomeIcon.png
10:45:27.760 /images/trade/CloseButton.png

When the system crash it looks like it happens in the first socket.accept. I must say that when this particular request is done, already 100’s of previous request are made and handled without problems.

@ andre.m - True, i have done traces as you can see in one if the first posts. The problem is that i can’t do much on the G120 device site. Debugging on G120 needs to be done in the Socket / TCP/IP stack code.