none
"Attempted to read or write protected memory. This is often an indication that other memory is corrupt" RRS feed

  • Question

  • Hello dear All,

    I am having a big issue with our asp.net 2.0 application after migrating the app from Windows XP to our new dedicated Windows 2003 Server.

    The issue:

    Any call to HttpWebRequest req = (HttpWebRequest)HttpWebRequest.Create("Valid url with valid and short response");

    fails with the following error: "Attempted to read or write protected memory. This is often an indication that other memory is corrupt"

    Calling one COM object used for PDF generation (iTextSharp) results in the same error, but I believe the cause is the same, so if I find the solution to the first issue, the second will be resolved as well.

    I don't think that the memory is corrupt as the message suggest, because EVERY call fails. If the memory would truly be corrupt, then at least some calls would go through. I guess it is unlikely that this call is ALWAYS placed in to the same, corrupted, memory area.

    What I checked already:

    As everything was working just fine under XP, I believe there are no code errors here. I checked that machine.config on the Windows 2003 Server is same as that on the XP and it is. Then I tried creating Windows Forms application, calling same code, in order to check if the issue is only ASP.Net specific. The same line of code failed with same error message. So, I suspect, that there is a security setting somewhere that doesn't allow my .Net apps to perform these tasks, but I have no idea what it is.

    Could anyone try helping me with this?

     

    Thanks a lot in advance!

    Daniel
    Thursday, September 25, 2008 10:53 AM

Answers

  • Well, the issue was solved by reinstalling the .Net Framework... Trivial, but I could never think that there could be installation issues on a brand new unused server.
    Friday, September 26, 2008 4:16 PM

All replies

  • Second issue fixed by replacing:

    iTextSharp.Text.Image pdfImage = iTextSharp.Text.Image.GetInstance(PATH);

    with an overloaded version of the same GetInstance functoin that takes bytes array rather than path to file:

    byte[] logo = File.ReadAllBytes(PATH);

    iTextSharp.Text.Image pdfImage = iTextSharp.Text.Image.GetInstance(logo);

     

    Weird, weird, weird... I have no clue what the reason is... just tried it...

    The firs issue is still unsolved :(

    Friday, September 26, 2008 3:02 PM
  • Well, the issue was solved by reinstalling the .Net Framework... Trivial, but I could never think that there could be installation issues on a brand new unused server.
    Friday, September 26, 2008 4:16 PM