Wednesday 24 April 2013

Beware Ping.Send and the BSOD

The application I'm working on is a partially connected client-server application, it uses a mesh network and/or 3G to synchronise databases.

To test if the client and server could communicate the Ping.Send method seemed like a good place to start (although it's not ideal, an actual WCF service has to be available too). However, if you interrupt Ping.Send mid flight... BSOD. This is only really a problem in development, if the ping is returning in a reasonable amount of time then the chances of interrupting it are slim, but if the server is unavailable, and the ping time-out is too high, and I'm stopping and restarting the application frequently this leads to 4 or 5 blue screens a day.

Disclaimer, it's something at the OS/driver level that actually causes the BSOD, I've not diagnosed exactly what and I probably wont bother, it might be something specific to my network card or could be something in Windows itself but there are plenty of other people seeing the same thing, for example...

http://social.technet.microsoft.com/Forums/en-US/w7itpronetworking/thread/1f847268-e38d-4ac3-a1ea-f41069604fd0/

http://connect.microsoft.com/VisualStudio/feedback/details/721557/bluescreen-process-has-locked-pages-netframework-ping-send

http://connect.microsoft.com/VisualStudio/feedback/details/691615/stopping-debugging-session-while-waiting-for-pingreply-causes-bsod

This final link suggests and excellent workaround...
The bug seems to appear only on .NET Framework 4.0. I do not know if the bug is in .NET 3.5 as well. I have checked, that the .NET Framework 2.0 does not show this bug. Therefore, to avoid this bug, switch back to that framework version.
...or maybe not.

Sunday 14 April 2013

New Blog

This is probably the 14th blog I've started but hopefully I'll keep this one up.

I want to blog for a few reasons, I want to play around with HTML5, CSS3 and Responsive Design, also I've recently started working for a small company and want to "discuss" software design issues. There might have been other reasons but I can't remember them now.

This isn't really the place to play with HTML and what not but this is just the start of bigger things. One day I'm sure I'll get myself a witty domain and some hosting and create my own WordPress theme.

I'll mostly be discussing .NET, C#, WPF, Prism, and maybe a little golf. Maybe a lot of golf, it's my new thing but I'm fairly terrible at it at the moment so