Errors

Error 0xc0000005? The program closed while it was running

Short answerError 0xc0000005 means a running program referenced memory it was not allowed to read, write, or run. Memory is the PC's short-term working space. Windows closed the program. Which programs close decides the fix:
  • One program closes — that program, or something it loads, is at fault. Repair it, then update it.
  • One program closes on one file or task — the file or the add-on it loads is at fault. Test without it.
  • Many unrelated programs close — a shared cause: a damaged Windows file, a faulty driver, or failing memory. Repair Windows files, then test the memory.
Save your work in other programs first. This code can close a program without asking, and unsaved work in that program is usually lost.

A program you were using closes. Sometimes a box names the fault: Exception code: 0xc0000005. Sometimes the program is just gone, and the code is in the event log.

This is not a startup code like 0xc0000142. The program opened and ran. Then it reached for memory it should not use, and Windows ended it to protect the rest of the PC.

Do it by hand below, or let Noah read this PC's event logs and installed software first (more at the end).

What 0xc0000005 means

Memory here is RAM — the PC's short-term working space, where running programs keep what they are using now. Windows gives each program its own part and keeps the parts apart.

Microsoft names code 0xC0000005 STATUS_ACCESS_VIOLATION. Inside its own part, the program referenced memory it was not allowed to read, write, or run. Windows closed it to stop the fault spreading to the rest of the PC.

The code says a program reached wrongly. It does not say why. A fault in the program, a damaged file it loads, and failing memory can all produce the same code.

First, name the program that closed

The event log names the program and, often, the file inside it that faulted. That second name is called the faulting module. It is the strongest clue this code gives.

zsh — Terminal
% Get-WinEvent -FilterHashtable @{LogName='Application'; StartTime=(Get-Date).AddDays(-1)} | Where-Object { $_.Message -like '*0xc0000005*' } | Format-List TimeCreated, ProviderName, Id, Message

Run in PowerShell; no administrator rights needed. Read the program name and the faulting module name in each entry. No entries does not prove nothing closed, because not every closure is written to this log.

Then answer one question. Does only this program close, or do unrelated programs close too? That answer picks the section below.

NoahNoah searches the Application and System logs for entries that mention the program, and reads the Windows version and build. The search covers the most recent 2,000 events in the time window, so an empty result does not prove nothing closed. Noah has no built-in memory test, and it cannot tell from the code whether the program or the memory is at fault.

Only one program closes

The same program closes, in the middle of work or at the same step. Other programs stay open.

The fault is in that program or in a file it loads. Repair it first, then update it. An update matters here: makers fix this class of fault in their own code, and no Windows setting fixes it for them.

Fixrepair the program first. Search for Control Panel, open Programs → Programs and Features, right-click the program, and choose Repair, or Change if Repair isn't offered. Then open the program and install its latest update. If repair is not offered, uninstall it, restart, and reinstall it from the maker's site.

Apps from the Microsoft Store repair in Settings instead. On Windows 11, open Apps → Installed apps, click ⋯ next to the app, and choose Advanced options → Repair. On Windows 10, open Apps → Apps & features, select the app, and choose Advanced options → Repair.

For a game, use the store's own repair as well. In Steam, right-click the game, open Properties → Installed Files, and choose Verify integrity of game files.

NoahNoah lists the software installed on the PC, with each program's version and maker. That list shows the installed version, so it can be compared with the maker's latest. It does not show whether an update fixes this fault.

It closes on one file or one task

The program stays open on other files. It closes on the same document, save, export, or level each time.

Then the trigger is what that task loads. That can be a damaged file, or an add-on — extra software a program loads inside itself, such as an extension or a plug-in.

Fixopen the program on a new, plain file and do a small part of the same task. If it stays open, turn off the program's add-ons and extensions, then try the failing file again. Turn them back on one at a time to find the one that closes it.

If a new file closes it too, go back to the section above. The fault is in the program, not in your file. Keep a copy of the failing file before you test with it again.

NoahNoah has no built-in list of the add-ons inside a program. Which add-ons a program loads is set inside that program.

Many unrelated programs close

Programs from different makers close with 0xc0000005, often starting around the same day.

Unrelated programs share Windows files, the drivers — the software that lets Windows talk to a piece of hardware — and the memory itself. One of those shared parts is at fault.

