Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8600789
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 12, 20262026-06-12T01:41:40+00:00 2026-06-12T01:41:40+00:00

I have a computationally-expensive multi-threaded C# app that seems to crash consistently after 30-90

  • 0

I have a computationally-expensive multi-threaded C# app that seems to crash consistently after 30-90 minutes of running. The error it gives is

The runtime has encountered a fatal error. The address of the error was at 0xec37ebae, on thread 0xbcc. The error code is 0xc0000005. This error may be a bug in the CLR or in the unsafe or non-verifiable portions of user code. Common sources of this bug include user marshaling errors for COM-interop or PInvoke, which may corrupt the stack.

(0xc0000005 is the error-code for Access Violation)

My app does not invoke any native code, or use any unsafe blocks, or even any non-CLS compliant types like uint. In fact, the line of code that the debugger says caused the crash is

overallLength += distanceTravelled;

Where both values are of type double


Given all this, I believe the crash must be due to a bug in the compiler or CLR or JIT. I’d like to figure out what causes it, or at the very least write a smaller reproduction to send into Microsoft, but I have no idea where to even begin. I’ve never had to view the CIL-binary, or the compiled JIT output, or the native stacktrace (there is no managed stacktrace at the time of the crash), so I’m not sure how. I can’t even figure out how to view the state of all the variables at the time of the crash (VS unfortunately won’t tell me like it does after managed-exceptions, and outputting them to console/a file would slow down the app 1000-fold, which is obviously not an option).

So, how do I go about debugging this?


[Edit] Compiled under VS 2010 SP1, running latest version of .Net 4.0 Client Profile. Apparently it’s ".Net 4.0C/.Net 4.0E, .Net CLR 1.1.4322"

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-12T01:41:41+00:00Added an answer on June 12, 2026 at 1:41 am

    I’d like to figure out what causes it, or at the very least write a smaller reproduction to send into Microsoft, but I have no idea where to even begin.

    “Smaller reproduction” definitely sounds like a great idea here… even if “smaller” won’t mean “quicker to reproduce”.

    Before you even start, try to reproduce the error on another machine. If you can’t reproduce it on another machine, that suggests a whole different set of tests to do – hardware, installation etc.

    Also, check you’re on the latest version of everything. It would be annoying to spend days debugging this (which is likely, I’m afraid) and then end up with a response of “Yes, we know about this – it was a bug in .NET 4 which was fixed in .NET 4.5” for example. If you can reproduce it on a variety of framework versions, that would be even better 🙂

    Next, cut out everything you can in the program:

    • Does it have a user interface at all? If possible, remove that.
    • Does it use a database? See if you can remove all database access: definitely any output which isn’t used later, and ideally input too. If you can hard code the input within the app, that would be ideal – but if not, files are simpler for reproductions than database access.
    • Is it data-sensitive? Again, without knowing much about the app it’s hard to know whether this is useful, but assuming it’s processing a lot of data, can you use a binary search to find a relatively small amount of data which causes the problem?
    • Does it have to be multi-threaded? If you can remove all the threading, obviously that may well then take much longer to reproduce the problem – but does it still happen at all?
    • Try removing bits of business logic: if your app is componentized appropriately, you can probably fake out whole significant components by first creating a stub implementation, and then simply removing the calls.

    All of this will gradually reduce the size of the app until it’s more manageable. At each step, you’ll need to run the app again until it either crashes or you’re convinced it won’t crash. If you have a lot of machines available to you, that should help…

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have a computationally expensive task in perl, and would like to inform the
I have a few computationally expensive properties on some classes. These properties do not
I have to write a program that performs highly computationally intensive calculations. The program
I have made a simple, but relatively computationally complex, UDF that queries a rarely
I am developing a web app in Rails that needs to perform computationally intensive
We have a process that is computationally intensive. When it runs it typically it
I am using scipy's weave.inline to perform computationally expensive tasks. I have problems returning
I have a function that performs a very expensive computational task on a click
I have written a code in native C++ for a computationally expensive numerical analysis
I have thousands of lines of MATLAB code that realizes different computationally intensive operations

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.