AccessViolationException

Quickly I want to say I LOVE this product - when it works :)
Attempted to read or write protected memory. This is often an indication that other memory is corrupt.
Description: An unhandled exception occurred during the execution of the current web request. Please review the stack trace for more information about the error and where it originated in the code.

Exception Details: System.AccessViolationException: Attempted to read or write protected memory. This is often an indication that other memory is corrupt.

Source Error:


Line 6845: "s DBNull.", e)
Line 6846: End Try
Line 6847: End Get
Line 6848: Set
Line 6849: Me(Me.tableTransportationContractDetails.CONTRACT_MDQ_IDColumn) = value

Source File: C:\Documents and Settings\tyreero\My Documents\Visual Studio 2005\Projects\GCS Accounting\Transportation\Transportation.Dataset\strong_transportation.vb Line: 6847

I am profiling an ASP.NET application and the backing VB class libraries. I have profiled this specific page at least 10 times today and then out of nowhere this error pops. I have had this same error on an equally obscure line of code before and I usually just gave up for the day. I have tried closing all apps and rebooting and it continues to error. Also once this happens I usually cannot close the profiler gracefully.

Is there any information I can provide to help find the cause?

Windows XP sp2
IIS 5.1
.NET 2.0
ANTS 2.6 (It happened in 2.5 also)

Comments

  • Brian DonahueBrian Donahue Posts: 6,590 Bronze 1
    Hello,

    Sorry for the delay in answering. This has happened before, but we do not know the cause of the error. It may be happening in the unmanaged part of ANTS Profiler. Does it still happen if you change the settings to profile all methods rather than just the ones with source?
  • Next time it comes up I will try that and report back.
  • Hello,

    Sorry for the delay in answering. This has happened before, but we do not know the cause of the error. It may be happening in the unmanaged part of ANTS Profiler. Does it still happen if you change the settings to profile all methods rather than just the ones with source?
    This is one of three posts I have seen with exactly the same error. I just downloaded, installed and ran the ANTS profiler software yesterday afternoon. It ran with no problems at all using the option to profile only source code, and non-source code.

    Just a few minutes ago, I began to get this error. The error was only specifying code that I have not updated today, and it would specify a different line of code each time.

    Per the suggestion in this post, I then tried running the profile for non-source code, and I didn't receive any errors. The profiler ran as expected.

    Other than adding new classes today and having rebuilt the application a handful of times, there has been only one change on my system. I raised my page file size earlier today and rebooted. The beginning size and the maximum size are now the same.

    Does this help? Other than this hiccup, I like the software so far... But this is quite a large problem for me.
    Will
  • Hi Will,

    Are you seeing this on ANTS Profiler 3 or 2.7?

    If 2.7, I'd highly recommend upgrading to version 3 - we fixed a few things that may have lead to this previously.

    If you're on 3 already, then I'm surprised you're seeing it. Have you tried profiling in Fast Mode, and if so, do you still get the error?

    Thanks,
    Robert
    Robert Chipperfield
    Red Gate
  • Robert wrote:
    Hi Will,

    Are you seeing this on ANTS Profiler 3 or 2.7?

    If 2.7, I'd highly recommend upgrading to version 3 - we fixed a few things that may have lead to this previously.

    If you're on 3 already, then I'm surprised you're seeing it. Have you tried profiling in Fast Mode, and if so, do you still get the error?

    Thanks,
    Robert
    The version I just downloaded a few days ago is 3.0.0.342. (Keep in mind that I am using the trial version, so I am not sure if that is a contributing factor.)

    I don't know if this will be a contributing factor either. I normally run this while I have my VS.Net IDE open. Right now, it is not. I have not altered any memory related settings in Windows today either. The other day, I had.

    I am not sure why I would want to run in fast mode, but I did just for you... :)

    Running in...
    Fast Mode for only .Net methods w/ source = normal response
    Fast Mode for all .Net methods = normal response
    Detail Mode for only .Net methods w/ source = normal response
    Detail Mode for all .Net methods = normal response

    Strangely enough, I obviously had different results yesterday. Weird!

    I next took this a step further. Since I was opening an existing setting from My Documents folder, I used those this time and once again received the "normal response" from ANTS. It seems that my memory exception has mysteriously disappeared for now. Good news for me... but not so good for Red-Gate because the problem still exists "somewhere".

    If ANTS caches anything for long term in a temporary file or in memory, this may have been the culprit before.

    *** FOUND IT! ***
    Since I indeed had the VS.Net 2005 and VWD Express IDE's open yesterday, I duplicated that scenario... I opened each. I made a change to my class library in VS.Net and rebuilt it. I then rebuilt my web site which in turn grabbed the newly built class library. Now, when I run the profiler in source mode, it sends back the memory error every time.

    Can I get a cookie? :)
    Will
  • Hi Will,

    Thanks for investigating some more.

    With the current version of the class library (that which gives you the error), can you try profiling without VS / VWD open, and confirm that you still have problems?

    In case you're wondering, the reason I asked you to try in fast mode is that when running in fast mode, we don't add instrumentation to the code. This removes one possible cause of errors, so it's usually a good first check for us.

    Rob
    Robert Chipperfield
    Red Gate
  • Robert wrote:
    Hi Will,

    Thanks for investigating some more.

    With the current version of the class library (that which gives you the error), can you try profiling without VS / VWD open, and confirm that you still have problems?

    In case you're wondering, the reason I asked you to try in fast mode is that when running in fast mode, we don't add instrumentation to the code. This removes one possible cause of errors, so it's usually a good first check for us.

    Rob
    Once I close the IDE's, the memory error no longer occurs. At least in my situation, you now have a partial answer to this intermittent problem.

    Seriously, where's my cookie? :lol: Hehehe...
    Will
Sign In or Register to comment.