Attempted to read or write protected memory. This is often an indication that other memory has been corrupted

Rate It (1)

Last post 11-05-2009 4:38 PM by DBMaster. 25 replies.

Sort Posts:

  • Re: Attempted to read or write protected memory. This is often an indication that other memory has been corrupted

    06-10-2008, 2:38 AM
    • Member
      2 point Member
    • sars_212
    • Member since 06-10-2008, 6:34 AM
    • Posts 1

    Hi all,

    I have a problem with xsl transform.

    It throw the same error:Attempted to read or write protected memory. This is often an indication that other memory has been corrupted

    please, any have an idea, 

     

  • Re: Attempted to read or write protected memory. This is often an indication that other memory has been corrupted

    10-03-2008, 1:42 PM
    • Member
      22 point Member
    • supered
    • Member since 02-03-2006, 8:27 PM
    • Posts 6

     Thank you for this post. I was having the same issues during testing while incorporating ClearAllPools() functionality into my wrapper classes. I couldn't figure it out because I wasn't looking close enough. But this posting helped me recongnize my issue. I did not specify my parameter direction in one of my paramters and I was getting this memory error.

     

    Thanks for the post.

     

     

    archana.basarur:

     If anybody getting the above mentioned error while running database query from .net, then please check the query/oledb command parameter type/values/order of oledb parameters properly...most of the times i faced the above exception because these werent proper.... Just instead of giving proper message it throws wiered message of "memory.."...

  • Re: Attempted to read or write protected memory. This is often an indication that other memory has been corrupted

    12-16-2008, 4:29 PM
    • Member
      2 point Member
    • coderforrent
    • Member since 12-16-2008, 9:29 PM
    • Posts 1
    We were able to determine that the issue is with DEP (Data Execution Prevention).  This is a “feature” of Windows 2003 that is supposed to stop viruses from being able to attack the system’s memory.  In this case, it was stopping the client’s application from importing the reference correctly. The solution to get past this error is: 
    1.  Right click My Computer and click Properties
    2.  Click the Advanced tab
    3. Click the Settings button in the Performance section
    4. Make sure the radio button labeled “Turn on DEP for all processes and services except the ones I select” is checked
    5. Click Add at the bottom of the list
    6. Browse to the executale that they are going to run and select it
    7. Make sure the checkbox next to the executables name in the list is selected and click OK

     

    Thanks,
    CoderForRent
    http://silverlightgantt.codeplex.com
  • Re: Attempted to read or write protected memory. This is often an indication that other memory has been corrupted

    01-22-2009, 4:39 AM
    • Member
      2 point Member
    • tbhakee
    • Member since 01-22-2009, 9:34 AM
    • Posts 1

    Hi,

    I have tried every thing that is mentioned in this thread but no improvement. Can someone please help resolve the issue.

    Many Thanks,

    Bhakee 

     

     

    Filed under: , ,
  • Re: Attempted to read or write protected memory. This is often an indication that other memory has been corrupted

    01-28-2009, 4:41 PM

    Sorry guy,

    This is a generic message and tells you very little about the specific problem.  The other folks are being helpful in relating their experiences, but it sounds like you have a true malloc bug.  Try a free trial of Compuware's devstudio heap checker, check your new/frees, and any memory allocations/leaks you perform.  Look at linked dlls,etc...

  • Re: Attempted to read or write protected memory. This is often an indication that other memory has been corrupted

    02-06-2009, 12:38 PM
    • Member
      14 point Member
    • Garzon
    • Member since 04-28-2006, 2:01 AM
    • Posts 24

    I've tried EVERYTHING to fix this problem.. after 2 days of site down and many customers complaining I found the solution.. Maybe it helps someone..

     I have 3 starting points, one is my retail site, other is the administration of my website and another is an area to control our stock by another team. I noticed that only two of these starting points were getting this error message.. one of them weren't and they share the same .dll with all the procedures in C#.

    The difference of the 2 applications that weren't running to the application that was running perfectly was the full trust configuration in the web.config file:

    <system.web>

    <trust level="Full"/>

    </system.web>

    I hope it helps someone, as it fixed my problem. :)

  • Re: Attempted to read or write protected memory. This is often an indication that other memory has been corrupted

    05-13-2009, 6:19 AM
    • Member
      2 point Member
    • sheenu.kamra
    • Member since 05-13-2009, 10:12 AM
    • Posts 1
    Hi,, I got the same error when i m doing testing on my Video management software. i was stopping my server and another instant i got this error.. My application is based in .net framework.. but i didnot get exactly what would be the reason.. please help me out in this problem..
  • Re: Attempted to read or write protected memory. This is often an indication that other memory has been corrupted

    06-12-2009, 10:08 PM
    • Member
      11 point Member
    • mc9000
    • Member since 09-19-2008, 9:55 PM
    • USA
    • Posts 7

     I got this problem just as soon as I upgraded to DotNet FW 3.5 SP1 on a commercial storefront package.  Been looking for a solution, nothing in this forum works.

    To make matters far worse, the web application cannot be loaded into Visual Studio 2008 with FW 3.5 SP1 loaded on that machine, making debugging completely impossible.

    FW2.5 SP1 does not uninstall completely, making a complete rebuild of the Operating System the only possible solution (after 100+ hours w/ "experts" and thousands of dollars later, that was their advice!) just to get back to normal.

    Good luck!  There is no solution to this except to completely re-build your application from scratch on a Framework 3.5SP1 machine w/VS2008 SP1 and not using ANY 3rd party dlls (unless you can get a written guarantee that their code is fully compatible and not just re-packaged crapware).

  • Re: Attempted to read or write protected memory. This is often an indication that other memory has been corrupted

    08-26-2009, 8:24 AM
    • Member
      4 point Member
    • nafej
    • Member since 01-30-2009, 5:54 PM
    • Posts 2

    I ran into the same issue after upgrading to Windows 7 (and IIS7) A WCF service that was previously working started to get this error.


    To fix, I went into the Build properties of my projects (Project/properties/Build Tab) and changed the Platform Targer to "x86". Then the problem was gone.


  • Re: Attempted to read or write protected memory. This is often an indication that other memory has been corrupted

    09-07-2009, 1:54 PM
    • Member
      2 point Member
    • bhuvan1980
    • Member since 09-07-2009, 5:50 PM
    • Posts 3

    I ran into similar problem but after too much research I found out that problem was something very different. I had set the Impersonation =  true in web.config and IBM Db2 on my windows 2003 server didnt have permissions for all users. I just set it to false (or remove it) and my application started working.

     

    I hope this helps..

     

     

  • Re: Attempted to read or write protected memory. This is often an indication that other memory has been corrupted

    11-05-2009, 4:38 PM
    • Member
      108 point Member
    • DBMaster
    • Member since 09-01-2007, 3:33 AM
    • Posts 30

    in NET you have managed and unmanaged code. Depends where your C++ belongs.
    If managed you probably won't have problems. This is why I suggest it is unmanaged (let's say C++ 6)

    This is why, in case to access its functions you must include it in your project solution using References -> Com.
    This will create a managed code wrapper so you could use as shown in your code

    string test1 = 'asasasdfsad';
    Test( test1.ToCharArray());


    Otherwise you;re trying to access memory which usually is not allowed to your C# code.

    Please Mark Answer. 

Page 2 of 2 (26 items) < Previous 1 2