2

I am developing a client/server application as part of my dissertation and have chosen to use SocketAsyncEventArgs to get the maximum amount of performance in terms of network operations. This afternoon I decided to run a quick and dirty stress test of the application creating 20 threads and sending 100,000 UDP messages per thread. Near the end of the application the following exception:

enter image description here

How do I go about finding the cause of the exception? Or does any body have an idea why it's falling over at a seemingly random place?

I can re-produce most of the time I believe and am happy to provide code if necessary.

Update:

I have run the exact same code on .Net version 4.0 without error. It seems to be an issue with .Net 4.5/Compliers/Jit as far as I can tell. Any ideas on how to narrow down the exception would be greatly appreciated.

Stuart Blackler
  • 3,732
  • 5
  • 35
  • 60
  • possible duplicate of [Troubleshooting .NET "Fatal Execution Engine Error"](http://stackoverflow.com/questions/2823440/troubleshooting-net-fatal-execution-engine-error) – Hans Passant Feb 09 '13 at 15:34
  • I did see that @HansPassant but it's at the same place every time with a different error code than presented in the dup. Thanks for the link though – Stuart Blackler Feb 09 '13 at 15:45
  • do you have checked that your application is threadsafe?! maybe you do some ipc and didn't have implemented a good callback-method...?! pls tell me some more informations of how your app will cleanup the threads, what should be communicated between the threads, and if so, how you think to do this. btw. do you use some native (unsafe) codeparts, or some COM-parts (like an activeX-lib)? greetz, me – Nico Söllinger Feb 09 '13 at 19:35
  • @NicoSöllinger I think for the most part it is thread-safe. The whole codebase at the moment is using `SocketAsyncEventArgs` and the `xxxxAsync` methods. Therefore, I assume the threads are cleaned up on my behalf. There is no additional components such as com, though I am using a `Semaphore` and `lock(){}` to manage resources to a `Stack`. – Stuart Blackler Feb 09 '13 at 22:26
  • @HansPassant I have narrowed it down to an issue with .Net 4.5. The code runs fine on .Net 4.0. Any ideas on how I can take it forward to find the cause from here? – Stuart Blackler Feb 12 '13 at 03:11
  • @NicoSöllinger see above ^ – Stuart Blackler Feb 12 '13 at 03:12
  • If you're convinced that this is a .NET 4.5 bug and can repro it on other machines then take this to Microsoft Support. They'll need a repro project to work with, be sure you have one that you can send them. They'll take a chunk out of your credit card but you will get that back when they confirmed it is their bug. – Hans Passant Feb 12 '13 at 03:27

1 Answers1

0

Does it only occur when debugging? I have seen a similar case, where I would get these errors only when debugging x86(not any type) on x86.