I have a program written in C#, running on a Windows CE device (on Compact Framework). It processes minimal user actions (button clicks), uses serial port and TCP/IP communication.
The problem is: sometimes the software shuts down on it's own. Well, at least the main form can't be seen any more. In the background the application (or parts of the application) seems still running (at least in one documented case it was) because it uses the serial port, so restarting the application doesn't help. I can't reproduce the problem since it happens in most of the cases when there is no user interaction, no serial port communication and the network communication is all "i am still alive" messages, the software just crashes seemingly without reason. (I try to make it happen in debug mode to know at least where is the problem in the code if it is a software bug, but I have no luck so far.)
Since I'm running out of ideas, the question is: what bug or exception or OS action or hardware malfunction can use such a behavior? The problem has been seen on different devices of the same type, so it shouldn't be a hardware error. (Or all my hardwares has the same error.) Exceptions are handled, so it shouldn't be an exception. Unhandled exceptions are handled too, so it shouldn't be an unhandled exception either. (My guess is that it is caused by a StackoverflowException
because I don't know any other exceptions that can't be catched, but there isn't recursion in the code, at least not willingly, so it shouldn't be a possibility either.)