Repair Windows' own files first. DISM supplies good copies of system files, and SFC (System File Checker) uses them to replace damaged ones. Microsoft says to run DISM before SFC.

Fixtype cmd in the Search box, right-click Command Prompt, and choose Run as administrator. Then run these one at a time:

zsh — Terminal
% DISM.exe /Online /Cleanup-image /Restorehealth

Run in the administrator Command Prompt. Microsoft notes it can take several minutes. Wait until it reports the operation completed successfully.

zsh — Terminal
% sfc /scannow

Run after DISM finishes. Don't close the window until verification reaches 100%. Then restart and try the programs again.

If programs still close, check what changed when they started closing. In Settings → Windows Update → Update history, note any driver updated nearest the first closure. A driver loads into Windows itself, so a faulty one closes unrelated programs. If one driver was updated just before, test it before testing the memory.

Fixsearch for Device Manager and open it. Find the device that driver belongs to, right-click it, and choose Properties. On the Driver tab, choose Roll Back Driver if it is offered, then restart and use the PC. If the closures stop, that driver was the cause. If Roll Back Driver is greyed out, note the driver name and version instead, from the same tab.

If programs still close, test the memory. Faulty RAM — the memory hardware itself — makes unrelated programs reach wrongly, and no repair of files fixes it.

Fixsave your work and close your programs. Search for Windows Memory Diagnostic, open it, and choose Restart now and check for problems. The PC restarts and tests. Leave time for it; the PC cannot be used during the test. Read the result in Event Viewer → Windows Logs → System, under the source MemoryDiagnostics-Results.

If the test reports errors, get hands-on help before opening the PC. Memory hardware sits inside it, and a laptop may not allow access at all. If it reports none and you have not rolled a driver back, do that test above next.

NoahNoah can search the Application and System logs for one program name at a time, so checking several programs means one search each. Noah has no built-in DISM or SFC repair, and no built-in memory test.

What to avoid

  • Changing DEP or memory settings from a forum post. DEP (Data Execution Prevention) is a Windows protection that stops a program running data as code. Turning it off removes a protection, and the protection is not the fault this page tests for.
  • Downloading a DLL from a DLL download site. The faulting module name is a clue, not an order. Those copies come from unknown sources and may be the wrong version.
  • Reinstalling Windows as the first step. One closing program is that program's fault until a test says otherwise. Repair and update it first.
  • Testing on your only copy of a file. This code can close a program mid-save. Keep a copy of the file that triggers it.
Try Noah free

Work that stays open.

Just tell Noah what's wrong:

A program keeps closing and shows error 0xc0000005.
Find why it closesFirst conversation freeNew customers: 7-day free trialOnly with your OK

Already have Noah? Open it on this problem →

Frequently asked questions

What does error 0xc0000005 mean?

It is Windows' code STATUS_ACCESS_VIOLATION. A running program referenced memory it was not allowed to read, write, or run, inside its own address space, so Windows closed it. The event log usually names the program and the faulting module, which is the file inside it that faulted.

Is 0xc0000005 a virus?

The code alone does not say that. It is produced by a fault in a program, a damaged file it loads, a driver, or failing memory. If unrelated programs started closing on the same day, repair Windows files and test the memory as the sections above set out.

Why does only one program close with 0xc0000005?

Because the fault is in that program or in a file it loads. Repair it in Control Panel, then install its latest update from the maker. If it closes on one file or task, test a plain file with its add-ons turned off.

Can faulty RAM cause 0xc0000005?

Yes. When many unrelated programs close with this code, failing memory is one of the shared causes. Run Windows Memory Diagnostic, which restarts the PC and tests the memory. Errors there mean the hardware needs attention. Read the result under MemoryDiagnostics-Results in Event Viewer, and get hands-on help before opening the PC — a laptop may not allow access at all.

Should I turn off DEP to fix 0xc0000005?

No. DEP is a Windows protection, and turning it off removes that protection from the PC. Repair the closing program, repair Windows files with DISM then SFC, and test the memory if unrelated programs close.

Commands in this guide are standard, read-only macOS diagnostics unless noted; anything that changes your system is called out. When in doubt, back up first with Time Machine.