Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
  1. Home
  2. General Programming
  3. C#
  4. "Attempted to read or write protected memory." Why?

"Attempted to read or write protected memory." Why?

Scheduled Pinned Locked Moved C#
helptoolsperformancequestion
2 Posts 2 Posters 0 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • D Offline
    D Offline
    DPaul1994
    wrote on last edited by
    #1

    I have an windows form application with multiple forms. If I open two of these forms in a runtime, I receive this error:

    An unhandled exception of type 'System.AccessViolationException' occurred in Unknown Module.

    Additional information: Attempted to read or write protected memory. This is often an indication that other memory is corrupt.

    If there is a handler for this exception, the program may be safely continued.

    The idea is that I don't have any programs that consume so much memory and this error occurs only after I introduced in script a background worker. It can cause this problem?

    L 1 Reply Last reply
    0
    • D DPaul1994

      I have an windows form application with multiple forms. If I open two of these forms in a runtime, I receive this error:

      An unhandled exception of type 'System.AccessViolationException' occurred in Unknown Module.

      Additional information: Attempted to read or write protected memory. This is often an indication that other memory is corrupt.

      If there is a handler for this exception, the program may be safely continued.

      The idea is that I don't have any programs that consume so much memory and this error occurs only after I introduced in script a background worker. It can cause this problem?

      L Offline
      L Offline
      Lost User
      wrote on last edited by
      #2

      OutOfMemory probably wouldn't cause this. But you know the drill, debug it. What exactly causes it (not circumstances, but specific action being executed in code)? Does it still happen if the work that the background worker does is executed on the main thread?

      1 Reply Last reply
      0
      Reply
      • Reply as topic
      Log in to reply
      • Oldest to Newest
      • Newest to Oldest
      • Most Votes


      • Login

      • Don't have an account? Register

      • Login or register to search.
      • First post
        Last post
      0
      • Categories
      • Recent
      • Tags
      • Popular
      • World
      • Users
      • Groups